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": "string with CRLF newlines\n crlfDict = { aKey: 'Test\\r\\nNew\\r\\nLines' };\n\n # When: the dictionary is compiled to st",
"end": 5867,
"score": 0.9577533602714539,
"start": 5847,
"tag": "KEY",
"value": "Test\\r\\nNew\\r\\nLines"
},
{
"context": "t crated for LF-only source\n lfDict = { aKey: 'Test\\nNew\\nLines' };\n stringsFileContent.should.equal(i18nStrin",
"end": 6119,
"score": 0.9504832029342651,
"start": 6103,
"tag": "KEY",
"value": "Test\\nNew\\nLines"
}
] | test/test.coffee | pgmarchenko/i18n-strings-files | 0 | fs = require('fs')
should = require('should')
i18nStringsFiles = require('../index')
fileTemp = __dirname + '/temp.strings'
fileTest = __dirname + '/test.strings'
fileEncoding = 'UTF-16'
checkValues = (data) ->
data['test-normal'].should.equal("Test normal")
data['test-chars'].should.equal("Olvidé mi contraseña")
data['test-new-lines'].should.equal("Test\nNew\nLines")
data['test-quotes'].should.equal("\"Test quote\"")
data['test-semicolon'].should.equal("Test \"; semicolon")
data['test-spacing'].should.equal("Test spacing")
data['test \n edge" = '].should.equal("Test edge")
data['test-multiline-comment'].should.equal("Test multiline comment")
checkValuesWithComments = (data) ->
data['test-normal']['text'].should.equal("Test normal")
data['test-normal']['comment'].should.equal("Normal")
data['test-chars']['text'].should.equal("Olvidé mi contraseña")
data['test-chars']['comment'].should.equal("Special characters")
data['test-new-lines']['text'].should.equal("Test\nNew\nLines")
data['test-new-lines']['comment'].should.equal("Escaped new lines")
data['test-quotes']['text'].should.equal("\"Test quote\"")
data['test-quotes']['comment'].should.equal("Escaped quotes")
data['test-semicolon']['text'].should.equal("Test \"; semicolon")
data['test-semicolon']['comment'].should.equal("Quote and semicolon case")
data['test-spacing']['text'].should.equal("Test spacing")
data['test-spacing']['comment'].should.equal("Messed up spacing")
data['test \n edge" = ']['text'].should.equal("Test edge")
data['test \n edge" = ']['comment'].should.equal("Edge case")
data['test-multiline-comment']['text'].should.equal("Test multiline comment")
data['test-multiline-comment']['comment'].should.equal("Multiline\nComment")
describe 'Sync: Reading file into object', ->
it 'should populate object properties with values', ->
data = i18nStringsFiles.readFileSync(fileTest, fileEncoding)
checkValues(data)
it 'should populate object properties with values (wantsComments = true)', ->
data = i18nStringsFiles.readFileSync(fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
describe 'Sync: Read, compile, parse', ->
it 'should populate object properties with values before and after', ->
data = i18nStringsFiles.readFileSync(fileTest, fileEncoding)
checkValues(data)
str = i18nStringsFiles.compile(data)
data = i18nStringsFiles.parse(str)
checkValues(data)
it 'should populate object properties with values before and after (wantsComments = true)', ->
data = i18nStringsFiles.readFileSync(fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
str = i18nStringsFiles.compile(data, true)
data = i18nStringsFiles.parse(str, true)
checkValuesWithComments(data)
describe 'Sync: Read, write, read', ->
it 'should populate object properties with values before and after', ->
data = i18nStringsFiles.readFileSync(fileTest, fileEncoding)
checkValues(data)
i18nStringsFiles.writeFileSync(fileTemp, data, fileEncoding)
data = i18nStringsFiles.readFileSync(fileTemp, fileEncoding)
checkValues(data)
fs.unlinkSync(fileTemp)
it 'should populate object properties with values before and after (wantsComments = true)', ->
data = i18nStringsFiles.readFileSync(fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
i18nStringsFiles.writeFileSync(fileTemp, data, { 'encoding' : fileEncoding, 'wantsComments' : true })
data = i18nStringsFiles.readFileSync(fileTemp, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
fs.unlinkSync(fileTemp)
describe 'Async: Reading file into object', ->
it 'should populate object properties with values', (done) ->
i18nStringsFiles.readFile fileTest, fileEncoding, (err, data) ->
checkValues(data)
done()
it 'should populate object properties with values (wantsComments = true)', (done) ->
i18nStringsFiles.readFile fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err, data) ->
checkValuesWithComments(data)
done()
describe 'Async: Read, write, read', ->
it 'should populate object properties with values before and after', (done) ->
i18nStringsFiles.readFile fileTest, fileEncoding, (err, data) ->
checkValues(data)
i18nStringsFiles.writeFile fileTemp, data, fileEncoding, (err) ->
i18nStringsFiles.readFile fileTemp, fileEncoding, (err, data) ->
checkValues(data)
fs.unlinkSync(fileTemp)
done()
it 'should populate object properties with values before and after (wantsComments = true)', (done) ->
i18nStringsFiles.readFile fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err, data) ->
checkValuesWithComments(data)
i18nStringsFiles.writeFile fileTemp, data, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err) ->
i18nStringsFiles.readFile fileTemp, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err, data) ->
checkValuesWithComments(data)
fs.unlinkSync(fileTemp)
done()
describe 'Async: Read, write, read (no encoding param)', ->
it 'should populate object properties with values before and after', (done) ->
i18nStringsFiles.readFile fileTest, (err, data) ->
checkValues(data)
i18nStringsFiles.writeFile fileTemp, data, (err) ->
i18nStringsFiles.readFile fileTemp, (err, data) ->
checkValues(data)
fs.unlinkSync(fileTemp)
done()
describe 'Compilation', ->
it 'shall replace windows-style CRLF newlines with LF(mac/unix) newlines', (done) ->
# Given: a dictionary containing a value string with CRLF newlines
crlfDict = { aKey: 'Test\r\nNew\r\nLines' };
# When: the dictionary is compiled to strings file format
stringsFileContent = i18nStringsFiles.compile(crlfDict);
# Then: the resulting content shall match the content crated for LF-only source
lfDict = { aKey: 'Test\nNew\nLines' };
stringsFileContent.should.equal(i18nStringsFiles.compile(lfDict));
done() | 159404 | fs = require('fs')
should = require('should')
i18nStringsFiles = require('../index')
fileTemp = __dirname + '/temp.strings'
fileTest = __dirname + '/test.strings'
fileEncoding = 'UTF-16'
checkValues = (data) ->
data['test-normal'].should.equal("Test normal")
data['test-chars'].should.equal("Olvidé mi contraseña")
data['test-new-lines'].should.equal("Test\nNew\nLines")
data['test-quotes'].should.equal("\"Test quote\"")
data['test-semicolon'].should.equal("Test \"; semicolon")
data['test-spacing'].should.equal("Test spacing")
data['test \n edge" = '].should.equal("Test edge")
data['test-multiline-comment'].should.equal("Test multiline comment")
checkValuesWithComments = (data) ->
data['test-normal']['text'].should.equal("Test normal")
data['test-normal']['comment'].should.equal("Normal")
data['test-chars']['text'].should.equal("Olvidé mi contraseña")
data['test-chars']['comment'].should.equal("Special characters")
data['test-new-lines']['text'].should.equal("Test\nNew\nLines")
data['test-new-lines']['comment'].should.equal("Escaped new lines")
data['test-quotes']['text'].should.equal("\"Test quote\"")
data['test-quotes']['comment'].should.equal("Escaped quotes")
data['test-semicolon']['text'].should.equal("Test \"; semicolon")
data['test-semicolon']['comment'].should.equal("Quote and semicolon case")
data['test-spacing']['text'].should.equal("Test spacing")
data['test-spacing']['comment'].should.equal("Messed up spacing")
data['test \n edge" = ']['text'].should.equal("Test edge")
data['test \n edge" = ']['comment'].should.equal("Edge case")
data['test-multiline-comment']['text'].should.equal("Test multiline comment")
data['test-multiline-comment']['comment'].should.equal("Multiline\nComment")
describe 'Sync: Reading file into object', ->
it 'should populate object properties with values', ->
data = i18nStringsFiles.readFileSync(fileTest, fileEncoding)
checkValues(data)
it 'should populate object properties with values (wantsComments = true)', ->
data = i18nStringsFiles.readFileSync(fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
describe 'Sync: Read, compile, parse', ->
it 'should populate object properties with values before and after', ->
data = i18nStringsFiles.readFileSync(fileTest, fileEncoding)
checkValues(data)
str = i18nStringsFiles.compile(data)
data = i18nStringsFiles.parse(str)
checkValues(data)
it 'should populate object properties with values before and after (wantsComments = true)', ->
data = i18nStringsFiles.readFileSync(fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
str = i18nStringsFiles.compile(data, true)
data = i18nStringsFiles.parse(str, true)
checkValuesWithComments(data)
describe 'Sync: Read, write, read', ->
it 'should populate object properties with values before and after', ->
data = i18nStringsFiles.readFileSync(fileTest, fileEncoding)
checkValues(data)
i18nStringsFiles.writeFileSync(fileTemp, data, fileEncoding)
data = i18nStringsFiles.readFileSync(fileTemp, fileEncoding)
checkValues(data)
fs.unlinkSync(fileTemp)
it 'should populate object properties with values before and after (wantsComments = true)', ->
data = i18nStringsFiles.readFileSync(fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
i18nStringsFiles.writeFileSync(fileTemp, data, { 'encoding' : fileEncoding, 'wantsComments' : true })
data = i18nStringsFiles.readFileSync(fileTemp, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
fs.unlinkSync(fileTemp)
describe 'Async: Reading file into object', ->
it 'should populate object properties with values', (done) ->
i18nStringsFiles.readFile fileTest, fileEncoding, (err, data) ->
checkValues(data)
done()
it 'should populate object properties with values (wantsComments = true)', (done) ->
i18nStringsFiles.readFile fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err, data) ->
checkValuesWithComments(data)
done()
describe 'Async: Read, write, read', ->
it 'should populate object properties with values before and after', (done) ->
i18nStringsFiles.readFile fileTest, fileEncoding, (err, data) ->
checkValues(data)
i18nStringsFiles.writeFile fileTemp, data, fileEncoding, (err) ->
i18nStringsFiles.readFile fileTemp, fileEncoding, (err, data) ->
checkValues(data)
fs.unlinkSync(fileTemp)
done()
it 'should populate object properties with values before and after (wantsComments = true)', (done) ->
i18nStringsFiles.readFile fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err, data) ->
checkValuesWithComments(data)
i18nStringsFiles.writeFile fileTemp, data, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err) ->
i18nStringsFiles.readFile fileTemp, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err, data) ->
checkValuesWithComments(data)
fs.unlinkSync(fileTemp)
done()
describe 'Async: Read, write, read (no encoding param)', ->
it 'should populate object properties with values before and after', (done) ->
i18nStringsFiles.readFile fileTest, (err, data) ->
checkValues(data)
i18nStringsFiles.writeFile fileTemp, data, (err) ->
i18nStringsFiles.readFile fileTemp, (err, data) ->
checkValues(data)
fs.unlinkSync(fileTemp)
done()
describe 'Compilation', ->
it 'shall replace windows-style CRLF newlines with LF(mac/unix) newlines', (done) ->
# Given: a dictionary containing a value string with CRLF newlines
crlfDict = { aKey: '<KEY>' };
# When: the dictionary is compiled to strings file format
stringsFileContent = i18nStringsFiles.compile(crlfDict);
# Then: the resulting content shall match the content crated for LF-only source
lfDict = { aKey: '<KEY>' };
stringsFileContent.should.equal(i18nStringsFiles.compile(lfDict));
done() | true | fs = require('fs')
should = require('should')
i18nStringsFiles = require('../index')
fileTemp = __dirname + '/temp.strings'
fileTest = __dirname + '/test.strings'
fileEncoding = 'UTF-16'
checkValues = (data) ->
data['test-normal'].should.equal("Test normal")
data['test-chars'].should.equal("Olvidé mi contraseña")
data['test-new-lines'].should.equal("Test\nNew\nLines")
data['test-quotes'].should.equal("\"Test quote\"")
data['test-semicolon'].should.equal("Test \"; semicolon")
data['test-spacing'].should.equal("Test spacing")
data['test \n edge" = '].should.equal("Test edge")
data['test-multiline-comment'].should.equal("Test multiline comment")
checkValuesWithComments = (data) ->
data['test-normal']['text'].should.equal("Test normal")
data['test-normal']['comment'].should.equal("Normal")
data['test-chars']['text'].should.equal("Olvidé mi contraseña")
data['test-chars']['comment'].should.equal("Special characters")
data['test-new-lines']['text'].should.equal("Test\nNew\nLines")
data['test-new-lines']['comment'].should.equal("Escaped new lines")
data['test-quotes']['text'].should.equal("\"Test quote\"")
data['test-quotes']['comment'].should.equal("Escaped quotes")
data['test-semicolon']['text'].should.equal("Test \"; semicolon")
data['test-semicolon']['comment'].should.equal("Quote and semicolon case")
data['test-spacing']['text'].should.equal("Test spacing")
data['test-spacing']['comment'].should.equal("Messed up spacing")
data['test \n edge" = ']['text'].should.equal("Test edge")
data['test \n edge" = ']['comment'].should.equal("Edge case")
data['test-multiline-comment']['text'].should.equal("Test multiline comment")
data['test-multiline-comment']['comment'].should.equal("Multiline\nComment")
describe 'Sync: Reading file into object', ->
it 'should populate object properties with values', ->
data = i18nStringsFiles.readFileSync(fileTest, fileEncoding)
checkValues(data)
it 'should populate object properties with values (wantsComments = true)', ->
data = i18nStringsFiles.readFileSync(fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
describe 'Sync: Read, compile, parse', ->
it 'should populate object properties with values before and after', ->
data = i18nStringsFiles.readFileSync(fileTest, fileEncoding)
checkValues(data)
str = i18nStringsFiles.compile(data)
data = i18nStringsFiles.parse(str)
checkValues(data)
it 'should populate object properties with values before and after (wantsComments = true)', ->
data = i18nStringsFiles.readFileSync(fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
str = i18nStringsFiles.compile(data, true)
data = i18nStringsFiles.parse(str, true)
checkValuesWithComments(data)
describe 'Sync: Read, write, read', ->
it 'should populate object properties with values before and after', ->
data = i18nStringsFiles.readFileSync(fileTest, fileEncoding)
checkValues(data)
i18nStringsFiles.writeFileSync(fileTemp, data, fileEncoding)
data = i18nStringsFiles.readFileSync(fileTemp, fileEncoding)
checkValues(data)
fs.unlinkSync(fileTemp)
it 'should populate object properties with values before and after (wantsComments = true)', ->
data = i18nStringsFiles.readFileSync(fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
i18nStringsFiles.writeFileSync(fileTemp, data, { 'encoding' : fileEncoding, 'wantsComments' : true })
data = i18nStringsFiles.readFileSync(fileTemp, { 'encoding' : fileEncoding, 'wantsComments' : true })
checkValuesWithComments(data)
fs.unlinkSync(fileTemp)
describe 'Async: Reading file into object', ->
it 'should populate object properties with values', (done) ->
i18nStringsFiles.readFile fileTest, fileEncoding, (err, data) ->
checkValues(data)
done()
it 'should populate object properties with values (wantsComments = true)', (done) ->
i18nStringsFiles.readFile fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err, data) ->
checkValuesWithComments(data)
done()
describe 'Async: Read, write, read', ->
it 'should populate object properties with values before and after', (done) ->
i18nStringsFiles.readFile fileTest, fileEncoding, (err, data) ->
checkValues(data)
i18nStringsFiles.writeFile fileTemp, data, fileEncoding, (err) ->
i18nStringsFiles.readFile fileTemp, fileEncoding, (err, data) ->
checkValues(data)
fs.unlinkSync(fileTemp)
done()
it 'should populate object properties with values before and after (wantsComments = true)', (done) ->
i18nStringsFiles.readFile fileTest, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err, data) ->
checkValuesWithComments(data)
i18nStringsFiles.writeFile fileTemp, data, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err) ->
i18nStringsFiles.readFile fileTemp, { 'encoding' : fileEncoding, 'wantsComments' : true }, (err, data) ->
checkValuesWithComments(data)
fs.unlinkSync(fileTemp)
done()
describe 'Async: Read, write, read (no encoding param)', ->
it 'should populate object properties with values before and after', (done) ->
i18nStringsFiles.readFile fileTest, (err, data) ->
checkValues(data)
i18nStringsFiles.writeFile fileTemp, data, (err) ->
i18nStringsFiles.readFile fileTemp, (err, data) ->
checkValues(data)
fs.unlinkSync(fileTemp)
done()
describe 'Compilation', ->
it 'shall replace windows-style CRLF newlines with LF(mac/unix) newlines', (done) ->
# Given: a dictionary containing a value string with CRLF newlines
crlfDict = { aKey: 'PI:KEY:<KEY>END_PI' };
# When: the dictionary is compiled to strings file format
stringsFileContent = i18nStringsFiles.compile(crlfDict);
# Then: the resulting content shall match the content crated for LF-only source
lfDict = { aKey: 'PI:KEY:<KEY>END_PI' };
stringsFileContent.should.equal(i18nStringsFiles.compile(lfDict));
done() |
[
{
"context": " # or ['Form', 'enterer', 'last_name', '!=', 'Chomsky']\n getFilterExpressionString = (query) ->\n ",
"end": 1279,
"score": 0.9998014569282532,
"start": 1272,
"tag": "NAME",
"value": "Chomsky"
}
] | app/scripts/views/query-representation.coffee | OpenSourceFieldlinguistics/dative | 7 | define [
'./representation'
'./../utils/utils'
], (RepresentationView, utils) ->
# Query Representation View
# -------------------------
#
# A view for the representation of a field whose value is a query over some
# collection of resources. A "query" here is modelled on an OLD SQL-style
# query, i.e., essentially an SQL WHERE-clause (with relational/join-related
# decisions made for you).
#
# fe = [object, attribute, relation, value]
# fe = [object, attribute, relation, value]
# fe = ['and', [fe1, fe2, fe3, ...]]
# fe = ['or', [fe1, fe2, fe3, ...]]
# fe = ['not', fe ]
#
# For arrows between things, see http://stackoverflow.com/questions/554167/drawing-arrows-on-an-html-page-to-visualize-semantic-links-between-textual-spans
class QueryRepresentationView extends RepresentationView
# Returns an HTML table that displays a Dative/OLD-style query expression
# as a sideways tree.
# TODO: this could be made better with SVG arrows (or JSPlumb) but it's
# fine for now.
valueFormatter: (value) ->
# Return a string representation of a simple OLD-style filter expression,
# i.e., a 4/5-item array like ['Form', 'morpheme_break', '=', 'chien-s']
# or ['Form', 'enterer', 'last_name', '!=', 'Chomsky']
getFilterExpressionString = (query) ->
newArray = []
if query[0] isnt 'Form' then newArray.push query[0]
if query.length is 4
newArray.push utils.snake2regular(query[1])
newArray.push query[2]
newArray.push JSON.stringify(query[3])
else
newArray.push utils.snake2regular(query[1])
newArray.push utils.snake2regular(query[2])
newArray.push query[3]
newArray.push JSON.stringify(query[4])
newArray.join ' '
# Return the <table> that displays the Dative/OLD query as a sideways
# tree. Note: this function calls itself recursively.
getFilterTable = (query) ->
if query[0] in ['and', 'or']
"<table>
<tr>
<td class='middle-cell'>#{query[0]}</td>
<td><div class='scoped-cell'
>#{(getFilterTable(x) for x in query[1]).join('')}</div></td>
</tr>
</table>"
else if query[0] is 'not'
"<table>
<tr>
<td class='middle-cell'>#{query[0]}</td>
<td>#{getFilterTable(query[1])}</td>
</tr>
</table>"
else
"<table>
<tr>
<td class='middle-cell'
>#{getFilterExpressionString query}</td>
</tr>
</table>"
# TODO: we are only displaying the `filter` attribute; there is also an
# optional `order_by` attribute that should be being displayed too.
if utils.type(value) is 'array'
"no query"
else
getFilterTable value.filter
| 85916 | define [
'./representation'
'./../utils/utils'
], (RepresentationView, utils) ->
# Query Representation View
# -------------------------
#
# A view for the representation of a field whose value is a query over some
# collection of resources. A "query" here is modelled on an OLD SQL-style
# query, i.e., essentially an SQL WHERE-clause (with relational/join-related
# decisions made for you).
#
# fe = [object, attribute, relation, value]
# fe = [object, attribute, relation, value]
# fe = ['and', [fe1, fe2, fe3, ...]]
# fe = ['or', [fe1, fe2, fe3, ...]]
# fe = ['not', fe ]
#
# For arrows between things, see http://stackoverflow.com/questions/554167/drawing-arrows-on-an-html-page-to-visualize-semantic-links-between-textual-spans
class QueryRepresentationView extends RepresentationView
# Returns an HTML table that displays a Dative/OLD-style query expression
# as a sideways tree.
# TODO: this could be made better with SVG arrows (or JSPlumb) but it's
# fine for now.
valueFormatter: (value) ->
# Return a string representation of a simple OLD-style filter expression,
# i.e., a 4/5-item array like ['Form', 'morpheme_break', '=', 'chien-s']
# or ['Form', 'enterer', 'last_name', '!=', '<NAME>']
getFilterExpressionString = (query) ->
newArray = []
if query[0] isnt 'Form' then newArray.push query[0]
if query.length is 4
newArray.push utils.snake2regular(query[1])
newArray.push query[2]
newArray.push JSON.stringify(query[3])
else
newArray.push utils.snake2regular(query[1])
newArray.push utils.snake2regular(query[2])
newArray.push query[3]
newArray.push JSON.stringify(query[4])
newArray.join ' '
# Return the <table> that displays the Dative/OLD query as a sideways
# tree. Note: this function calls itself recursively.
getFilterTable = (query) ->
if query[0] in ['and', 'or']
"<table>
<tr>
<td class='middle-cell'>#{query[0]}</td>
<td><div class='scoped-cell'
>#{(getFilterTable(x) for x in query[1]).join('')}</div></td>
</tr>
</table>"
else if query[0] is 'not'
"<table>
<tr>
<td class='middle-cell'>#{query[0]}</td>
<td>#{getFilterTable(query[1])}</td>
</tr>
</table>"
else
"<table>
<tr>
<td class='middle-cell'
>#{getFilterExpressionString query}</td>
</tr>
</table>"
# TODO: we are only displaying the `filter` attribute; there is also an
# optional `order_by` attribute that should be being displayed too.
if utils.type(value) is 'array'
"no query"
else
getFilterTable value.filter
| true | define [
'./representation'
'./../utils/utils'
], (RepresentationView, utils) ->
# Query Representation View
# -------------------------
#
# A view for the representation of a field whose value is a query over some
# collection of resources. A "query" here is modelled on an OLD SQL-style
# query, i.e., essentially an SQL WHERE-clause (with relational/join-related
# decisions made for you).
#
# fe = [object, attribute, relation, value]
# fe = [object, attribute, relation, value]
# fe = ['and', [fe1, fe2, fe3, ...]]
# fe = ['or', [fe1, fe2, fe3, ...]]
# fe = ['not', fe ]
#
# For arrows between things, see http://stackoverflow.com/questions/554167/drawing-arrows-on-an-html-page-to-visualize-semantic-links-between-textual-spans
class QueryRepresentationView extends RepresentationView
# Returns an HTML table that displays a Dative/OLD-style query expression
# as a sideways tree.
# TODO: this could be made better with SVG arrows (or JSPlumb) but it's
# fine for now.
valueFormatter: (value) ->
# Return a string representation of a simple OLD-style filter expression,
# i.e., a 4/5-item array like ['Form', 'morpheme_break', '=', 'chien-s']
# or ['Form', 'enterer', 'last_name', '!=', 'PI:NAME:<NAME>END_PI']
getFilterExpressionString = (query) ->
newArray = []
if query[0] isnt 'Form' then newArray.push query[0]
if query.length is 4
newArray.push utils.snake2regular(query[1])
newArray.push query[2]
newArray.push JSON.stringify(query[3])
else
newArray.push utils.snake2regular(query[1])
newArray.push utils.snake2regular(query[2])
newArray.push query[3]
newArray.push JSON.stringify(query[4])
newArray.join ' '
# Return the <table> that displays the Dative/OLD query as a sideways
# tree. Note: this function calls itself recursively.
getFilterTable = (query) ->
if query[0] in ['and', 'or']
"<table>
<tr>
<td class='middle-cell'>#{query[0]}</td>
<td><div class='scoped-cell'
>#{(getFilterTable(x) for x in query[1]).join('')}</div></td>
</tr>
</table>"
else if query[0] is 'not'
"<table>
<tr>
<td class='middle-cell'>#{query[0]}</td>
<td>#{getFilterTable(query[1])}</td>
</tr>
</table>"
else
"<table>
<tr>
<td class='middle-cell'
>#{getFilterExpressionString query}</td>
</tr>
</table>"
# TODO: we are only displaying the `filter` attribute; there is also an
# optional `order_by` attribute that should be being displayed too.
if utils.type(value) is 'array'
"no query"
else
getFilterTable value.filter
|
[
{
"context": "ws/password-view'\n\n# based on: https://github.com/spark/spark-dev/blob/master/lib/views/login-view.coffee",
"end": 185,
"score": 0.8620395660400391,
"start": 180,
"tag": "USERNAME",
"value": "spark"
},
{
"context": "ame = @usernameModel.getText()\n @password = @passwordModel.getText()\n @secondFactor = @secondFacto",
"end": 2016,
"score": 0.6574187278747559,
"start": 2008,
"tag": "PASSWORD",
"value": "password"
},
{
"context": "rModel.getText()\n\n loginBody =\n email: @username\n password: @password\n location:\n ",
"end": 2126,
"score": 0.9982326030731201,
"start": 2117,
"tag": "USERNAME",
"value": "@username"
},
{
"context": "nBody =\n email: @username\n password: @password\n location:\n verificationToken: @s",
"end": 2154,
"score": 0.99745112657547,
"start": 2145,
"tag": "PASSWORD",
"value": "@password"
}
] | lib/medable-login-view.coffee | Medable/medable-dev-tools | 0 | {View} = require 'space-pen'
api = require './api'
MiniTextView = require './views/mini-text-view'
PasswordView = require './views/password-view'
# based on: https://github.com/spark/spark-dev/blob/master/lib/views/login-view.coffee
module.exports =
class MedableLoginView extends View
@content: ->
@div =>
@h1 'Log in to Medable'
@subview 'usernameEditor', new MiniTextView("Username")
@subview 'passwordEditor', new PasswordView("Password")
@subview 'secondFactorEditor', new PasswordView("Verification code"),
@div class: 'text-error block', outlet: 'errorLabel'
@div class: 'block', =>
@button id: 'loginButton', class: 'btn btn-primary', outlet: 'loginButton', 'Log in'
@button id: 'cancelButton', class: 'btn', outlet: 'cancelButton', 'Cancel'
initialize: ->
@modalPanel = atom.workspace.addModalPanel(item: this, visible: false)
@usernameModel = @usernameEditor.getModel()
@passwordModel = @passwordEditor.getModel()
@secondFactorModel = @secondFactorEditor.getModel()
destroy: ->
@detach()
show: (callback) ->
@enable()
@watchevents(callback)
@modalPanel.show()
@secondFactorEditor.hide()
@errorLabel.hide()
@usernameEditor.focus()
hide: ->
@usernameModel.setText ''
@passwordModel.setText ''
@secondFactorModel.setText ''
@modalPanel.hide()
cancel: (callback) ->
@hide()
callback('Login failed');
disable: ->
@usernameEditor.setEnabled false
@passwordEditor.setEnabled false
@secondFactorEditor.setEnabled false
@loginButton.attr 'disabled', 'disabled'
enable: ->
@usernameEditor.setEnabled true
@passwordEditor.setEnabled true
@secondFactorEditor.setEnabled true
@loginButton.removeAttr 'disabled'
login: (callback) ->
@disable()
@errorLabel.hide()
@username = @usernameModel.getText()
@password = @passwordModel.getText()
@secondFactor = @secondFactorModel.getText()
loginBody =
email: @username
password: @password
location:
verificationToken: @secondFactor
locationName: 'IDE'
singleUse: true
loginUrl = api.baseUrl()+'accounts/login'
api.post loginUrl, loginBody, (error, response, body) =>
if !error
if(body.code == 'kUnverifiedLocation' || body.code == 'kNewLocation')
@errorLabel.text('Verify location: Enter the verification code you received via SMS and log in again')
@errorLabel.show()
@secondFactorEditor.show()
@enable()
else
atom.notifications.addSuccess('Login successful')
callback()
@hide()
else
@errorLabel.text('Login error: ' + error.message)
@errorLabel.show()
@enable()
watchevents: (callback) ->
@usernameEditor.on 'keydown', (event) =>
if (event.keyCode == 9)
@passwordEditor.focus()
event.preventDefault()
@passwordEditor.on 'keydown', (event) =>
if (event.keyCode == 13)
@login(callback)
if (event.keyCode == 9)
@secondFactorEditor.focus()
event.preventDefault()
@secondFactorEditor.on 'keydown', (event) =>
if (event.keyCode == 13)
@login(callback)
@loginButton.on 'keydown', (event) =>
if (event.keyCode == 13)
@login(callback)
@loginButton.on 'click', (event) =>
@login(callback)
@cancelButton.on 'click', (event) =>
@cancel(callback)
| 136604 | {View} = require 'space-pen'
api = require './api'
MiniTextView = require './views/mini-text-view'
PasswordView = require './views/password-view'
# based on: https://github.com/spark/spark-dev/blob/master/lib/views/login-view.coffee
module.exports =
class MedableLoginView extends View
@content: ->
@div =>
@h1 'Log in to Medable'
@subview 'usernameEditor', new MiniTextView("Username")
@subview 'passwordEditor', new PasswordView("Password")
@subview 'secondFactorEditor', new PasswordView("Verification code"),
@div class: 'text-error block', outlet: 'errorLabel'
@div class: 'block', =>
@button id: 'loginButton', class: 'btn btn-primary', outlet: 'loginButton', 'Log in'
@button id: 'cancelButton', class: 'btn', outlet: 'cancelButton', 'Cancel'
initialize: ->
@modalPanel = atom.workspace.addModalPanel(item: this, visible: false)
@usernameModel = @usernameEditor.getModel()
@passwordModel = @passwordEditor.getModel()
@secondFactorModel = @secondFactorEditor.getModel()
destroy: ->
@detach()
show: (callback) ->
@enable()
@watchevents(callback)
@modalPanel.show()
@secondFactorEditor.hide()
@errorLabel.hide()
@usernameEditor.focus()
hide: ->
@usernameModel.setText ''
@passwordModel.setText ''
@secondFactorModel.setText ''
@modalPanel.hide()
cancel: (callback) ->
@hide()
callback('Login failed');
disable: ->
@usernameEditor.setEnabled false
@passwordEditor.setEnabled false
@secondFactorEditor.setEnabled false
@loginButton.attr 'disabled', 'disabled'
enable: ->
@usernameEditor.setEnabled true
@passwordEditor.setEnabled true
@secondFactorEditor.setEnabled true
@loginButton.removeAttr 'disabled'
login: (callback) ->
@disable()
@errorLabel.hide()
@username = @usernameModel.getText()
@password = @<PASSWORD>Model.getText()
@secondFactor = @secondFactorModel.getText()
loginBody =
email: @username
password: <PASSWORD>
location:
verificationToken: @secondFactor
locationName: 'IDE'
singleUse: true
loginUrl = api.baseUrl()+'accounts/login'
api.post loginUrl, loginBody, (error, response, body) =>
if !error
if(body.code == 'kUnverifiedLocation' || body.code == 'kNewLocation')
@errorLabel.text('Verify location: Enter the verification code you received via SMS and log in again')
@errorLabel.show()
@secondFactorEditor.show()
@enable()
else
atom.notifications.addSuccess('Login successful')
callback()
@hide()
else
@errorLabel.text('Login error: ' + error.message)
@errorLabel.show()
@enable()
watchevents: (callback) ->
@usernameEditor.on 'keydown', (event) =>
if (event.keyCode == 9)
@passwordEditor.focus()
event.preventDefault()
@passwordEditor.on 'keydown', (event) =>
if (event.keyCode == 13)
@login(callback)
if (event.keyCode == 9)
@secondFactorEditor.focus()
event.preventDefault()
@secondFactorEditor.on 'keydown', (event) =>
if (event.keyCode == 13)
@login(callback)
@loginButton.on 'keydown', (event) =>
if (event.keyCode == 13)
@login(callback)
@loginButton.on 'click', (event) =>
@login(callback)
@cancelButton.on 'click', (event) =>
@cancel(callback)
| true | {View} = require 'space-pen'
api = require './api'
MiniTextView = require './views/mini-text-view'
PasswordView = require './views/password-view'
# based on: https://github.com/spark/spark-dev/blob/master/lib/views/login-view.coffee
module.exports =
class MedableLoginView extends View
@content: ->
@div =>
@h1 'Log in to Medable'
@subview 'usernameEditor', new MiniTextView("Username")
@subview 'passwordEditor', new PasswordView("Password")
@subview 'secondFactorEditor', new PasswordView("Verification code"),
@div class: 'text-error block', outlet: 'errorLabel'
@div class: 'block', =>
@button id: 'loginButton', class: 'btn btn-primary', outlet: 'loginButton', 'Log in'
@button id: 'cancelButton', class: 'btn', outlet: 'cancelButton', 'Cancel'
initialize: ->
@modalPanel = atom.workspace.addModalPanel(item: this, visible: false)
@usernameModel = @usernameEditor.getModel()
@passwordModel = @passwordEditor.getModel()
@secondFactorModel = @secondFactorEditor.getModel()
destroy: ->
@detach()
show: (callback) ->
@enable()
@watchevents(callback)
@modalPanel.show()
@secondFactorEditor.hide()
@errorLabel.hide()
@usernameEditor.focus()
hide: ->
@usernameModel.setText ''
@passwordModel.setText ''
@secondFactorModel.setText ''
@modalPanel.hide()
cancel: (callback) ->
@hide()
callback('Login failed');
disable: ->
@usernameEditor.setEnabled false
@passwordEditor.setEnabled false
@secondFactorEditor.setEnabled false
@loginButton.attr 'disabled', 'disabled'
enable: ->
@usernameEditor.setEnabled true
@passwordEditor.setEnabled true
@secondFactorEditor.setEnabled true
@loginButton.removeAttr 'disabled'
login: (callback) ->
@disable()
@errorLabel.hide()
@username = @usernameModel.getText()
@password = @PI:PASSWORD:<PASSWORD>END_PIModel.getText()
@secondFactor = @secondFactorModel.getText()
loginBody =
email: @username
password: PI:PASSWORD:<PASSWORD>END_PI
location:
verificationToken: @secondFactor
locationName: 'IDE'
singleUse: true
loginUrl = api.baseUrl()+'accounts/login'
api.post loginUrl, loginBody, (error, response, body) =>
if !error
if(body.code == 'kUnverifiedLocation' || body.code == 'kNewLocation')
@errorLabel.text('Verify location: Enter the verification code you received via SMS and log in again')
@errorLabel.show()
@secondFactorEditor.show()
@enable()
else
atom.notifications.addSuccess('Login successful')
callback()
@hide()
else
@errorLabel.text('Login error: ' + error.message)
@errorLabel.show()
@enable()
watchevents: (callback) ->
@usernameEditor.on 'keydown', (event) =>
if (event.keyCode == 9)
@passwordEditor.focus()
event.preventDefault()
@passwordEditor.on 'keydown', (event) =>
if (event.keyCode == 13)
@login(callback)
if (event.keyCode == 9)
@secondFactorEditor.focus()
event.preventDefault()
@secondFactorEditor.on 'keydown', (event) =>
if (event.keyCode == 13)
@login(callback)
@loginButton.on 'keydown', (event) =>
if (event.keyCode == 13)
@login(callback)
@loginButton.on 'click', (event) =>
@login(callback)
@cancelButton.on 'click', (event) =>
@cancel(callback)
|
[
{
"context": "s\",\"Prov\",\"Eccl\",\"Song\",\"Isa\",\"Jer\",\"Lam\",\"Ezek\",\"Dan\",\"Hos\",\"Joel\",\"Amos\",\"Obad\",\"Jonah\",\"Mic\",\"Nah\",\"",
"end": 505,
"score": 0.7928235530853271,
"start": 502,
"tag": "NAME",
"value": "Dan"
},
{
"context": "ov\",\"Eccl\",\"Song\",\"Isa\",\"Jer\",\"Lam\",\"Ezek\",\"Dan\",\"Hos\",\"Joel\",\"Amos\",\"Obad\",\"Jonah\",\"Mic\",\"Nah\",\"Hab\",\"",
"end": 511,
"score": 0.6819876432418823,
"start": 508,
"tag": "NAME",
"value": "Hos"
},
{
"context": "ccl\",\"Song\",\"Isa\",\"Jer\",\"Lam\",\"Ezek\",\"Dan\",\"Hos\",\"Joel\",\"Amos\",\"Obad\",\"Jonah\",\"Mic\",\"Nah\",\"Hab\",\"Zeph\",\"",
"end": 518,
"score": 0.8633602857589722,
"start": 514,
"tag": "NAME",
"value": "Joel"
},
{
"context": "ong\",\"Isa\",\"Jer\",\"Lam\",\"Ezek\",\"Dan\",\"Hos\",\"Joel\",\"Amos\",\"Obad\",\"Jonah\",\"Mic\",\"Nah\",\"Hab\",\"Zeph\",\"Hag\"",
"end": 522,
"score": 0.5838987231254578,
"start": 521,
"tag": "NAME",
"value": "A"
},
{
"context": "sa\",\"Jer\",\"Lam\",\"Ezek\",\"Dan\",\"Hos\",\"Joel\",\"Amos\",\"Obad\",\"Jonah\",\"Mic\",\"Nah\",\"Hab\",\"Zeph\",\"Hag\",\"Zech\",",
"end": 530,
"score": 0.5911049246788025,
"start": 528,
"tag": "NAME",
"value": "Ob"
},
{
"context": "r\",\"Lam\",\"Ezek\",\"Dan\",\"Hos\",\"Joel\",\"Amos\",\"Obad\",\"Jonah\",\"Mic\",\"Nah\",\"Hab\",\"Zeph\",\"Hag\",\"Zech\",\"Mal\",\"Mat",
"end": 540,
"score": 0.8670451641082764,
"start": 535,
"tag": "NAME",
"value": "Jonah"
},
{
"context": ",\"Ezek\",\"Dan\",\"Hos\",\"Joel\",\"Amos\",\"Obad\",\"Jonah\",\"Mic\",\"Nah\",\"Hab\",\"Zeph\",\"Hag\",\"Zech\",\"Mal\",\"Matt\",\"Ma",
"end": 546,
"score": 0.8236079216003418,
"start": 543,
"tag": "NAME",
"value": "Mic"
},
{
"context": "\",\"Dan\",\"Hos\",\"Joel\",\"Amos\",\"Obad\",\"Jonah\",\"Mic\",\"Nah\",\"Hab\",\"Zeph\",\"Hag\",\"Zech\",\"Mal\",\"Matt\",\"Mark\",",
"end": 550,
"score": 0.640497088432312,
"start": 549,
"tag": "NAME",
"value": "N"
},
{
"context": "d\",\"Jonah\",\"Mic\",\"Nah\",\"Hab\",\"Zeph\",\"Hag\",\"Zech\",\"Mal\",\"Matt\",\"Mark\",\"Luke\",\"John\",\"Acts\",\"Rom\",\"1Cor\",",
"end": 584,
"score": 0.6359525322914124,
"start": 581,
"tag": "NAME",
"value": "Mal"
},
{
"context": "nah\",\"Mic\",\"Nah\",\"Hab\",\"Zeph\",\"Hag\",\"Zech\",\"Mal\",\"Matt\",\"Mark\",\"Luke\",\"John\",\"Acts\",\"Rom\",\"1Cor\",\"2Cor\",",
"end": 591,
"score": 0.9355530738830566,
"start": 587,
"tag": "NAME",
"value": "Matt"
},
{
"context": "ic\",\"Nah\",\"Hab\",\"Zeph\",\"Hag\",\"Zech\",\"Mal\",\"Matt\",\"Mark\",\"Luke\",\"John\",\"Acts\",\"Rom\",\"1Cor\",\"2Cor\",\"Gal\",\"",
"end": 598,
"score": 0.9536033868789673,
"start": 594,
"tag": "NAME",
"value": "Mark"
},
{
"context": "h\",\"Hab\",\"Zeph\",\"Hag\",\"Zech\",\"Mal\",\"Matt\",\"Mark\",\"Luke\",\"John\",\"Acts\",\"Rom\",\"1Cor\",\"2Cor\",\"Gal\",\"Eph\",\"P",
"end": 605,
"score": 0.8787655830383301,
"start": 601,
"tag": "NAME",
"value": "Luke"
},
{
"context": "\",\"Zeph\",\"Hag\",\"Zech\",\"Mal\",\"Matt\",\"Mark\",\"Luke\",\"John\",\"Acts\",\"Rom\",\"1Cor\",\"2Cor\",\"Gal\",\"Eph\",\"Phil\",\"C",
"end": 612,
"score": 0.7255006432533264,
"start": 608,
"tag": "NAME",
"value": "John"
},
{
"context": "al(\"Deut.1.1\")\n\t\t`\n\t\ttrue\ndescribe \"Localized book Josh (or)\", ->\n\tp = {}\n\tbeforeEach ->\n\t\tp = new bcv",
"end": 8949,
"score": 0.7479026317596436,
"start": 8948,
"tag": "NAME",
"value": "J"
},
{
"context": "\tp.include_apocrypha true\n\tit \"should handle book: Josh (or)\", ->\n\t\t`\n\t\texpect(p.parse(\"ଯିହୋଶୂୟଙ୍କର ପୁ",
"end": 9208,
"score": 0.7357359528541565,
"start": 9207,
"tag": "NAME",
"value": "J"
},
{
"context": "ual(\"Hos.1.1\")\n\t\t`\n\t\ttrue\ndescribe \"Localized book Joel (or)\", ->\n\tp = {}\n\tbeforeEach ->\n\t\tp = new bcv_",
"end": 30409,
"score": 0.9229243993759155,
"start": 30407,
"tag": "NAME",
"value": "Jo"
},
{
"context": "\tp.include_apocrypha true\n\tit \"should handle book: Joel (or)\", ->\n\t\t`\n\t\texpect(p.parse(\"ଯୋୟେଲ ଭବିଷ୍ୟଦ୍ବ",
"end": 30670,
"score": 0.7051390409469604,
"start": 30666,
"tag": "NAME",
"value": "Joel"
},
{
"context": "al(\"Obad.1.1\")\n\t\t`\n\t\ttrue\ndescribe \"Localized book Jonah (or)\", ->\n\tp = {}\n\tbeforeEach ->\n\t\tp = new bcv_",
"end": 32629,
"score": 0.8922529816627502,
"start": 32626,
"tag": "NAME",
"value": "Jon"
},
{
"context": "\tp.include_apocrypha true\n\tit \"should handle book: Jonah (or)\", ->\n\t\t`\n\t\texpect(p.parse(\"ଯୂନସ ଭବିଷ୍ୟଦ୍",
"end": 32889,
"score": 0.8465571999549866,
"start": 32886,
"tag": "NAME",
"value": "Jon"
},
{
"context": "l(\"Jonah.1.1\")\n\t\t`\n\t\ttrue\ndescribe \"Localized book Mic (or)\", ->\n\tp = {}\n\tbeforeEach ->\n\t\tp = new bcv_",
"end": 33374,
"score": 0.7596287727355957,
"start": 33373,
"tag": "NAME",
"value": "M"
},
{
"context": "\tp.include_apocrypha true\n\tit \"should handle book: Matt (or)\", ->\n\t\t`\n\t\texpect(p.parse(\"ମାଥିଉ ଲିଖିତ ସୁସମା",
"end": 39133,
"score": 0.9383586645126343,
"start": 39129,
"tag": "NAME",
"value": "Matt"
},
{
"context": "(\"1John.1.1\")\n\t\t`\n\t\ttrue\ndescribe \"Localized book 2John (or)\", ->\n\tp = {}\n\tbeforeEach ->\n\t\tp = new bc",
"end": 42009,
"score": 0.8059173822402954,
"start": 42008,
"tag": "NAME",
"value": "2"
},
{
"context": "p.include_apocrypha true\n\tit \"should handle book: 2John (or)\", ->\n\t\t`\n\t\texpect(p.parse(\"ଯୋହନଙ୍କ ଦ୍ୱିତୀୟ ପ",
"end": 42273,
"score": 0.7081652879714966,
"start": 42268,
"tag": "NAME",
"value": "2John"
},
{
"context": "l(\"3John.1.1\")\n\t\t`\n\t\ttrue\ndescribe \"Localized book John (or)\", ->\n\tp = {}\n\tbeforeEach ->\n\t\tp = new bcv_pa",
"end": 43986,
"score": 0.9827219843864441,
"start": 43982,
"tag": "NAME",
"value": "John"
},
{
"context": "\tp.include_apocrypha true\n\tit \"should handle book: John (or)\", ->\n\t\t`\n\t\texpect(p.parse(\"ଯୋହନ ଲିଖିତ ସୁସମାଗ",
"end": 44245,
"score": 0.9802135825157166,
"start": 44241,
"tag": "NAME",
"value": "John"
},
{
"context": "1\").osis()).toEqual(\"John.1.1\")\n\t\texpect(p.parse(\"John 1:1\").osis()).toEqual(\"John.1.1\")\n\t\texpect(p.pars",
"end": 44355,
"score": 0.9680079817771912,
"start": 44351,
"tag": "NAME",
"value": "John"
},
{
"context": "1\").osis()).toEqual(\"John.1.1\")\n\t\texpect(p.parse(\"JOHN 1:1\").osis()).toEqual(\"John.1.1\")\n\t\texpect(p.pars",
"end": 44571,
"score": 0.9981549978256226,
"start": 44567,
"tag": "NAME",
"value": "JOHN"
},
{
"context": "al(\"1Pet.1.1\")\n\t\t`\n\t\ttrue\ndescribe \"Localized book Jude (or)\", ->\n\tp = {}\n\tbeforeEach ->\n\t\tp = new bcv",
"end": 60676,
"score": 0.8426183462142944,
"start": 60675,
"tag": "NAME",
"value": "J"
},
{
"context": "\tp.include_apocrypha true\n\tit \"should handle book: Jude (or)\", ->\n\t\t`\n\t\texpect(p.parse(\"ଯିହୂଦାଙ୍କ ପତ୍ର",
"end": 60935,
"score": 0.8857578635215759,
"start": 60934,
"tag": "NAME",
"value": "J"
}
] | lib/bible-tools/lib/Bible-Passage-Reference-Parser/src/or/spec.coffee | saiba-mais/bible-lessons | 149 | bcv_parser = require("../../js/or_bcv_parser.js").bcv_parser
describe "Parsing", ->
p = {}
beforeEach ->
p = new bcv_parser
p.options.osis_compaction_strategy = "b"
p.options.sequence_combination_strategy = "combine"
it "should round-trip OSIS references", ->
p.set_options osis_compaction_strategy: "bc"
books = ["Gen","Exod","Lev","Num","Deut","Josh","Judg","Ruth","1Sam","2Sam","1Kgs","2Kgs","1Chr","2Chr","Ezra","Neh","Esth","Job","Ps","Prov","Eccl","Song","Isa","Jer","Lam","Ezek","Dan","Hos","Joel","Amos","Obad","Jonah","Mic","Nah","Hab","Zeph","Hag","Zech","Mal","Matt","Mark","Luke","John","Acts","Rom","1Cor","2Cor","Gal","Eph","Phil","Col","1Thess","2Thess","1Tim","2Tim","Titus","Phlm","Heb","Jas","1Pet","2Pet","1John","2John","3John","Jude","Rev"]
for book in books
bc = book + ".1"
bcv = bc + ".1"
bcv_range = bcv + "-" + bc + ".2"
expect(p.parse(bc).osis()).toEqual bc
expect(p.parse(bcv).osis()).toEqual bcv
expect(p.parse(bcv_range).osis()).toEqual bcv_range
it "should round-trip OSIS Apocrypha references", ->
p.set_options osis_compaction_strategy: "bc", ps151_strategy: "b"
p.include_apocrypha true
books = ["Tob","Jdt","GkEsth","Wis","Sir","Bar","PrAzar","Sus","Bel","SgThree","EpJer","1Macc","2Macc","3Macc","4Macc","1Esd","2Esd","PrMan","Ps151"]
for book in books
bc = book + ".1"
bcv = bc + ".1"
bcv_range = bcv + "-" + bc + ".2"
expect(p.parse(bc).osis()).toEqual bc
expect(p.parse(bcv).osis()).toEqual bcv
expect(p.parse(bcv_range).osis()).toEqual bcv_range
p.set_options ps151_strategy: "bc"
expect(p.parse("Ps151.1").osis()).toEqual "Ps.151"
expect(p.parse("Ps151.1.1").osis()).toEqual "Ps.151.1"
expect(p.parse("Ps151.1-Ps151.2").osis()).toEqual "Ps.151.1-Ps.151.2"
p.include_apocrypha false
for book in books
bc = book + ".1"
expect(p.parse(bc).osis()).toEqual ""
it "should handle a preceding character", ->
expect(p.parse(" Gen 1").osis()).toEqual "Gen.1"
expect(p.parse("Matt5John3").osis()).toEqual "Matt.5,John.3"
expect(p.parse("1Ps 1").osis()).toEqual ""
expect(p.parse("11Sam 1").osis()).toEqual ""
describe "Localized book Gen (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Gen (or)", ->
`
expect(p.parse("ଆଦିପୁସ୍ତକ 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("Gen 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("ଆଦି 1:1").osis()).toEqual("Gen.1.1")
p.include_apocrypha(false)
expect(p.parse("ଆଦିପୁସ୍ତକ 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("GEN 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("ଆଦି 1:1").osis()).toEqual("Gen.1.1")
`
true
describe "Localized book Exod (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Exod (or)", ->
`
expect(p.parse("ଯାତ୍ରା ପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରାପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରା 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("Exod 1:1").osis()).toEqual("Exod.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯାତ୍ରା ପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରାପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରା 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("EXOD 1:1").osis()).toEqual("Exod.1.1")
`
true
describe "Localized book Bel (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Bel (or)", ->
`
expect(p.parse("Bel 1:1").osis()).toEqual("Bel.1.1")
`
true
describe "Localized book Lev (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Lev (or)", ->
`
expect(p.parse("ଲେବୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("ଲେବୀୟ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("Lev 1:1").osis()).toEqual("Lev.1.1")
p.include_apocrypha(false)
expect(p.parse("ଲେବୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("ଲେବୀୟ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("LEV 1:1").osis()).toEqual("Lev.1.1")
`
true
describe "Localized book Num (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Num (or)", ->
`
expect(p.parse("ଗଣନା ପୁସ୍ତକ 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("ଗଣନା 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("Num 1:1").osis()).toEqual("Num.1.1")
p.include_apocrypha(false)
expect(p.parse("ଗଣନା ପୁସ୍ତକ 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("ଗଣନା 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("NUM 1:1").osis()).toEqual("Num.1.1")
`
true
describe "Localized book Sir (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Sir (or)", ->
`
expect(p.parse("Sir 1:1").osis()).toEqual("Sir.1.1")
`
true
describe "Localized book Wis (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Wis (or)", ->
`
expect(p.parse("Wis 1:1").osis()).toEqual("Wis.1.1")
`
true
describe "Localized book Lam (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Lam (or)", ->
`
expect(p.parse("ଯିରିମିୟଙ୍କ ବିଳାପ 1:1").osis()).toEqual("Lam.1.1")
expect(p.parse("Lam 1:1").osis()).toEqual("Lam.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିରିମିୟଙ୍କ ବିଳାପ 1:1").osis()).toEqual("Lam.1.1")
expect(p.parse("LAM 1:1").osis()).toEqual("Lam.1.1")
`
true
describe "Localized book EpJer (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: EpJer (or)", ->
`
expect(p.parse("EpJer 1:1").osis()).toEqual("EpJer.1.1")
`
true
describe "Localized book Rev (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Rev (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରତି ପ୍ରକାଶିତ ବାକ୍ୟ 1:1").osis()).toEqual("Rev.1.1")
expect(p.parse("Rev 1:1").osis()).toEqual("Rev.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରତି ପ୍ରକାଶିତ ବାକ୍ୟ 1:1").osis()).toEqual("Rev.1.1")
expect(p.parse("REV 1:1").osis()).toEqual("Rev.1.1")
`
true
describe "Localized book PrMan (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PrMan (or)", ->
`
expect(p.parse("PrMan 1:1").osis()).toEqual("PrMan.1.1")
`
true
describe "Localized book Deut (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Deut (or)", ->
`
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣୀ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ବିବରଣି 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("Deut 1:1").osis()).toEqual("Deut.1.1")
p.include_apocrypha(false)
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣୀ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ବିବରଣି 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("DEUT 1:1").osis()).toEqual("Deut.1.1")
`
true
describe "Localized book Josh (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Josh (or)", ->
`
expect(p.parse("ଯିହୋଶୂୟଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("ଯିହୋଶୂୟଙ୍କର 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("Josh 1:1").osis()).toEqual("Josh.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିହୋଶୂୟଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("ଯିହୋଶୂୟଙ୍କର 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("JOSH 1:1").osis()).toEqual("Josh.1.1")
`
true
describe "Localized book Judg (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Judg (or)", ->
`
expect(p.parse("ବିଗ୍ଭରକର୍ତ୍ତାମାନଙ୍କ ବିବରଣ 1:1").osis()).toEqual("Judg.1.1")
expect(p.parse("Judg 1:1").osis()).toEqual("Judg.1.1")
p.include_apocrypha(false)
expect(p.parse("ବିଗ୍ଭରକର୍ତ୍ତାମାନଙ୍କ ବିବରଣ 1:1").osis()).toEqual("Judg.1.1")
expect(p.parse("JUDG 1:1").osis()).toEqual("Judg.1.1")
`
true
describe "Localized book Ruth (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ruth (or)", ->
`
expect(p.parse("ଋତର ବିବରଣ ପୁସ୍ତକ 1:1").osis()).toEqual("Ruth.1.1")
expect(p.parse("Ruth 1:1").osis()).toEqual("Ruth.1.1")
p.include_apocrypha(false)
expect(p.parse("ଋତର ବିବରଣ ପୁସ୍ତକ 1:1").osis()).toEqual("Ruth.1.1")
expect(p.parse("RUTH 1:1").osis()).toEqual("Ruth.1.1")
`
true
describe "Localized book 1Esd (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Esd (or)", ->
`
expect(p.parse("1Esd 1:1").osis()).toEqual("1Esd.1.1")
`
true
describe "Localized book 2Esd (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Esd (or)", ->
`
expect(p.parse("2Esd 1:1").osis()).toEqual("2Esd.1.1")
`
true
describe "Localized book Isa (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Isa (or)", ->
`
expect(p.parse("ଯିଶାଇୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯାଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯିଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯୀଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟିଶାୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("Isa 1:1").osis()).toEqual("Isa.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିଶାଇୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯାଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯିଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯୀଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟିଶାୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ISA 1:1").osis()).toEqual("Isa.1.1")
`
true
describe "Localized book 2Sam (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Sam (or)", ->
`
expect(p.parse("ଶାମୁୟେଲଙ୍କ ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2Sam 1:1").osis()).toEqual("2Sam.1.1")
p.include_apocrypha(false)
expect(p.parse("ଶାମୁୟେଲଙ୍କ ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2SAM 1:1").osis()).toEqual("2Sam.1.1")
`
true
describe "Localized book 1Sam (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Sam (or)", ->
`
expect(p.parse("ଶାମୁୟେଲଙ୍କ ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1Sam 1:1").osis()).toEqual("1Sam.1.1")
p.include_apocrypha(false)
expect(p.parse("ଶାମୁୟେଲଙ୍କ ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1SAM 1:1").osis()).toEqual("1Sam.1.1")
`
true
describe "Localized book 2Kgs (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Kgs (or)", ->
`
expect(p.parse("ରାଜାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2Kgs 1:1").osis()).toEqual("2Kgs.1.1")
p.include_apocrypha(false)
expect(p.parse("ରାଜାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2KGS 1:1").osis()).toEqual("2Kgs.1.1")
`
true
describe "Localized book 1Kgs (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Kgs (or)", ->
`
expect(p.parse("ରାଜାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1Kgs 1:1").osis()).toEqual("1Kgs.1.1")
p.include_apocrypha(false)
expect(p.parse("ରାଜାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1KGS 1:1").osis()).toEqual("1Kgs.1.1")
`
true
describe "Localized book 2Chr (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Chr (or)", ->
`
expect(p.parse("ବଂଶାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2Chr 1:1").osis()).toEqual("2Chr.1.1")
p.include_apocrypha(false)
expect(p.parse("ବଂଶାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2CHR 1:1").osis()).toEqual("2Chr.1.1")
`
true
describe "Localized book 1Chr (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Chr (or)", ->
`
expect(p.parse("ବଂଶାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1Chr 1:1").osis()).toEqual("1Chr.1.1")
p.include_apocrypha(false)
expect(p.parse("ବଂଶାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1CHR 1:1").osis()).toEqual("1Chr.1.1")
`
true
describe "Localized book Ezra (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ezra (or)", ->
`
expect(p.parse("ଏଜ୍ରା 1:1").osis()).toEqual("Ezra.1.1")
expect(p.parse("Ezra 1:1").osis()).toEqual("Ezra.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏଜ୍ରା 1:1").osis()).toEqual("Ezra.1.1")
expect(p.parse("EZRA 1:1").osis()).toEqual("Ezra.1.1")
`
true
describe "Localized book Neh (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Neh (or)", ->
`
expect(p.parse("ନିହିମିୟାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("ନିହିମିୟାଙ୍କର 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("Neh 1:1").osis()).toEqual("Neh.1.1")
p.include_apocrypha(false)
expect(p.parse("ନିହିମିୟାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("ନିହିମିୟାଙ୍କର 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("NEH 1:1").osis()).toEqual("Neh.1.1")
`
true
describe "Localized book GkEsth (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: GkEsth (or)", ->
`
expect(p.parse("GkEsth 1:1").osis()).toEqual("GkEsth.1.1")
`
true
describe "Localized book Esth (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Esth (or)", ->
`
expect(p.parse("ଏଷ୍ଟର ବିବରଣ 1:1").osis()).toEqual("Esth.1.1")
expect(p.parse("Esth 1:1").osis()).toEqual("Esth.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏଷ୍ଟର ବିବରଣ 1:1").osis()).toEqual("Esth.1.1")
expect(p.parse("ESTH 1:1").osis()).toEqual("Esth.1.1")
`
true
describe "Localized book Job (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Job (or)", ->
`
expect(p.parse("ଆୟୁବ ପୁସ୍ତକ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("ଆୟୁବ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("Job 1:1").osis()).toEqual("Job.1.1")
p.include_apocrypha(false)
expect(p.parse("ଆୟୁବ ପୁସ୍ତକ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("ଆୟୁବ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("JOB 1:1").osis()).toEqual("Job.1.1")
`
true
describe "Localized book Ps (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ps (or)", ->
`
expect(p.parse("ଗୀତିସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗାତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗୀତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("Ps 1:1").osis()).toEqual("Ps.1.1")
p.include_apocrypha(false)
expect(p.parse("ଗୀତିସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗାତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗୀତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("PS 1:1").osis()).toEqual("Ps.1.1")
`
true
describe "Localized book PrAzar (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PrAzar (or)", ->
`
expect(p.parse("PrAzar 1:1").osis()).toEqual("PrAzar.1.1")
`
true
describe "Localized book Prov (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Prov (or)", ->
`
expect(p.parse("ହିତୋପଦେଶ 1:1").osis()).toEqual("Prov.1.1")
expect(p.parse("Prov 1:1").osis()).toEqual("Prov.1.1")
p.include_apocrypha(false)
expect(p.parse("ହିତୋପଦେଶ 1:1").osis()).toEqual("Prov.1.1")
expect(p.parse("PROV 1:1").osis()).toEqual("Prov.1.1")
`
true
describe "Localized book Eccl (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Eccl (or)", ->
`
expect(p.parse("ଉପଦେଶକ 1:1").osis()).toEqual("Eccl.1.1")
expect(p.parse("Eccl 1:1").osis()).toEqual("Eccl.1.1")
p.include_apocrypha(false)
expect(p.parse("ଉପଦେଶକ 1:1").osis()).toEqual("Eccl.1.1")
expect(p.parse("ECCL 1:1").osis()).toEqual("Eccl.1.1")
`
true
describe "Localized book SgThree (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: SgThree (or)", ->
`
expect(p.parse("SgThree 1:1").osis()).toEqual("SgThree.1.1")
`
true
describe "Localized book Song (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Song (or)", ->
`
expect(p.parse("ପରମଗୀତ 1:1").osis()).toEqual("Song.1.1")
expect(p.parse("Song 1:1").osis()).toEqual("Song.1.1")
p.include_apocrypha(false)
expect(p.parse("ପରମଗୀତ 1:1").osis()).toEqual("Song.1.1")
expect(p.parse("SONG 1:1").osis()).toEqual("Song.1.1")
`
true
describe "Localized book Jer (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Jer (or)", ->
`
expect(p.parse("ଯିରିମିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("ଯିରିମିୟ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("Jer 1:1").osis()).toEqual("Jer.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିରିମିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("ଯିରିମିୟ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("JER 1:1").osis()).toEqual("Jer.1.1")
`
true
describe "Localized book Ezek (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ezek (or)", ->
`
expect(p.parse("ଯିହିଜିକଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("ଯିହିଜିକଲ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("Ezek 1:1").osis()).toEqual("Ezek.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିହିଜିକଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("ଯିହିଜିକଲ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("EZEK 1:1").osis()).toEqual("Ezek.1.1")
`
true
describe "Localized book Dan (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Dan (or)", ->
`
expect(p.parse("ଦାନିୟେଲଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("ଦାନିୟେଲଙ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("Dan 1:1").osis()).toEqual("Dan.1.1")
p.include_apocrypha(false)
expect(p.parse("ଦାନିୟେଲଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("ଦାନିୟେଲଙ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("DAN 1:1").osis()).toEqual("Dan.1.1")
`
true
describe "Localized book Hos (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Hos (or)", ->
`
expect(p.parse("ହୋଶେୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶହେ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶେୟ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("Hos 1:1").osis()).toEqual("Hos.1.1")
p.include_apocrypha(false)
expect(p.parse("ହୋଶେୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶହେ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶେୟ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("HOS 1:1").osis()).toEqual("Hos.1.1")
`
true
describe "Localized book Joel (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Joel (or)", ->
`
expect(p.parse("ଯୋୟେଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("ଯୋୟେଲ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("Joel 1:1").osis()).toEqual("Joel.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋୟେଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("ଯୋୟେଲ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("JOEL 1:1").osis()).toEqual("Joel.1.1")
`
true
describe "Localized book Amos (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Amos (or)", ->
`
expect(p.parse("ଆମୋଷ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("Amos 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("ଆମୋଷ 1:1").osis()).toEqual("Amos.1.1")
p.include_apocrypha(false)
expect(p.parse("ଆମୋଷ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("AMOS 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("ଆମୋଷ 1:1").osis()).toEqual("Amos.1.1")
`
true
describe "Localized book Obad (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Obad (or)", ->
`
expect(p.parse("ଓବଦିଅ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("ଓବଦିଅ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("Obad 1:1").osis()).toEqual("Obad.1.1")
p.include_apocrypha(false)
expect(p.parse("ଓବଦିଅ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("ଓବଦିଅ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("OBAD 1:1").osis()).toEqual("Obad.1.1")
`
true
describe "Localized book Jonah (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Jonah (or)", ->
`
expect(p.parse("ଯୂନସ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("Jonah 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("ଯୂନସ 1:1").osis()).toEqual("Jonah.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୂନସ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("JONAH 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("ଯୂନସ 1:1").osis()).toEqual("Jonah.1.1")
`
true
describe "Localized book Mic (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Mic (or)", ->
`
expect(p.parse("ମୀଖା ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମିଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମୀଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("Mic 1:1").osis()).toEqual("Mic.1.1")
p.include_apocrypha(false)
expect(p.parse("ମୀଖା ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମିଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମୀଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("MIC 1:1").osis()).toEqual("Mic.1.1")
`
true
describe "Localized book Nah (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Nah (or)", ->
`
expect(p.parse("ନାହୂମ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("ନାହୂମ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("Nah 1:1").osis()).toEqual("Nah.1.1")
p.include_apocrypha(false)
expect(p.parse("ନାହୂମ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("ନାହୂମ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("NAH 1:1").osis()).toEqual("Nah.1.1")
`
true
describe "Localized book Hab (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Hab (or)", ->
`
expect(p.parse("ହବକ୍କୂକ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକ୍କୂକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୁକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୂକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("Hab 1:1").osis()).toEqual("Hab.1.1")
p.include_apocrypha(false)
expect(p.parse("ହବକ୍କୂକ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକ୍କୂକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୁକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୂକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("HAB 1:1").osis()).toEqual("Hab.1.1")
`
true
describe "Localized book Zeph (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Zeph (or)", ->
`
expect(p.parse("ସିଫନିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("ସିଫନିୟ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("Zeph 1:1").osis()).toEqual("Zeph.1.1")
p.include_apocrypha(false)
expect(p.parse("ସିଫନିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("ସିଫନିୟ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("ZEPH 1:1").osis()).toEqual("Zeph.1.1")
`
true
describe "Localized book Hag (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Hag (or)", ->
`
expect(p.parse("ହାଗୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("ହାଗୟ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("Hag 1:1").osis()).toEqual("Hag.1.1")
p.include_apocrypha(false)
expect(p.parse("ହାଗୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("ହାଗୟ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("HAG 1:1").osis()).toEqual("Hag.1.1")
`
true
describe "Localized book Zech (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Zech (or)", ->
`
expect(p.parse("ଯିଖରିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("ଯିଖରିୟ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("Zech 1:1").osis()).toEqual("Zech.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିଖରିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("ଯିଖରିୟ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("ZECH 1:1").osis()).toEqual("Zech.1.1")
`
true
describe "Localized book Mal (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Mal (or)", ->
`
expect(p.parse("ମଲାଖି ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("ମଲାଖି 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("Mal 1:1").osis()).toEqual("Mal.1.1")
p.include_apocrypha(false)
expect(p.parse("ମଲାଖି ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("ମଲାଖି 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("MAL 1:1").osis()).toEqual("Mal.1.1")
`
true
describe "Localized book Matt (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Matt (or)", ->
`
expect(p.parse("ମାଥିଉ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("ମାଥିଉ 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("Matt 1:1").osis()).toEqual("Matt.1.1")
p.include_apocrypha(false)
expect(p.parse("ମାଥିଉ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("ମାଥିଉ 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("MATT 1:1").osis()).toEqual("Matt.1.1")
`
true
describe "Localized book Mark (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Mark (or)", ->
`
expect(p.parse("ମାର୍କ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("ମାର୍କ 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("Mark 1:1").osis()).toEqual("Mark.1.1")
p.include_apocrypha(false)
expect(p.parse("ମାର୍କ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("ମାର୍କ 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("MARK 1:1").osis()).toEqual("Mark.1.1")
`
true
describe "Localized book Luke (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Luke (or)", ->
`
expect(p.parse("ଲୂକ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("Luke 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("ଲୂକ 1:1").osis()).toEqual("Luke.1.1")
p.include_apocrypha(false)
expect(p.parse("ଲୂକ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("LUKE 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("ଲୂକ 1:1").osis()).toEqual("Luke.1.1")
`
true
describe "Localized book 1John (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1John (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("ପ୍ରଥମ ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1. ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1 ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1John 1:1").osis()).toEqual("1John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("ପ୍ରଥମ ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1. ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1 ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1JOHN 1:1").osis()).toEqual("1John.1.1")
`
true
describe "Localized book 2John (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2John (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2. ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2 ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2John 1:1").osis()).toEqual("2John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2. ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2 ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2JOHN 1:1").osis()).toEqual("2John.1.1")
`
true
describe "Localized book 3John (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 3John (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ତୃତୀୟ ପତ୍ର 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("ତୃତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3. ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3 ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3John 1:1").osis()).toEqual("3John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ତୃତୀୟ ପତ୍ର 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("ତୃତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3. ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3 ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3JOHN 1:1").osis()).toEqual("3John.1.1")
`
true
describe "Localized book John (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: John (or)", ->
`
expect(p.parse("ଯୋହନ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("John.1.1")
expect(p.parse("John 1:1").osis()).toEqual("John.1.1")
expect(p.parse("ଯୋହନ 1:1").osis()).toEqual("John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("John.1.1")
expect(p.parse("JOHN 1:1").osis()).toEqual("John.1.1")
expect(p.parse("ଯୋହନ 1:1").osis()).toEqual("John.1.1")
`
true
describe "Localized book Acts (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Acts (or)", ->
`
expect(p.parse("ପ୍ରେରିତମାନଙ୍କ କାର୍ଯ୍ୟର ବିବରଣ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("ପ୍ରେରିତ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("Acts 1:1").osis()).toEqual("Acts.1.1")
p.include_apocrypha(false)
expect(p.parse("ପ୍ରେରିତମାନଙ୍କ କାର୍ଯ୍ୟର ବିବରଣ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("ପ୍ରେରିତ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("ACTS 1:1").osis()).toEqual("Acts.1.1")
`
true
describe "Localized book Rom (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Rom (or)", ->
`
expect(p.parse("ରୋମୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("ରୋମୀୟଙ୍କ 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("Rom 1:1").osis()).toEqual("Rom.1.1")
p.include_apocrypha(false)
expect(p.parse("ରୋମୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("ରୋମୀୟଙ୍କ 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("ROM 1:1").osis()).toEqual("Rom.1.1")
`
true
describe "Localized book 2Cor (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Cor (or)", ->
`
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2Cor 1:1").osis()).toEqual("2Cor.1.1")
p.include_apocrypha(false)
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2COR 1:1").osis()).toEqual("2Cor.1.1")
`
true
describe "Localized book 1Cor (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Cor (or)", ->
`
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1Cor 1:1").osis()).toEqual("1Cor.1.1")
p.include_apocrypha(false)
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1COR 1:1").osis()).toEqual("1Cor.1.1")
`
true
describe "Localized book Gal (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Gal (or)", ->
`
expect(p.parse("ଗାଲାତୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("ଗାଲାତୀୟଙ୍କ 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("Gal 1:1").osis()).toEqual("Gal.1.1")
p.include_apocrypha(false)
expect(p.parse("ଗାଲାତୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("ଗାଲାତୀୟଙ୍କ 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("GAL 1:1").osis()).toEqual("Gal.1.1")
`
true
describe "Localized book Eph (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Eph (or)", ->
`
expect(p.parse("ଏଫିସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("ଏଫିସୀୟଙ୍କ 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("Eph 1:1").osis()).toEqual("Eph.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏଫିସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("ଏଫିସୀୟଙ୍କ 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("EPH 1:1").osis()).toEqual("Eph.1.1")
`
true
describe "Localized book Phil (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Phil (or)", ->
`
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("Phil 1:1").osis()).toEqual("Phil.1.1")
p.include_apocrypha(false)
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("PHIL 1:1").osis()).toEqual("Phil.1.1")
`
true
describe "Localized book Col (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Col (or)", ->
`
expect(p.parse("କଲସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("କଲସୀୟଙ୍କ 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("Col 1:1").osis()).toEqual("Col.1.1")
p.include_apocrypha(false)
expect(p.parse("କଲସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("କଲସୀୟଙ୍କ 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("COL 1:1").osis()).toEqual("Col.1.1")
`
true
describe "Localized book 2Thess (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Thess (or)", ->
`
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2Thess 1:1").osis()).toEqual("2Thess.1.1")
p.include_apocrypha(false)
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2THESS 1:1").osis()).toEqual("2Thess.1.1")
`
true
describe "Localized book 1Thess (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Thess (or)", ->
`
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("ପ୍ରଥମ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1Thess 1:1").osis()).toEqual("1Thess.1.1")
p.include_apocrypha(false)
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("ପ୍ରଥମ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1THESS 1:1").osis()).toEqual("1Thess.1.1")
`
true
describe "Localized book 2Tim (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Tim (or)", ->
`
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2Tim 1:1").osis()).toEqual("2Tim.1.1")
p.include_apocrypha(false)
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2TIM 1:1").osis()).toEqual("2Tim.1.1")
`
true
describe "Localized book 1Tim (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Tim (or)", ->
`
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("ପ୍ରଥମ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1Tim 1:1").osis()).toEqual("1Tim.1.1")
p.include_apocrypha(false)
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("ପ୍ରଥମ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1TIM 1:1").osis()).toEqual("1Tim.1.1")
`
true
describe "Localized book Titus (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Titus (or)", ->
`
expect(p.parse("ତୀତସଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("ତୀତସଙ୍କ 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("Titus 1:1").osis()).toEqual("Titus.1.1")
p.include_apocrypha(false)
expect(p.parse("ତୀତସଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("ତୀତସଙ୍କ 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("TITUS 1:1").osis()).toEqual("Titus.1.1")
`
true
describe "Localized book Phlm (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Phlm (or)", ->
`
expect(p.parse("ଫିଲୀମୋନଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("ଫିଲୀମୋନଙ୍କ 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("Phlm 1:1").osis()).toEqual("Phlm.1.1")
p.include_apocrypha(false)
expect(p.parse("ଫିଲୀମୋନଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("ଫିଲୀମୋନଙ୍କ 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("PHLM 1:1").osis()).toEqual("Phlm.1.1")
`
true
describe "Localized book Heb (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Heb (or)", ->
`
expect(p.parse("ଏବ୍ରୀ 1:1").osis()).toEqual("Heb.1.1")
expect(p.parse("Heb 1:1").osis()).toEqual("Heb.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏବ୍ରୀ 1:1").osis()).toEqual("Heb.1.1")
expect(p.parse("HEB 1:1").osis()).toEqual("Heb.1.1")
`
true
describe "Localized book Jas (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Jas (or)", ->
`
expect(p.parse("ଯାକୁବଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("ଯାକୁବଙ୍କ 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("Jas 1:1").osis()).toEqual("Jas.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯାକୁବଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("ଯାକୁବଙ୍କ 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("JAS 1:1").osis()).toEqual("Jas.1.1")
`
true
describe "Localized book 2Pet (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Pet (or)", ->
`
expect(p.parse("ପିତରଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2. ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2 ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2Pet 1:1").osis()).toEqual("2Pet.1.1")
p.include_apocrypha(false)
expect(p.parse("ପିତରଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2. ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2 ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2PET 1:1").osis()).toEqual("2Pet.1.1")
`
true
describe "Localized book 1Pet (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Pet (or)", ->
`
expect(p.parse("ପିତରଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("ପ୍ରଥମ ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1. ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1 ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1Pet 1:1").osis()).toEqual("1Pet.1.1")
p.include_apocrypha(false)
expect(p.parse("ପିତରଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("ପ୍ରଥମ ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1. ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1 ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1PET 1:1").osis()).toEqual("1Pet.1.1")
`
true
describe "Localized book Jude (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Jude (or)", ->
`
expect(p.parse("ଯିହୂଦାଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("ଯିହୂଦାଙ୍କ 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("Jude 1:1").osis()).toEqual("Jude.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିହୂଦାଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("ଯିହୂଦାଙ୍କ 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("JUDE 1:1").osis()).toEqual("Jude.1.1")
`
true
describe "Localized book Tob (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Tob (or)", ->
`
expect(p.parse("Tob 1:1").osis()).toEqual("Tob.1.1")
`
true
describe "Localized book Jdt (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Jdt (or)", ->
`
expect(p.parse("Jdt 1:1").osis()).toEqual("Jdt.1.1")
`
true
describe "Localized book Bar (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Bar (or)", ->
`
expect(p.parse("Bar 1:1").osis()).toEqual("Bar.1.1")
`
true
describe "Localized book Sus (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Sus (or)", ->
`
expect(p.parse("Sus 1:1").osis()).toEqual("Sus.1.1")
`
true
describe "Localized book 2Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Macc (or)", ->
`
expect(p.parse("2Macc 1:1").osis()).toEqual("2Macc.1.1")
`
true
describe "Localized book 3Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 3Macc (or)", ->
`
expect(p.parse("3Macc 1:1").osis()).toEqual("3Macc.1.1")
`
true
describe "Localized book 4Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 4Macc (or)", ->
`
expect(p.parse("4Macc 1:1").osis()).toEqual("4Macc.1.1")
`
true
describe "Localized book 1Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Macc (or)", ->
`
expect(p.parse("1Macc 1:1").osis()).toEqual("1Macc.1.1")
`
true
describe "Miscellaneous tests", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore", book_sequence_strategy: "ignore", osis_compaction_strategy: "bc", captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should return the expected language", ->
expect(p.languages).toEqual ["or"]
it "should handle ranges (or)", ->
expect(p.parse("Titus 1:1 ଠାରୁ 2").osis()).toEqual "Titus.1.1-Titus.1.2"
expect(p.parse("Matt 1ଠାରୁ2").osis()).toEqual "Matt.1-Matt.2"
expect(p.parse("Phlm 2 ଠାରୁ 3").osis()).toEqual "Phlm.1.2-Phlm.1.3"
it "should handle chapters (or)", ->
expect(p.parse("Titus 1:1, chapter 2").osis()).toEqual "Titus.1.1,Titus.2"
expect(p.parse("Matt 3:4 CHAPTER 6").osis()).toEqual "Matt.3.4,Matt.6"
it "should handle verses (or)", ->
expect(p.parse("Exod 1:1 verse 3").osis()).toEqual "Exod.1.1,Exod.1.3"
expect(p.parse("Phlm VERSE 6").osis()).toEqual "Phlm.1.6"
it "should handle 'and' (or)", ->
expect(p.parse("Exod 1:1 and 3").osis()).toEqual "Exod.1.1,Exod.1.3"
expect(p.parse("Phlm 2 AND 6").osis()).toEqual "Phlm.1.2,Phlm.1.6"
it "should handle titles (or)", ->
expect(p.parse("Ps 3 title, 4:2, 5:title").osis()).toEqual "Ps.3.1,Ps.4.2,Ps.5.1"
expect(p.parse("PS 3 TITLE, 4:2, 5:TITLE").osis()).toEqual "Ps.3.1,Ps.4.2,Ps.5.1"
it "should handle 'ff' (or)", ->
expect(p.parse("Rev 3ff, 4:2ff").osis()).toEqual "Rev.3-Rev.22,Rev.4.2-Rev.4.11"
expect(p.parse("REV 3 FF, 4:2 FF").osis()).toEqual "Rev.3-Rev.22,Rev.4.2-Rev.4.11"
it "should handle translations (or)", ->
expect(p.parse("Lev 1 (ERV)").osis_and_translations()).toEqual [["Lev.1", "ERV"]]
expect(p.parse("lev 1 erv").osis_and_translations()).toEqual [["Lev.1", "ERV"]]
it "should handle book ranges (or)", ->
p.set_options {book_alone_strategy: "full", book_range_strategy: "include"}
expect(p.parse("ପ୍ରଥମ ଠାରୁ ତୃତୀୟ ଯୋହନଙ").osis()).toEqual "1John.1-3John.1"
it "should handle boundaries (or)", ->
p.set_options {book_alone_strategy: "full"}
expect(p.parse("\u2014Matt\u2014").osis()).toEqual "Matt.1-Matt.28"
expect(p.parse("\u201cMatt 1:1\u201d").osis()).toEqual "Matt.1.1"
| 45243 | bcv_parser = require("../../js/or_bcv_parser.js").bcv_parser
describe "Parsing", ->
p = {}
beforeEach ->
p = new bcv_parser
p.options.osis_compaction_strategy = "b"
p.options.sequence_combination_strategy = "combine"
it "should round-trip OSIS references", ->
p.set_options osis_compaction_strategy: "bc"
books = ["Gen","Exod","Lev","Num","Deut","Josh","Judg","Ruth","1Sam","2Sam","1Kgs","2Kgs","1Chr","2Chr","Ezra","Neh","Esth","Job","Ps","Prov","Eccl","Song","Isa","Jer","Lam","Ezek","<NAME>","<NAME>","<NAME>","<NAME>mos","<NAME>ad","<NAME>","<NAME>","<NAME>ah","Hab","Zeph","Hag","Zech","<NAME>","<NAME>","<NAME>","<NAME>","<NAME>","Acts","Rom","1Cor","2Cor","Gal","Eph","Phil","Col","1Thess","2Thess","1Tim","2Tim","Titus","Phlm","Heb","Jas","1Pet","2Pet","1John","2John","3John","Jude","Rev"]
for book in books
bc = book + ".1"
bcv = bc + ".1"
bcv_range = bcv + "-" + bc + ".2"
expect(p.parse(bc).osis()).toEqual bc
expect(p.parse(bcv).osis()).toEqual bcv
expect(p.parse(bcv_range).osis()).toEqual bcv_range
it "should round-trip OSIS Apocrypha references", ->
p.set_options osis_compaction_strategy: "bc", ps151_strategy: "b"
p.include_apocrypha true
books = ["Tob","Jdt","GkEsth","Wis","Sir","Bar","PrAzar","Sus","Bel","SgThree","EpJer","1Macc","2Macc","3Macc","4Macc","1Esd","2Esd","PrMan","Ps151"]
for book in books
bc = book + ".1"
bcv = bc + ".1"
bcv_range = bcv + "-" + bc + ".2"
expect(p.parse(bc).osis()).toEqual bc
expect(p.parse(bcv).osis()).toEqual bcv
expect(p.parse(bcv_range).osis()).toEqual bcv_range
p.set_options ps151_strategy: "bc"
expect(p.parse("Ps151.1").osis()).toEqual "Ps.151"
expect(p.parse("Ps151.1.1").osis()).toEqual "Ps.151.1"
expect(p.parse("Ps151.1-Ps151.2").osis()).toEqual "Ps.151.1-Ps.151.2"
p.include_apocrypha false
for book in books
bc = book + ".1"
expect(p.parse(bc).osis()).toEqual ""
it "should handle a preceding character", ->
expect(p.parse(" Gen 1").osis()).toEqual "Gen.1"
expect(p.parse("Matt5John3").osis()).toEqual "Matt.5,John.3"
expect(p.parse("1Ps 1").osis()).toEqual ""
expect(p.parse("11Sam 1").osis()).toEqual ""
describe "Localized book Gen (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Gen (or)", ->
`
expect(p.parse("ଆଦିପୁସ୍ତକ 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("Gen 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("ଆଦି 1:1").osis()).toEqual("Gen.1.1")
p.include_apocrypha(false)
expect(p.parse("ଆଦିପୁସ୍ତକ 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("GEN 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("ଆଦି 1:1").osis()).toEqual("Gen.1.1")
`
true
describe "Localized book Exod (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Exod (or)", ->
`
expect(p.parse("ଯାତ୍ରା ପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରାପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରା 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("Exod 1:1").osis()).toEqual("Exod.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯାତ୍ରା ପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରାପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରା 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("EXOD 1:1").osis()).toEqual("Exod.1.1")
`
true
describe "Localized book Bel (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Bel (or)", ->
`
expect(p.parse("Bel 1:1").osis()).toEqual("Bel.1.1")
`
true
describe "Localized book Lev (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Lev (or)", ->
`
expect(p.parse("ଲେବୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("ଲେବୀୟ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("Lev 1:1").osis()).toEqual("Lev.1.1")
p.include_apocrypha(false)
expect(p.parse("ଲେବୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("ଲେବୀୟ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("LEV 1:1").osis()).toEqual("Lev.1.1")
`
true
describe "Localized book Num (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Num (or)", ->
`
expect(p.parse("ଗଣନା ପୁସ୍ତକ 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("ଗଣନା 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("Num 1:1").osis()).toEqual("Num.1.1")
p.include_apocrypha(false)
expect(p.parse("ଗଣନା ପୁସ୍ତକ 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("ଗଣନା 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("NUM 1:1").osis()).toEqual("Num.1.1")
`
true
describe "Localized book Sir (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Sir (or)", ->
`
expect(p.parse("Sir 1:1").osis()).toEqual("Sir.1.1")
`
true
describe "Localized book Wis (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Wis (or)", ->
`
expect(p.parse("Wis 1:1").osis()).toEqual("Wis.1.1")
`
true
describe "Localized book Lam (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Lam (or)", ->
`
expect(p.parse("ଯିରିମିୟଙ୍କ ବିଳାପ 1:1").osis()).toEqual("Lam.1.1")
expect(p.parse("Lam 1:1").osis()).toEqual("Lam.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିରିମିୟଙ୍କ ବିଳାପ 1:1").osis()).toEqual("Lam.1.1")
expect(p.parse("LAM 1:1").osis()).toEqual("Lam.1.1")
`
true
describe "Localized book EpJer (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: EpJer (or)", ->
`
expect(p.parse("EpJer 1:1").osis()).toEqual("EpJer.1.1")
`
true
describe "Localized book Rev (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Rev (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରତି ପ୍ରକାଶିତ ବାକ୍ୟ 1:1").osis()).toEqual("Rev.1.1")
expect(p.parse("Rev 1:1").osis()).toEqual("Rev.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରତି ପ୍ରକାଶିତ ବାକ୍ୟ 1:1").osis()).toEqual("Rev.1.1")
expect(p.parse("REV 1:1").osis()).toEqual("Rev.1.1")
`
true
describe "Localized book PrMan (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PrMan (or)", ->
`
expect(p.parse("PrMan 1:1").osis()).toEqual("PrMan.1.1")
`
true
describe "Localized book Deut (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Deut (or)", ->
`
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣୀ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ବିବରଣି 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("Deut 1:1").osis()).toEqual("Deut.1.1")
p.include_apocrypha(false)
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣୀ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ବିବରଣି 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("DEUT 1:1").osis()).toEqual("Deut.1.1")
`
true
describe "Localized book <NAME>osh (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: <NAME>osh (or)", ->
`
expect(p.parse("ଯିହୋଶୂୟଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("ଯିହୋଶୂୟଙ୍କର 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("Josh 1:1").osis()).toEqual("Josh.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିହୋଶୂୟଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("ଯିହୋଶୂୟଙ୍କର 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("JOSH 1:1").osis()).toEqual("Josh.1.1")
`
true
describe "Localized book Judg (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Judg (or)", ->
`
expect(p.parse("ବିଗ୍ଭରକର୍ତ୍ତାମାନଙ୍କ ବିବରଣ 1:1").osis()).toEqual("Judg.1.1")
expect(p.parse("Judg 1:1").osis()).toEqual("Judg.1.1")
p.include_apocrypha(false)
expect(p.parse("ବିଗ୍ଭରକର୍ତ୍ତାମାନଙ୍କ ବିବରଣ 1:1").osis()).toEqual("Judg.1.1")
expect(p.parse("JUDG 1:1").osis()).toEqual("Judg.1.1")
`
true
describe "Localized book Ruth (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ruth (or)", ->
`
expect(p.parse("ଋତର ବିବରଣ ପୁସ୍ତକ 1:1").osis()).toEqual("Ruth.1.1")
expect(p.parse("Ruth 1:1").osis()).toEqual("Ruth.1.1")
p.include_apocrypha(false)
expect(p.parse("ଋତର ବିବରଣ ପୁସ୍ତକ 1:1").osis()).toEqual("Ruth.1.1")
expect(p.parse("RUTH 1:1").osis()).toEqual("Ruth.1.1")
`
true
describe "Localized book 1Esd (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Esd (or)", ->
`
expect(p.parse("1Esd 1:1").osis()).toEqual("1Esd.1.1")
`
true
describe "Localized book 2Esd (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Esd (or)", ->
`
expect(p.parse("2Esd 1:1").osis()).toEqual("2Esd.1.1")
`
true
describe "Localized book Isa (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Isa (or)", ->
`
expect(p.parse("ଯିଶାଇୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯାଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯିଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯୀଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟିଶାୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("Isa 1:1").osis()).toEqual("Isa.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିଶାଇୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯାଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯିଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯୀଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟିଶାୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ISA 1:1").osis()).toEqual("Isa.1.1")
`
true
describe "Localized book 2Sam (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Sam (or)", ->
`
expect(p.parse("ଶାମୁୟେଲଙ୍କ ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2Sam 1:1").osis()).toEqual("2Sam.1.1")
p.include_apocrypha(false)
expect(p.parse("ଶାମୁୟେଲଙ୍କ ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2SAM 1:1").osis()).toEqual("2Sam.1.1")
`
true
describe "Localized book 1Sam (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Sam (or)", ->
`
expect(p.parse("ଶାମୁୟେଲଙ୍କ ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1Sam 1:1").osis()).toEqual("1Sam.1.1")
p.include_apocrypha(false)
expect(p.parse("ଶାମୁୟେଲଙ୍କ ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1SAM 1:1").osis()).toEqual("1Sam.1.1")
`
true
describe "Localized book 2Kgs (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Kgs (or)", ->
`
expect(p.parse("ରାଜାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2Kgs 1:1").osis()).toEqual("2Kgs.1.1")
p.include_apocrypha(false)
expect(p.parse("ରାଜାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2KGS 1:1").osis()).toEqual("2Kgs.1.1")
`
true
describe "Localized book 1Kgs (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Kgs (or)", ->
`
expect(p.parse("ରାଜାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1Kgs 1:1").osis()).toEqual("1Kgs.1.1")
p.include_apocrypha(false)
expect(p.parse("ରାଜାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1KGS 1:1").osis()).toEqual("1Kgs.1.1")
`
true
describe "Localized book 2Chr (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Chr (or)", ->
`
expect(p.parse("ବଂଶାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2Chr 1:1").osis()).toEqual("2Chr.1.1")
p.include_apocrypha(false)
expect(p.parse("ବଂଶାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2CHR 1:1").osis()).toEqual("2Chr.1.1")
`
true
describe "Localized book 1Chr (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Chr (or)", ->
`
expect(p.parse("ବଂଶାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1Chr 1:1").osis()).toEqual("1Chr.1.1")
p.include_apocrypha(false)
expect(p.parse("ବଂଶାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1CHR 1:1").osis()).toEqual("1Chr.1.1")
`
true
describe "Localized book Ezra (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ezra (or)", ->
`
expect(p.parse("ଏଜ୍ରା 1:1").osis()).toEqual("Ezra.1.1")
expect(p.parse("Ezra 1:1").osis()).toEqual("Ezra.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏଜ୍ରା 1:1").osis()).toEqual("Ezra.1.1")
expect(p.parse("EZRA 1:1").osis()).toEqual("Ezra.1.1")
`
true
describe "Localized book Neh (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Neh (or)", ->
`
expect(p.parse("ନିହିମିୟାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("ନିହିମିୟାଙ୍କର 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("Neh 1:1").osis()).toEqual("Neh.1.1")
p.include_apocrypha(false)
expect(p.parse("ନିହିମିୟାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("ନିହିମିୟାଙ୍କର 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("NEH 1:1").osis()).toEqual("Neh.1.1")
`
true
describe "Localized book GkEsth (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: GkEsth (or)", ->
`
expect(p.parse("GkEsth 1:1").osis()).toEqual("GkEsth.1.1")
`
true
describe "Localized book Esth (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Esth (or)", ->
`
expect(p.parse("ଏଷ୍ଟର ବିବରଣ 1:1").osis()).toEqual("Esth.1.1")
expect(p.parse("Esth 1:1").osis()).toEqual("Esth.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏଷ୍ଟର ବିବରଣ 1:1").osis()).toEqual("Esth.1.1")
expect(p.parse("ESTH 1:1").osis()).toEqual("Esth.1.1")
`
true
describe "Localized book Job (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Job (or)", ->
`
expect(p.parse("ଆୟୁବ ପୁସ୍ତକ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("ଆୟୁବ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("Job 1:1").osis()).toEqual("Job.1.1")
p.include_apocrypha(false)
expect(p.parse("ଆୟୁବ ପୁସ୍ତକ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("ଆୟୁବ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("JOB 1:1").osis()).toEqual("Job.1.1")
`
true
describe "Localized book Ps (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ps (or)", ->
`
expect(p.parse("ଗୀତିସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗାତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗୀତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("Ps 1:1").osis()).toEqual("Ps.1.1")
p.include_apocrypha(false)
expect(p.parse("ଗୀତିସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗାତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗୀତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("PS 1:1").osis()).toEqual("Ps.1.1")
`
true
describe "Localized book PrAzar (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PrAzar (or)", ->
`
expect(p.parse("PrAzar 1:1").osis()).toEqual("PrAzar.1.1")
`
true
describe "Localized book Prov (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Prov (or)", ->
`
expect(p.parse("ହିତୋପଦେଶ 1:1").osis()).toEqual("Prov.1.1")
expect(p.parse("Prov 1:1").osis()).toEqual("Prov.1.1")
p.include_apocrypha(false)
expect(p.parse("ହିତୋପଦେଶ 1:1").osis()).toEqual("Prov.1.1")
expect(p.parse("PROV 1:1").osis()).toEqual("Prov.1.1")
`
true
describe "Localized book Eccl (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Eccl (or)", ->
`
expect(p.parse("ଉପଦେଶକ 1:1").osis()).toEqual("Eccl.1.1")
expect(p.parse("Eccl 1:1").osis()).toEqual("Eccl.1.1")
p.include_apocrypha(false)
expect(p.parse("ଉପଦେଶକ 1:1").osis()).toEqual("Eccl.1.1")
expect(p.parse("ECCL 1:1").osis()).toEqual("Eccl.1.1")
`
true
describe "Localized book SgThree (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: SgThree (or)", ->
`
expect(p.parse("SgThree 1:1").osis()).toEqual("SgThree.1.1")
`
true
describe "Localized book Song (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Song (or)", ->
`
expect(p.parse("ପରମଗୀତ 1:1").osis()).toEqual("Song.1.1")
expect(p.parse("Song 1:1").osis()).toEqual("Song.1.1")
p.include_apocrypha(false)
expect(p.parse("ପରମଗୀତ 1:1").osis()).toEqual("Song.1.1")
expect(p.parse("SONG 1:1").osis()).toEqual("Song.1.1")
`
true
describe "Localized book Jer (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Jer (or)", ->
`
expect(p.parse("ଯିରିମିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("ଯିରିମିୟ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("Jer 1:1").osis()).toEqual("Jer.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିରିମିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("ଯିରିମିୟ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("JER 1:1").osis()).toEqual("Jer.1.1")
`
true
describe "Localized book Ezek (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ezek (or)", ->
`
expect(p.parse("ଯିହିଜିକଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("ଯିହିଜିକଲ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("Ezek 1:1").osis()).toEqual("Ezek.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିହିଜିକଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("ଯିହିଜିକଲ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("EZEK 1:1").osis()).toEqual("Ezek.1.1")
`
true
describe "Localized book Dan (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Dan (or)", ->
`
expect(p.parse("ଦାନିୟେଲଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("ଦାନିୟେଲଙ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("Dan 1:1").osis()).toEqual("Dan.1.1")
p.include_apocrypha(false)
expect(p.parse("ଦାନିୟେଲଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("ଦାନିୟେଲଙ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("DAN 1:1").osis()).toEqual("Dan.1.1")
`
true
describe "Localized book Hos (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Hos (or)", ->
`
expect(p.parse("ହୋଶେୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶହେ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶେୟ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("Hos 1:1").osis()).toEqual("Hos.1.1")
p.include_apocrypha(false)
expect(p.parse("ହୋଶେୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶହେ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶେୟ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("HOS 1:1").osis()).toEqual("Hos.1.1")
`
true
describe "Localized book <NAME>el (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: <NAME> (or)", ->
`
expect(p.parse("ଯୋୟେଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("ଯୋୟେଲ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("Joel 1:1").osis()).toEqual("Joel.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋୟେଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("ଯୋୟେଲ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("JOEL 1:1").osis()).toEqual("Joel.1.1")
`
true
describe "Localized book Amos (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Amos (or)", ->
`
expect(p.parse("ଆମୋଷ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("Amos 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("ଆମୋଷ 1:1").osis()).toEqual("Amos.1.1")
p.include_apocrypha(false)
expect(p.parse("ଆମୋଷ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("AMOS 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("ଆମୋଷ 1:1").osis()).toEqual("Amos.1.1")
`
true
describe "Localized book Obad (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Obad (or)", ->
`
expect(p.parse("ଓବଦିଅ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("ଓବଦିଅ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("Obad 1:1").osis()).toEqual("Obad.1.1")
p.include_apocrypha(false)
expect(p.parse("ଓବଦିଅ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("ଓବଦିଅ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("OBAD 1:1").osis()).toEqual("Obad.1.1")
`
true
describe "Localized book <NAME>ah (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: <NAME>ah (or)", ->
`
expect(p.parse("ଯୂନସ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("Jonah 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("ଯୂନସ 1:1").osis()).toEqual("Jonah.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୂନସ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("JONAH 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("ଯୂନସ 1:1").osis()).toEqual("Jonah.1.1")
`
true
describe "Localized book <NAME>ic (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Mic (or)", ->
`
expect(p.parse("ମୀଖା ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମିଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମୀଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("Mic 1:1").osis()).toEqual("Mic.1.1")
p.include_apocrypha(false)
expect(p.parse("ମୀଖା ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମିଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମୀଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("MIC 1:1").osis()).toEqual("Mic.1.1")
`
true
describe "Localized book Nah (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Nah (or)", ->
`
expect(p.parse("ନାହୂମ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("ନାହୂମ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("Nah 1:1").osis()).toEqual("Nah.1.1")
p.include_apocrypha(false)
expect(p.parse("ନାହୂମ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("ନାହୂମ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("NAH 1:1").osis()).toEqual("Nah.1.1")
`
true
describe "Localized book Hab (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Hab (or)", ->
`
expect(p.parse("ହବକ୍କୂକ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକ୍କୂକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୁକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୂକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("Hab 1:1").osis()).toEqual("Hab.1.1")
p.include_apocrypha(false)
expect(p.parse("ହବକ୍କୂକ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକ୍କୂକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୁକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୂକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("HAB 1:1").osis()).toEqual("Hab.1.1")
`
true
describe "Localized book Zeph (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Zeph (or)", ->
`
expect(p.parse("ସିଫନିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("ସିଫନିୟ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("Zeph 1:1").osis()).toEqual("Zeph.1.1")
p.include_apocrypha(false)
expect(p.parse("ସିଫନିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("ସିଫନିୟ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("ZEPH 1:1").osis()).toEqual("Zeph.1.1")
`
true
describe "Localized book Hag (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Hag (or)", ->
`
expect(p.parse("ହାଗୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("ହାଗୟ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("Hag 1:1").osis()).toEqual("Hag.1.1")
p.include_apocrypha(false)
expect(p.parse("ହାଗୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("ହାଗୟ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("HAG 1:1").osis()).toEqual("Hag.1.1")
`
true
describe "Localized book Zech (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Zech (or)", ->
`
expect(p.parse("ଯିଖରିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("ଯିଖରିୟ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("Zech 1:1").osis()).toEqual("Zech.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିଖରିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("ଯିଖରିୟ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("ZECH 1:1").osis()).toEqual("Zech.1.1")
`
true
describe "Localized book Mal (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Mal (or)", ->
`
expect(p.parse("ମଲାଖି ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("ମଲାଖି 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("Mal 1:1").osis()).toEqual("Mal.1.1")
p.include_apocrypha(false)
expect(p.parse("ମଲାଖି ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("ମଲାଖି 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("MAL 1:1").osis()).toEqual("Mal.1.1")
`
true
describe "Localized book Matt (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: <NAME> (or)", ->
`
expect(p.parse("ମାଥିଉ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("ମାଥିଉ 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("Matt 1:1").osis()).toEqual("Matt.1.1")
p.include_apocrypha(false)
expect(p.parse("ମାଥିଉ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("ମାଥିଉ 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("MATT 1:1").osis()).toEqual("Matt.1.1")
`
true
describe "Localized book Mark (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Mark (or)", ->
`
expect(p.parse("ମାର୍କ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("ମାର୍କ 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("Mark 1:1").osis()).toEqual("Mark.1.1")
p.include_apocrypha(false)
expect(p.parse("ମାର୍କ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("ମାର୍କ 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("MARK 1:1").osis()).toEqual("Mark.1.1")
`
true
describe "Localized book Luke (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Luke (or)", ->
`
expect(p.parse("ଲୂକ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("Luke 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("ଲୂକ 1:1").osis()).toEqual("Luke.1.1")
p.include_apocrypha(false)
expect(p.parse("ଲୂକ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("LUKE 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("ଲୂକ 1:1").osis()).toEqual("Luke.1.1")
`
true
describe "Localized book 1John (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1John (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("ପ୍ରଥମ ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1. ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1 ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1John 1:1").osis()).toEqual("1John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("ପ୍ରଥମ ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1. ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1 ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1JOHN 1:1").osis()).toEqual("1John.1.1")
`
true
describe "Localized book <NAME>John (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: <NAME> (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2. ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2 ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2John 1:1").osis()).toEqual("2John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2. ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2 ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2JOHN 1:1").osis()).toEqual("2John.1.1")
`
true
describe "Localized book 3John (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 3John (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ତୃତୀୟ ପତ୍ର 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("ତୃତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3. ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3 ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3John 1:1").osis()).toEqual("3John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ତୃତୀୟ ପତ୍ର 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("ତୃତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3. ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3 ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3JOHN 1:1").osis()).toEqual("3John.1.1")
`
true
describe "Localized book <NAME> (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: <NAME> (or)", ->
`
expect(p.parse("ଯୋହନ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("John.1.1")
expect(p.parse("<NAME> 1:1").osis()).toEqual("John.1.1")
expect(p.parse("ଯୋହନ 1:1").osis()).toEqual("John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("John.1.1")
expect(p.parse("<NAME> 1:1").osis()).toEqual("John.1.1")
expect(p.parse("ଯୋହନ 1:1").osis()).toEqual("John.1.1")
`
true
describe "Localized book Acts (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Acts (or)", ->
`
expect(p.parse("ପ୍ରେରିତମାନଙ୍କ କାର୍ଯ୍ୟର ବିବରଣ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("ପ୍ରେରିତ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("Acts 1:1").osis()).toEqual("Acts.1.1")
p.include_apocrypha(false)
expect(p.parse("ପ୍ରେରିତମାନଙ୍କ କାର୍ଯ୍ୟର ବିବରଣ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("ପ୍ରେରିତ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("ACTS 1:1").osis()).toEqual("Acts.1.1")
`
true
describe "Localized book Rom (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Rom (or)", ->
`
expect(p.parse("ରୋମୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("ରୋମୀୟଙ୍କ 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("Rom 1:1").osis()).toEqual("Rom.1.1")
p.include_apocrypha(false)
expect(p.parse("ରୋମୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("ରୋମୀୟଙ୍କ 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("ROM 1:1").osis()).toEqual("Rom.1.1")
`
true
describe "Localized book 2Cor (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Cor (or)", ->
`
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2Cor 1:1").osis()).toEqual("2Cor.1.1")
p.include_apocrypha(false)
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2COR 1:1").osis()).toEqual("2Cor.1.1")
`
true
describe "Localized book 1Cor (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Cor (or)", ->
`
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1Cor 1:1").osis()).toEqual("1Cor.1.1")
p.include_apocrypha(false)
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1COR 1:1").osis()).toEqual("1Cor.1.1")
`
true
describe "Localized book Gal (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Gal (or)", ->
`
expect(p.parse("ଗାଲାତୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("ଗାଲାତୀୟଙ୍କ 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("Gal 1:1").osis()).toEqual("Gal.1.1")
p.include_apocrypha(false)
expect(p.parse("ଗାଲାତୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("ଗାଲାତୀୟଙ୍କ 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("GAL 1:1").osis()).toEqual("Gal.1.1")
`
true
describe "Localized book Eph (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Eph (or)", ->
`
expect(p.parse("ଏଫିସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("ଏଫିସୀୟଙ୍କ 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("Eph 1:1").osis()).toEqual("Eph.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏଫିସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("ଏଫିସୀୟଙ୍କ 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("EPH 1:1").osis()).toEqual("Eph.1.1")
`
true
describe "Localized book Phil (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Phil (or)", ->
`
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("Phil 1:1").osis()).toEqual("Phil.1.1")
p.include_apocrypha(false)
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("PHIL 1:1").osis()).toEqual("Phil.1.1")
`
true
describe "Localized book Col (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Col (or)", ->
`
expect(p.parse("କଲସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("କଲସୀୟଙ୍କ 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("Col 1:1").osis()).toEqual("Col.1.1")
p.include_apocrypha(false)
expect(p.parse("କଲସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("କଲସୀୟଙ୍କ 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("COL 1:1").osis()).toEqual("Col.1.1")
`
true
describe "Localized book 2Thess (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Thess (or)", ->
`
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2Thess 1:1").osis()).toEqual("2Thess.1.1")
p.include_apocrypha(false)
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2THESS 1:1").osis()).toEqual("2Thess.1.1")
`
true
describe "Localized book 1Thess (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Thess (or)", ->
`
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("ପ୍ରଥମ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1Thess 1:1").osis()).toEqual("1Thess.1.1")
p.include_apocrypha(false)
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("ପ୍ରଥମ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1THESS 1:1").osis()).toEqual("1Thess.1.1")
`
true
describe "Localized book 2Tim (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Tim (or)", ->
`
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2Tim 1:1").osis()).toEqual("2Tim.1.1")
p.include_apocrypha(false)
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2TIM 1:1").osis()).toEqual("2Tim.1.1")
`
true
describe "Localized book 1Tim (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Tim (or)", ->
`
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("ପ୍ରଥମ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1Tim 1:1").osis()).toEqual("1Tim.1.1")
p.include_apocrypha(false)
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("ପ୍ରଥମ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1TIM 1:1").osis()).toEqual("1Tim.1.1")
`
true
describe "Localized book Titus (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Titus (or)", ->
`
expect(p.parse("ତୀତସଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("ତୀତସଙ୍କ 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("Titus 1:1").osis()).toEqual("Titus.1.1")
p.include_apocrypha(false)
expect(p.parse("ତୀତସଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("ତୀତସଙ୍କ 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("TITUS 1:1").osis()).toEqual("Titus.1.1")
`
true
describe "Localized book Phlm (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Phlm (or)", ->
`
expect(p.parse("ଫିଲୀମୋନଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("ଫିଲୀମୋନଙ୍କ 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("Phlm 1:1").osis()).toEqual("Phlm.1.1")
p.include_apocrypha(false)
expect(p.parse("ଫିଲୀମୋନଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("ଫିଲୀମୋନଙ୍କ 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("PHLM 1:1").osis()).toEqual("Phlm.1.1")
`
true
describe "Localized book Heb (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Heb (or)", ->
`
expect(p.parse("ଏବ୍ରୀ 1:1").osis()).toEqual("Heb.1.1")
expect(p.parse("Heb 1:1").osis()).toEqual("Heb.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏବ୍ରୀ 1:1").osis()).toEqual("Heb.1.1")
expect(p.parse("HEB 1:1").osis()).toEqual("Heb.1.1")
`
true
describe "Localized book Jas (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Jas (or)", ->
`
expect(p.parse("ଯାକୁବଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("ଯାକୁବଙ୍କ 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("Jas 1:1").osis()).toEqual("Jas.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯାକୁବଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("ଯାକୁବଙ୍କ 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("JAS 1:1").osis()).toEqual("Jas.1.1")
`
true
describe "Localized book 2Pet (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Pet (or)", ->
`
expect(p.parse("ପିତରଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2. ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2 ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2Pet 1:1").osis()).toEqual("2Pet.1.1")
p.include_apocrypha(false)
expect(p.parse("ପିତରଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2. ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2 ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2PET 1:1").osis()).toEqual("2Pet.1.1")
`
true
describe "Localized book 1Pet (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Pet (or)", ->
`
expect(p.parse("ପିତରଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("ପ୍ରଥମ ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1. ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1 ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1Pet 1:1").osis()).toEqual("1Pet.1.1")
p.include_apocrypha(false)
expect(p.parse("ପିତରଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("ପ୍ରଥମ ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1. ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1 ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1PET 1:1").osis()).toEqual("1Pet.1.1")
`
true
describe "Localized book <NAME>ude (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: <NAME>ude (or)", ->
`
expect(p.parse("ଯିହୂଦାଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("ଯିହୂଦାଙ୍କ 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("Jude 1:1").osis()).toEqual("Jude.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିହୂଦାଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("ଯିହୂଦାଙ୍କ 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("JUDE 1:1").osis()).toEqual("Jude.1.1")
`
true
describe "Localized book Tob (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Tob (or)", ->
`
expect(p.parse("Tob 1:1").osis()).toEqual("Tob.1.1")
`
true
describe "Localized book Jdt (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Jdt (or)", ->
`
expect(p.parse("Jdt 1:1").osis()).toEqual("Jdt.1.1")
`
true
describe "Localized book Bar (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Bar (or)", ->
`
expect(p.parse("Bar 1:1").osis()).toEqual("Bar.1.1")
`
true
describe "Localized book Sus (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Sus (or)", ->
`
expect(p.parse("Sus 1:1").osis()).toEqual("Sus.1.1")
`
true
describe "Localized book 2Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Macc (or)", ->
`
expect(p.parse("2Macc 1:1").osis()).toEqual("2Macc.1.1")
`
true
describe "Localized book 3Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 3Macc (or)", ->
`
expect(p.parse("3Macc 1:1").osis()).toEqual("3Macc.1.1")
`
true
describe "Localized book 4Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 4Macc (or)", ->
`
expect(p.parse("4Macc 1:1").osis()).toEqual("4Macc.1.1")
`
true
describe "Localized book 1Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Macc (or)", ->
`
expect(p.parse("1Macc 1:1").osis()).toEqual("1Macc.1.1")
`
true
describe "Miscellaneous tests", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore", book_sequence_strategy: "ignore", osis_compaction_strategy: "bc", captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should return the expected language", ->
expect(p.languages).toEqual ["or"]
it "should handle ranges (or)", ->
expect(p.parse("Titus 1:1 ଠାରୁ 2").osis()).toEqual "Titus.1.1-Titus.1.2"
expect(p.parse("Matt 1ଠାରୁ2").osis()).toEqual "Matt.1-Matt.2"
expect(p.parse("Phlm 2 ଠାରୁ 3").osis()).toEqual "Phlm.1.2-Phlm.1.3"
it "should handle chapters (or)", ->
expect(p.parse("Titus 1:1, chapter 2").osis()).toEqual "Titus.1.1,Titus.2"
expect(p.parse("Matt 3:4 CHAPTER 6").osis()).toEqual "Matt.3.4,Matt.6"
it "should handle verses (or)", ->
expect(p.parse("Exod 1:1 verse 3").osis()).toEqual "Exod.1.1,Exod.1.3"
expect(p.parse("Phlm VERSE 6").osis()).toEqual "Phlm.1.6"
it "should handle 'and' (or)", ->
expect(p.parse("Exod 1:1 and 3").osis()).toEqual "Exod.1.1,Exod.1.3"
expect(p.parse("Phlm 2 AND 6").osis()).toEqual "Phlm.1.2,Phlm.1.6"
it "should handle titles (or)", ->
expect(p.parse("Ps 3 title, 4:2, 5:title").osis()).toEqual "Ps.3.1,Ps.4.2,Ps.5.1"
expect(p.parse("PS 3 TITLE, 4:2, 5:TITLE").osis()).toEqual "Ps.3.1,Ps.4.2,Ps.5.1"
it "should handle 'ff' (or)", ->
expect(p.parse("Rev 3ff, 4:2ff").osis()).toEqual "Rev.3-Rev.22,Rev.4.2-Rev.4.11"
expect(p.parse("REV 3 FF, 4:2 FF").osis()).toEqual "Rev.3-Rev.22,Rev.4.2-Rev.4.11"
it "should handle translations (or)", ->
expect(p.parse("Lev 1 (ERV)").osis_and_translations()).toEqual [["Lev.1", "ERV"]]
expect(p.parse("lev 1 erv").osis_and_translations()).toEqual [["Lev.1", "ERV"]]
it "should handle book ranges (or)", ->
p.set_options {book_alone_strategy: "full", book_range_strategy: "include"}
expect(p.parse("ପ୍ରଥମ ଠାରୁ ତୃତୀୟ ଯୋହନଙ").osis()).toEqual "1John.1-3John.1"
it "should handle boundaries (or)", ->
p.set_options {book_alone_strategy: "full"}
expect(p.parse("\u2014Matt\u2014").osis()).toEqual "Matt.1-Matt.28"
expect(p.parse("\u201cMatt 1:1\u201d").osis()).toEqual "Matt.1.1"
| true | bcv_parser = require("../../js/or_bcv_parser.js").bcv_parser
describe "Parsing", ->
p = {}
beforeEach ->
p = new bcv_parser
p.options.osis_compaction_strategy = "b"
p.options.sequence_combination_strategy = "combine"
it "should round-trip OSIS references", ->
p.set_options osis_compaction_strategy: "bc"
books = ["Gen","Exod","Lev","Num","Deut","Josh","Judg","Ruth","1Sam","2Sam","1Kgs","2Kgs","1Chr","2Chr","Ezra","Neh","Esth","Job","Ps","Prov","Eccl","Song","Isa","Jer","Lam","Ezek","PI:NAME:<NAME>END_PI","PI:NAME:<NAME>END_PI","PI:NAME:<NAME>END_PI","PI:NAME:<NAME>END_PImos","PI:NAME:<NAME>END_PIad","PI:NAME:<NAME>END_PI","PI:NAME:<NAME>END_PI","PI:NAME:<NAME>END_PIah","Hab","Zeph","Hag","Zech","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","Acts","Rom","1Cor","2Cor","Gal","Eph","Phil","Col","1Thess","2Thess","1Tim","2Tim","Titus","Phlm","Heb","Jas","1Pet","2Pet","1John","2John","3John","Jude","Rev"]
for book in books
bc = book + ".1"
bcv = bc + ".1"
bcv_range = bcv + "-" + bc + ".2"
expect(p.parse(bc).osis()).toEqual bc
expect(p.parse(bcv).osis()).toEqual bcv
expect(p.parse(bcv_range).osis()).toEqual bcv_range
it "should round-trip OSIS Apocrypha references", ->
p.set_options osis_compaction_strategy: "bc", ps151_strategy: "b"
p.include_apocrypha true
books = ["Tob","Jdt","GkEsth","Wis","Sir","Bar","PrAzar","Sus","Bel","SgThree","EpJer","1Macc","2Macc","3Macc","4Macc","1Esd","2Esd","PrMan","Ps151"]
for book in books
bc = book + ".1"
bcv = bc + ".1"
bcv_range = bcv + "-" + bc + ".2"
expect(p.parse(bc).osis()).toEqual bc
expect(p.parse(bcv).osis()).toEqual bcv
expect(p.parse(bcv_range).osis()).toEqual bcv_range
p.set_options ps151_strategy: "bc"
expect(p.parse("Ps151.1").osis()).toEqual "Ps.151"
expect(p.parse("Ps151.1.1").osis()).toEqual "Ps.151.1"
expect(p.parse("Ps151.1-Ps151.2").osis()).toEqual "Ps.151.1-Ps.151.2"
p.include_apocrypha false
for book in books
bc = book + ".1"
expect(p.parse(bc).osis()).toEqual ""
it "should handle a preceding character", ->
expect(p.parse(" Gen 1").osis()).toEqual "Gen.1"
expect(p.parse("Matt5John3").osis()).toEqual "Matt.5,John.3"
expect(p.parse("1Ps 1").osis()).toEqual ""
expect(p.parse("11Sam 1").osis()).toEqual ""
describe "Localized book Gen (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Gen (or)", ->
`
expect(p.parse("ଆଦିପୁସ୍ତକ 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("Gen 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("ଆଦି 1:1").osis()).toEqual("Gen.1.1")
p.include_apocrypha(false)
expect(p.parse("ଆଦିପୁସ୍ତକ 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("GEN 1:1").osis()).toEqual("Gen.1.1")
expect(p.parse("ଆଦି 1:1").osis()).toEqual("Gen.1.1")
`
true
describe "Localized book Exod (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Exod (or)", ->
`
expect(p.parse("ଯାତ୍ରା ପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରାପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରା 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("Exod 1:1").osis()).toEqual("Exod.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯାତ୍ରା ପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରାପୁସ୍ତକ 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("ଯାତ୍ରା 1:1").osis()).toEqual("Exod.1.1")
expect(p.parse("EXOD 1:1").osis()).toEqual("Exod.1.1")
`
true
describe "Localized book Bel (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Bel (or)", ->
`
expect(p.parse("Bel 1:1").osis()).toEqual("Bel.1.1")
`
true
describe "Localized book Lev (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Lev (or)", ->
`
expect(p.parse("ଲେବୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("ଲେବୀୟ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("Lev 1:1").osis()).toEqual("Lev.1.1")
p.include_apocrypha(false)
expect(p.parse("ଲେବୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("ଲେବୀୟ 1:1").osis()).toEqual("Lev.1.1")
expect(p.parse("LEV 1:1").osis()).toEqual("Lev.1.1")
`
true
describe "Localized book Num (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Num (or)", ->
`
expect(p.parse("ଗଣନା ପୁସ୍ତକ 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("ଗଣନା 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("Num 1:1").osis()).toEqual("Num.1.1")
p.include_apocrypha(false)
expect(p.parse("ଗଣନା ପୁସ୍ତକ 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("ଗଣନା 1:1").osis()).toEqual("Num.1.1")
expect(p.parse("NUM 1:1").osis()).toEqual("Num.1.1")
`
true
describe "Localized book Sir (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Sir (or)", ->
`
expect(p.parse("Sir 1:1").osis()).toEqual("Sir.1.1")
`
true
describe "Localized book Wis (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Wis (or)", ->
`
expect(p.parse("Wis 1:1").osis()).toEqual("Wis.1.1")
`
true
describe "Localized book Lam (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Lam (or)", ->
`
expect(p.parse("ଯିରିମିୟଙ୍କ ବିଳାପ 1:1").osis()).toEqual("Lam.1.1")
expect(p.parse("Lam 1:1").osis()).toEqual("Lam.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିରିମିୟଙ୍କ ବିଳାପ 1:1").osis()).toEqual("Lam.1.1")
expect(p.parse("LAM 1:1").osis()).toEqual("Lam.1.1")
`
true
describe "Localized book EpJer (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: EpJer (or)", ->
`
expect(p.parse("EpJer 1:1").osis()).toEqual("EpJer.1.1")
`
true
describe "Localized book Rev (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Rev (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରତି ପ୍ରକାଶିତ ବାକ୍ୟ 1:1").osis()).toEqual("Rev.1.1")
expect(p.parse("Rev 1:1").osis()).toEqual("Rev.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରତି ପ୍ରକାଶିତ ବାକ୍ୟ 1:1").osis()).toEqual("Rev.1.1")
expect(p.parse("REV 1:1").osis()).toEqual("Rev.1.1")
`
true
describe "Localized book PrMan (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PrMan (or)", ->
`
expect(p.parse("PrMan 1:1").osis()).toEqual("PrMan.1.1")
`
true
describe "Localized book Deut (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Deut (or)", ->
`
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣୀ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ବିବରଣି 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("Deut 1:1").osis()).toEqual("Deut.1.1")
p.include_apocrypha(false)
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣୀ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବିବରଣ 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("ବିବରଣି 1:1").osis()).toEqual("Deut.1.1")
expect(p.parse("DEUT 1:1").osis()).toEqual("Deut.1.1")
`
true
describe "Localized book PI:NAME:<NAME>END_PIosh (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PI:NAME:<NAME>END_PIosh (or)", ->
`
expect(p.parse("ଯିହୋଶୂୟଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("ଯିହୋଶୂୟଙ୍କର 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("Josh 1:1").osis()).toEqual("Josh.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିହୋଶୂୟଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("ଯିହୋଶୂୟଙ୍କର 1:1").osis()).toEqual("Josh.1.1")
expect(p.parse("JOSH 1:1").osis()).toEqual("Josh.1.1")
`
true
describe "Localized book Judg (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Judg (or)", ->
`
expect(p.parse("ବିଗ୍ଭରକର୍ତ୍ତାମାନଙ୍କ ବିବରଣ 1:1").osis()).toEqual("Judg.1.1")
expect(p.parse("Judg 1:1").osis()).toEqual("Judg.1.1")
p.include_apocrypha(false)
expect(p.parse("ବିଗ୍ଭରକର୍ତ୍ତାମାନଙ୍କ ବିବରଣ 1:1").osis()).toEqual("Judg.1.1")
expect(p.parse("JUDG 1:1").osis()).toEqual("Judg.1.1")
`
true
describe "Localized book Ruth (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ruth (or)", ->
`
expect(p.parse("ଋତର ବିବରଣ ପୁସ୍ତକ 1:1").osis()).toEqual("Ruth.1.1")
expect(p.parse("Ruth 1:1").osis()).toEqual("Ruth.1.1")
p.include_apocrypha(false)
expect(p.parse("ଋତର ବିବରଣ ପୁସ୍ତକ 1:1").osis()).toEqual("Ruth.1.1")
expect(p.parse("RUTH 1:1").osis()).toEqual("Ruth.1.1")
`
true
describe "Localized book 1Esd (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Esd (or)", ->
`
expect(p.parse("1Esd 1:1").osis()).toEqual("1Esd.1.1")
`
true
describe "Localized book 2Esd (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Esd (or)", ->
`
expect(p.parse("2Esd 1:1").osis()).toEqual("2Esd.1.1")
`
true
describe "Localized book Isa (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Isa (or)", ->
`
expect(p.parse("ଯିଶାଇୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯାଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯିଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯୀଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟିଶାୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("Isa 1:1").osis()).toEqual("Isa.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିଶାଇୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯାଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯିଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ଯୀଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟଶାଇୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ୟିଶାୟ 1:1").osis()).toEqual("Isa.1.1")
expect(p.parse("ISA 1:1").osis()).toEqual("Isa.1.1")
`
true
describe "Localized book 2Sam (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Sam (or)", ->
`
expect(p.parse("ଶାମୁୟେଲଙ୍କ ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2Sam 1:1").osis()).toEqual("2Sam.1.1")
p.include_apocrypha(false)
expect(p.parse("ଶାମୁୟେଲଙ୍କ ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2. ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2 ଶାମୁୟେଲ 1:1").osis()).toEqual("2Sam.1.1")
expect(p.parse("2SAM 1:1").osis()).toEqual("2Sam.1.1")
`
true
describe "Localized book 1Sam (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Sam (or)", ->
`
expect(p.parse("ଶାମୁୟେଲଙ୍କ ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1Sam 1:1").osis()).toEqual("1Sam.1.1")
p.include_apocrypha(false)
expect(p.parse("ଶାମୁୟେଲଙ୍କ ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("ପ୍ରଥମ ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲଙ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1. ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1 ଶାମୁୟେଲ 1:1").osis()).toEqual("1Sam.1.1")
expect(p.parse("1SAM 1:1").osis()).toEqual("1Sam.1.1")
`
true
describe "Localized book 2Kgs (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Kgs (or)", ->
`
expect(p.parse("ରାଜାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2Kgs 1:1").osis()).toEqual("2Kgs.1.1")
p.include_apocrypha(false)
expect(p.parse("ରାଜାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀର 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2. ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2 ରାଜାବଳୀ 1:1").osis()).toEqual("2Kgs.1.1")
expect(p.parse("2KGS 1:1").osis()).toEqual("2Kgs.1.1")
`
true
describe "Localized book 1Kgs (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Kgs (or)", ->
`
expect(p.parse("ରାଜାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1Kgs 1:1").osis()).toEqual("1Kgs.1.1")
p.include_apocrypha(false)
expect(p.parse("ରାଜାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("ପ୍ରଥମ ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀର 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1. ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1 ରାଜାବଳୀ 1:1").osis()).toEqual("1Kgs.1.1")
expect(p.parse("1KGS 1:1").osis()).toEqual("1Kgs.1.1")
`
true
describe "Localized book 2Chr (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Chr (or)", ->
`
expect(p.parse("ବଂଶାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2Chr 1:1").osis()).toEqual("2Chr.1.1")
p.include_apocrypha(false)
expect(p.parse("ବଂଶାବଳୀର ଦ୍ୱିତୀୟ ପୁସ୍ତକ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀର 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2. ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2 ବଂଶାବଳୀ 1:1").osis()).toEqual("2Chr.1.1")
expect(p.parse("2CHR 1:1").osis()).toEqual("2Chr.1.1")
`
true
describe "Localized book 1Chr (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Chr (or)", ->
`
expect(p.parse("ବଂଶାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1Chr 1:1").osis()).toEqual("1Chr.1.1")
p.include_apocrypha(false)
expect(p.parse("ବଂଶାବଳୀର ପ୍ରଥମ ପୁସ୍ତକ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("ପ୍ରଥମ ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀର 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1. ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1 ବଂଶାବଳୀ 1:1").osis()).toEqual("1Chr.1.1")
expect(p.parse("1CHR 1:1").osis()).toEqual("1Chr.1.1")
`
true
describe "Localized book Ezra (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ezra (or)", ->
`
expect(p.parse("ଏଜ୍ରା 1:1").osis()).toEqual("Ezra.1.1")
expect(p.parse("Ezra 1:1").osis()).toEqual("Ezra.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏଜ୍ରା 1:1").osis()).toEqual("Ezra.1.1")
expect(p.parse("EZRA 1:1").osis()).toEqual("Ezra.1.1")
`
true
describe "Localized book Neh (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Neh (or)", ->
`
expect(p.parse("ନିହିମିୟାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("ନିହିମିୟାଙ୍କର 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("Neh 1:1").osis()).toEqual("Neh.1.1")
p.include_apocrypha(false)
expect(p.parse("ନିହିମିୟାଙ୍କର ପୁସ୍ତକ 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("ନିହିମିୟାଙ୍କର 1:1").osis()).toEqual("Neh.1.1")
expect(p.parse("NEH 1:1").osis()).toEqual("Neh.1.1")
`
true
describe "Localized book GkEsth (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: GkEsth (or)", ->
`
expect(p.parse("GkEsth 1:1").osis()).toEqual("GkEsth.1.1")
`
true
describe "Localized book Esth (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Esth (or)", ->
`
expect(p.parse("ଏଷ୍ଟର ବିବରଣ 1:1").osis()).toEqual("Esth.1.1")
expect(p.parse("Esth 1:1").osis()).toEqual("Esth.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏଷ୍ଟର ବିବରଣ 1:1").osis()).toEqual("Esth.1.1")
expect(p.parse("ESTH 1:1").osis()).toEqual("Esth.1.1")
`
true
describe "Localized book Job (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Job (or)", ->
`
expect(p.parse("ଆୟୁବ ପୁସ୍ତକ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("ଆୟୁବ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("Job 1:1").osis()).toEqual("Job.1.1")
p.include_apocrypha(false)
expect(p.parse("ଆୟୁବ ପୁସ୍ତକ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("ଆୟୁବ 1:1").osis()).toEqual("Job.1.1")
expect(p.parse("JOB 1:1").osis()).toEqual("Job.1.1")
`
true
describe "Localized book Ps (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ps (or)", ->
`
expect(p.parse("ଗୀତିସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗାତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗୀତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("Ps 1:1").osis()).toEqual("Ps.1.1")
p.include_apocrypha(false)
expect(p.parse("ଗୀତିସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗାତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("ଗୀତସଂହିତା 1:1").osis()).toEqual("Ps.1.1")
expect(p.parse("PS 1:1").osis()).toEqual("Ps.1.1")
`
true
describe "Localized book PrAzar (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PrAzar (or)", ->
`
expect(p.parse("PrAzar 1:1").osis()).toEqual("PrAzar.1.1")
`
true
describe "Localized book Prov (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Prov (or)", ->
`
expect(p.parse("ହିତୋପଦେଶ 1:1").osis()).toEqual("Prov.1.1")
expect(p.parse("Prov 1:1").osis()).toEqual("Prov.1.1")
p.include_apocrypha(false)
expect(p.parse("ହିତୋପଦେଶ 1:1").osis()).toEqual("Prov.1.1")
expect(p.parse("PROV 1:1").osis()).toEqual("Prov.1.1")
`
true
describe "Localized book Eccl (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Eccl (or)", ->
`
expect(p.parse("ଉପଦେଶକ 1:1").osis()).toEqual("Eccl.1.1")
expect(p.parse("Eccl 1:1").osis()).toEqual("Eccl.1.1")
p.include_apocrypha(false)
expect(p.parse("ଉପଦେଶକ 1:1").osis()).toEqual("Eccl.1.1")
expect(p.parse("ECCL 1:1").osis()).toEqual("Eccl.1.1")
`
true
describe "Localized book SgThree (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: SgThree (or)", ->
`
expect(p.parse("SgThree 1:1").osis()).toEqual("SgThree.1.1")
`
true
describe "Localized book Song (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Song (or)", ->
`
expect(p.parse("ପରମଗୀତ 1:1").osis()).toEqual("Song.1.1")
expect(p.parse("Song 1:1").osis()).toEqual("Song.1.1")
p.include_apocrypha(false)
expect(p.parse("ପରମଗୀତ 1:1").osis()).toEqual("Song.1.1")
expect(p.parse("SONG 1:1").osis()).toEqual("Song.1.1")
`
true
describe "Localized book Jer (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Jer (or)", ->
`
expect(p.parse("ଯିରିମିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("ଯିରିମିୟ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("Jer 1:1").osis()).toEqual("Jer.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିରିମିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("ଯିରିମିୟ 1:1").osis()).toEqual("Jer.1.1")
expect(p.parse("JER 1:1").osis()).toEqual("Jer.1.1")
`
true
describe "Localized book Ezek (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Ezek (or)", ->
`
expect(p.parse("ଯିହିଜିକଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("ଯିହିଜିକଲ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("Ezek 1:1").osis()).toEqual("Ezek.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିହିଜିକଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("ଯିହିଜିକଲ 1:1").osis()).toEqual("Ezek.1.1")
expect(p.parse("EZEK 1:1").osis()).toEqual("Ezek.1.1")
`
true
describe "Localized book Dan (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Dan (or)", ->
`
expect(p.parse("ଦାନିୟେଲଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("ଦାନିୟେଲଙ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("Dan 1:1").osis()).toEqual("Dan.1.1")
p.include_apocrypha(false)
expect(p.parse("ଦାନିୟେଲଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("ଦାନିୟେଲଙ 1:1").osis()).toEqual("Dan.1.1")
expect(p.parse("DAN 1:1").osis()).toEqual("Dan.1.1")
`
true
describe "Localized book Hos (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Hos (or)", ->
`
expect(p.parse("ହୋଶେୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶହେ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶେୟ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("Hos 1:1").osis()).toEqual("Hos.1.1")
p.include_apocrypha(false)
expect(p.parse("ହୋଶେୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶହେ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("ହୋଶେୟ 1:1").osis()).toEqual("Hos.1.1")
expect(p.parse("HOS 1:1").osis()).toEqual("Hos.1.1")
`
true
describe "Localized book PI:NAME:<NAME>END_PIel (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PI:NAME:<NAME>END_PI (or)", ->
`
expect(p.parse("ଯୋୟେଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("ଯୋୟେଲ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("Joel 1:1").osis()).toEqual("Joel.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋୟେଲ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("ଯୋୟେଲ 1:1").osis()).toEqual("Joel.1.1")
expect(p.parse("JOEL 1:1").osis()).toEqual("Joel.1.1")
`
true
describe "Localized book Amos (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Amos (or)", ->
`
expect(p.parse("ଆମୋଷ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("Amos 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("ଆମୋଷ 1:1").osis()).toEqual("Amos.1.1")
p.include_apocrypha(false)
expect(p.parse("ଆମୋଷ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("AMOS 1:1").osis()).toEqual("Amos.1.1")
expect(p.parse("ଆମୋଷ 1:1").osis()).toEqual("Amos.1.1")
`
true
describe "Localized book Obad (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Obad (or)", ->
`
expect(p.parse("ଓବଦିଅ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("ଓବଦିଅ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("Obad 1:1").osis()).toEqual("Obad.1.1")
p.include_apocrypha(false)
expect(p.parse("ଓବଦିଅ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("ଓବଦିଅ 1:1").osis()).toEqual("Obad.1.1")
expect(p.parse("OBAD 1:1").osis()).toEqual("Obad.1.1")
`
true
describe "Localized book PI:NAME:<NAME>END_PIah (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PI:NAME:<NAME>END_PIah (or)", ->
`
expect(p.parse("ଯୂନସ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("Jonah 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("ଯୂନସ 1:1").osis()).toEqual("Jonah.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୂନସ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("JONAH 1:1").osis()).toEqual("Jonah.1.1")
expect(p.parse("ଯୂନସ 1:1").osis()).toEqual("Jonah.1.1")
`
true
describe "Localized book PI:NAME:<NAME>END_PIic (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Mic (or)", ->
`
expect(p.parse("ମୀଖା ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମିଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମୀଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("Mic 1:1").osis()).toEqual("Mic.1.1")
p.include_apocrypha(false)
expect(p.parse("ମୀଖା ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମିଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("ମୀଖା 1:1").osis()).toEqual("Mic.1.1")
expect(p.parse("MIC 1:1").osis()).toEqual("Mic.1.1")
`
true
describe "Localized book Nah (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Nah (or)", ->
`
expect(p.parse("ନାହୂମ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("ନାହୂମ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("Nah 1:1").osis()).toEqual("Nah.1.1")
p.include_apocrypha(false)
expect(p.parse("ନାହୂମ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("ନାହୂମ 1:1").osis()).toEqual("Nah.1.1")
expect(p.parse("NAH 1:1").osis()).toEqual("Nah.1.1")
`
true
describe "Localized book Hab (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Hab (or)", ->
`
expect(p.parse("ହବକ୍କୂକ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକ୍କୂକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୁକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୂକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("Hab 1:1").osis()).toEqual("Hab.1.1")
p.include_apocrypha(false)
expect(p.parse("ହବକ୍କୂକ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକ୍କୂକ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୁକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("ହବକୂକ୍ 1:1").osis()).toEqual("Hab.1.1")
expect(p.parse("HAB 1:1").osis()).toEqual("Hab.1.1")
`
true
describe "Localized book Zeph (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Zeph (or)", ->
`
expect(p.parse("ସିଫନିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("ସିଫନିୟ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("Zeph 1:1").osis()).toEqual("Zeph.1.1")
p.include_apocrypha(false)
expect(p.parse("ସିଫନିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("ସିଫନିୟ 1:1").osis()).toEqual("Zeph.1.1")
expect(p.parse("ZEPH 1:1").osis()).toEqual("Zeph.1.1")
`
true
describe "Localized book Hag (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Hag (or)", ->
`
expect(p.parse("ହାଗୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("ହାଗୟ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("Hag 1:1").osis()).toEqual("Hag.1.1")
p.include_apocrypha(false)
expect(p.parse("ହାଗୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("ହାଗୟ 1:1").osis()).toEqual("Hag.1.1")
expect(p.parse("HAG 1:1").osis()).toEqual("Hag.1.1")
`
true
describe "Localized book Zech (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Zech (or)", ->
`
expect(p.parse("ଯିଖରିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("ଯିଖରିୟ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("Zech 1:1").osis()).toEqual("Zech.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିଖରିୟ ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("ଯିଖରିୟ 1:1").osis()).toEqual("Zech.1.1")
expect(p.parse("ZECH 1:1").osis()).toEqual("Zech.1.1")
`
true
describe "Localized book Mal (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Mal (or)", ->
`
expect(p.parse("ମଲାଖି ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("ମଲାଖି 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("Mal 1:1").osis()).toEqual("Mal.1.1")
p.include_apocrypha(false)
expect(p.parse("ମଲାଖି ଭବିଷ୍ୟଦ୍ବକ୍ତାଙ୍କ ପୁସ୍ତକ 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("ମଲାଖି 1:1").osis()).toEqual("Mal.1.1")
expect(p.parse("MAL 1:1").osis()).toEqual("Mal.1.1")
`
true
describe "Localized book Matt (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PI:NAME:<NAME>END_PI (or)", ->
`
expect(p.parse("ମାଥିଉ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("ମାଥିଉ 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("Matt 1:1").osis()).toEqual("Matt.1.1")
p.include_apocrypha(false)
expect(p.parse("ମାଥିଉ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("ମାଥିଉ 1:1").osis()).toEqual("Matt.1.1")
expect(p.parse("MATT 1:1").osis()).toEqual("Matt.1.1")
`
true
describe "Localized book Mark (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Mark (or)", ->
`
expect(p.parse("ମାର୍କ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("ମାର୍କ 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("Mark 1:1").osis()).toEqual("Mark.1.1")
p.include_apocrypha(false)
expect(p.parse("ମାର୍କ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("ମାର୍କ 1:1").osis()).toEqual("Mark.1.1")
expect(p.parse("MARK 1:1").osis()).toEqual("Mark.1.1")
`
true
describe "Localized book Luke (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Luke (or)", ->
`
expect(p.parse("ଲୂକ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("Luke 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("ଲୂକ 1:1").osis()).toEqual("Luke.1.1")
p.include_apocrypha(false)
expect(p.parse("ଲୂକ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("LUKE 1:1").osis()).toEqual("Luke.1.1")
expect(p.parse("ଲୂକ 1:1").osis()).toEqual("Luke.1.1")
`
true
describe "Localized book 1John (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1John (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("ପ୍ରଥମ ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1. ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1 ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1John 1:1").osis()).toEqual("1John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("ପ୍ରଥମ ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1. ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1 ଯୋହନଙ 1:1").osis()).toEqual("1John.1.1")
expect(p.parse("1JOHN 1:1").osis()).toEqual("1John.1.1")
`
true
describe "Localized book PI:NAME:<NAME>END_PIJohn (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PI:NAME:<NAME>END_PI (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2. ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2 ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2John 1:1").osis()).toEqual("2John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2. ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2 ଯୋହନଙ 1:1").osis()).toEqual("2John.1.1")
expect(p.parse("2JOHN 1:1").osis()).toEqual("2John.1.1")
`
true
describe "Localized book 3John (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 3John (or)", ->
`
expect(p.parse("ଯୋହନଙ୍କ ତୃତୀୟ ପତ୍ର 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("ତୃତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3. ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3 ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3John 1:1").osis()).toEqual("3John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନଙ୍କ ତୃତୀୟ ପତ୍ର 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("ତୃତୀୟ ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3. ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3 ଯୋହନଙ 1:1").osis()).toEqual("3John.1.1")
expect(p.parse("3JOHN 1:1").osis()).toEqual("3John.1.1")
`
true
describe "Localized book PI:NAME:<NAME>END_PI (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PI:NAME:<NAME>END_PI (or)", ->
`
expect(p.parse("ଯୋହନ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("John.1.1")
expect(p.parse("PI:NAME:<NAME>END_PI 1:1").osis()).toEqual("John.1.1")
expect(p.parse("ଯୋହନ 1:1").osis()).toEqual("John.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯୋହନ ଲିଖିତ ସୁସମାଗ୍ଭର 1:1").osis()).toEqual("John.1.1")
expect(p.parse("PI:NAME:<NAME>END_PI 1:1").osis()).toEqual("John.1.1")
expect(p.parse("ଯୋହନ 1:1").osis()).toEqual("John.1.1")
`
true
describe "Localized book Acts (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Acts (or)", ->
`
expect(p.parse("ପ୍ରେରିତମାନଙ୍କ କାର୍ଯ୍ୟର ବିବରଣ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("ପ୍ରେରିତ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("Acts 1:1").osis()).toEqual("Acts.1.1")
p.include_apocrypha(false)
expect(p.parse("ପ୍ରେରିତମାନଙ୍କ କାର୍ଯ୍ୟର ବିବରଣ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("ପ୍ରେରିତ 1:1").osis()).toEqual("Acts.1.1")
expect(p.parse("ACTS 1:1").osis()).toEqual("Acts.1.1")
`
true
describe "Localized book Rom (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Rom (or)", ->
`
expect(p.parse("ରୋମୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("ରୋମୀୟଙ୍କ 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("Rom 1:1").osis()).toEqual("Rom.1.1")
p.include_apocrypha(false)
expect(p.parse("ରୋମୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("ରୋମୀୟଙ୍କ 1:1").osis()).toEqual("Rom.1.1")
expect(p.parse("ROM 1:1").osis()).toEqual("Rom.1.1")
`
true
describe "Localized book 2Cor (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Cor (or)", ->
`
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2Cor 1:1").osis()).toEqual("2Cor.1.1")
p.include_apocrypha(false)
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("2Cor.1.1")
expect(p.parse("2COR 1:1").osis()).toEqual("2Cor.1.1")
`
true
describe "Localized book 1Cor (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Cor (or)", ->
`
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1Cor 1:1").osis()).toEqual("1Cor.1.1")
p.include_apocrypha(false)
expect(p.parse("କରିନ୍ଥୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("ପ୍ରଥମ କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟଙ୍କ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1. କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1 କରିନ୍ଥୀୟ 1:1").osis()).toEqual("1Cor.1.1")
expect(p.parse("1COR 1:1").osis()).toEqual("1Cor.1.1")
`
true
describe "Localized book Gal (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Gal (or)", ->
`
expect(p.parse("ଗାଲାତୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("ଗାଲାତୀୟଙ୍କ 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("Gal 1:1").osis()).toEqual("Gal.1.1")
p.include_apocrypha(false)
expect(p.parse("ଗାଲାତୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("ଗାଲାତୀୟଙ୍କ 1:1").osis()).toEqual("Gal.1.1")
expect(p.parse("GAL 1:1").osis()).toEqual("Gal.1.1")
`
true
describe "Localized book Eph (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Eph (or)", ->
`
expect(p.parse("ଏଫିସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("ଏଫିସୀୟଙ୍କ 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("Eph 1:1").osis()).toEqual("Eph.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏଫିସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("ଏଫିସୀୟଙ୍କ 1:1").osis()).toEqual("Eph.1.1")
expect(p.parse("EPH 1:1").osis()).toEqual("Eph.1.1")
`
true
describe "Localized book Phil (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Phil (or)", ->
`
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("Phil 1:1").osis()).toEqual("Phil.1.1")
p.include_apocrypha(false)
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("ଫିଲିପ୍ପୀୟଙ୍କ 1:1").osis()).toEqual("Phil.1.1")
expect(p.parse("PHIL 1:1").osis()).toEqual("Phil.1.1")
`
true
describe "Localized book Col (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Col (or)", ->
`
expect(p.parse("କଲସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("କଲସୀୟଙ୍କ 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("Col 1:1").osis()).toEqual("Col.1.1")
p.include_apocrypha(false)
expect(p.parse("କଲସୀୟଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("କଲସୀୟଙ୍କ 1:1").osis()).toEqual("Col.1.1")
expect(p.parse("COL 1:1").osis()).toEqual("Col.1.1")
`
true
describe "Localized book 2Thess (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Thess (or)", ->
`
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2Thess 1:1").osis()).toEqual("2Thess.1.1")
p.include_apocrypha(false)
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("2Thess.1.1")
expect(p.parse("2THESS 1:1").osis()).toEqual("2Thess.1.1")
`
true
describe "Localized book 1Thess (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Thess (or)", ->
`
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("ପ୍ରଥମ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1Thess 1:1").osis()).toEqual("1Thess.1.1")
p.include_apocrypha(false)
expect(p.parse("ଥେସଲନୀକୀୟଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("ପ୍ରଥମ ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1. ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1 ଥେସଲନୀକୀୟଙ 1:1").osis()).toEqual("1Thess.1.1")
expect(p.parse("1THESS 1:1").osis()).toEqual("1Thess.1.1")
`
true
describe "Localized book 2Tim (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Tim (or)", ->
`
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2Tim 1:1").osis()).toEqual("2Tim.1.1")
p.include_apocrypha(false)
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("2Tim.1.1")
expect(p.parse("2TIM 1:1").osis()).toEqual("2Tim.1.1")
`
true
describe "Localized book 1Tim (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Tim (or)", ->
`
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("ପ୍ରଥମ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1Tim 1:1").osis()).toEqual("1Tim.1.1")
p.include_apocrypha(false)
expect(p.parse("ତୀମଥିଙ୍କ ପ୍ରତି ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("ପ୍ରଥମ ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1. ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1 ତୀମଥିଙ୍କ 1:1").osis()).toEqual("1Tim.1.1")
expect(p.parse("1TIM 1:1").osis()).toEqual("1Tim.1.1")
`
true
describe "Localized book Titus (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Titus (or)", ->
`
expect(p.parse("ତୀତସଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("ତୀତସଙ୍କ 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("Titus 1:1").osis()).toEqual("Titus.1.1")
p.include_apocrypha(false)
expect(p.parse("ତୀତସଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("ତୀତସଙ୍କ 1:1").osis()).toEqual("Titus.1.1")
expect(p.parse("TITUS 1:1").osis()).toEqual("Titus.1.1")
`
true
describe "Localized book Phlm (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Phlm (or)", ->
`
expect(p.parse("ଫିଲୀମୋନଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("ଫିଲୀମୋନଙ୍କ 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("Phlm 1:1").osis()).toEqual("Phlm.1.1")
p.include_apocrypha(false)
expect(p.parse("ଫିଲୀମୋନଙ୍କ ପ୍ରତି ପତ୍ର 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("ଫିଲୀମୋନଙ୍କ 1:1").osis()).toEqual("Phlm.1.1")
expect(p.parse("PHLM 1:1").osis()).toEqual("Phlm.1.1")
`
true
describe "Localized book Heb (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Heb (or)", ->
`
expect(p.parse("ଏବ୍ରୀ 1:1").osis()).toEqual("Heb.1.1")
expect(p.parse("Heb 1:1").osis()).toEqual("Heb.1.1")
p.include_apocrypha(false)
expect(p.parse("ଏବ୍ରୀ 1:1").osis()).toEqual("Heb.1.1")
expect(p.parse("HEB 1:1").osis()).toEqual("Heb.1.1")
`
true
describe "Localized book Jas (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Jas (or)", ->
`
expect(p.parse("ଯାକୁବଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("ଯାକୁବଙ୍କ 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("Jas 1:1").osis()).toEqual("Jas.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯାକୁବଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("ଯାକୁବଙ୍କ 1:1").osis()).toEqual("Jas.1.1")
expect(p.parse("JAS 1:1").osis()).toEqual("Jas.1.1")
`
true
describe "Localized book 2Pet (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Pet (or)", ->
`
expect(p.parse("ପିତରଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2. ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2 ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2Pet 1:1").osis()).toEqual("2Pet.1.1")
p.include_apocrypha(false)
expect(p.parse("ପିତରଙ୍କ ଦ୍ୱିତୀୟ ପତ୍ର 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("ଦ୍ୱିତୀୟ ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2. ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2 ପିତରଙ 1:1").osis()).toEqual("2Pet.1.1")
expect(p.parse("2PET 1:1").osis()).toEqual("2Pet.1.1")
`
true
describe "Localized book 1Pet (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Pet (or)", ->
`
expect(p.parse("ପିତରଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("ପ୍ରଥମ ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1. ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1 ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1Pet 1:1").osis()).toEqual("1Pet.1.1")
p.include_apocrypha(false)
expect(p.parse("ପିତରଙ୍କ ପ୍ରଥମ ପତ୍ର 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("ପ୍ରଥମ ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1. ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1 ପିତରଙ 1:1").osis()).toEqual("1Pet.1.1")
expect(p.parse("1PET 1:1").osis()).toEqual("1Pet.1.1")
`
true
describe "Localized book PI:NAME:<NAME>END_PIude (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: PI:NAME:<NAME>END_PIude (or)", ->
`
expect(p.parse("ଯିହୂଦାଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("ଯିହୂଦାଙ୍କ 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("Jude 1:1").osis()).toEqual("Jude.1.1")
p.include_apocrypha(false)
expect(p.parse("ଯିହୂଦାଙ୍କ ପତ୍ର 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("ଯିହୂଦାଙ୍କ 1:1").osis()).toEqual("Jude.1.1")
expect(p.parse("JUDE 1:1").osis()).toEqual("Jude.1.1")
`
true
describe "Localized book Tob (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Tob (or)", ->
`
expect(p.parse("Tob 1:1").osis()).toEqual("Tob.1.1")
`
true
describe "Localized book Jdt (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Jdt (or)", ->
`
expect(p.parse("Jdt 1:1").osis()).toEqual("Jdt.1.1")
`
true
describe "Localized book Bar (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Bar (or)", ->
`
expect(p.parse("Bar 1:1").osis()).toEqual("Bar.1.1")
`
true
describe "Localized book Sus (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: Sus (or)", ->
`
expect(p.parse("Sus 1:1").osis()).toEqual("Sus.1.1")
`
true
describe "Localized book 2Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 2Macc (or)", ->
`
expect(p.parse("2Macc 1:1").osis()).toEqual("2Macc.1.1")
`
true
describe "Localized book 3Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 3Macc (or)", ->
`
expect(p.parse("3Macc 1:1").osis()).toEqual("3Macc.1.1")
`
true
describe "Localized book 4Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 4Macc (or)", ->
`
expect(p.parse("4Macc 1:1").osis()).toEqual("4Macc.1.1")
`
true
describe "Localized book 1Macc (or)", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore",book_sequence_strategy: "ignore",osis_compaction_strategy: "bc",captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should handle book: 1Macc (or)", ->
`
expect(p.parse("1Macc 1:1").osis()).toEqual("1Macc.1.1")
`
true
describe "Miscellaneous tests", ->
p = {}
beforeEach ->
p = new bcv_parser
p.set_options book_alone_strategy: "ignore", book_sequence_strategy: "ignore", osis_compaction_strategy: "bc", captive_end_digits_strategy: "delete"
p.include_apocrypha true
it "should return the expected language", ->
expect(p.languages).toEqual ["or"]
it "should handle ranges (or)", ->
expect(p.parse("Titus 1:1 ଠାରୁ 2").osis()).toEqual "Titus.1.1-Titus.1.2"
expect(p.parse("Matt 1ଠାରୁ2").osis()).toEqual "Matt.1-Matt.2"
expect(p.parse("Phlm 2 ଠାରୁ 3").osis()).toEqual "Phlm.1.2-Phlm.1.3"
it "should handle chapters (or)", ->
expect(p.parse("Titus 1:1, chapter 2").osis()).toEqual "Titus.1.1,Titus.2"
expect(p.parse("Matt 3:4 CHAPTER 6").osis()).toEqual "Matt.3.4,Matt.6"
it "should handle verses (or)", ->
expect(p.parse("Exod 1:1 verse 3").osis()).toEqual "Exod.1.1,Exod.1.3"
expect(p.parse("Phlm VERSE 6").osis()).toEqual "Phlm.1.6"
it "should handle 'and' (or)", ->
expect(p.parse("Exod 1:1 and 3").osis()).toEqual "Exod.1.1,Exod.1.3"
expect(p.parse("Phlm 2 AND 6").osis()).toEqual "Phlm.1.2,Phlm.1.6"
it "should handle titles (or)", ->
expect(p.parse("Ps 3 title, 4:2, 5:title").osis()).toEqual "Ps.3.1,Ps.4.2,Ps.5.1"
expect(p.parse("PS 3 TITLE, 4:2, 5:TITLE").osis()).toEqual "Ps.3.1,Ps.4.2,Ps.5.1"
it "should handle 'ff' (or)", ->
expect(p.parse("Rev 3ff, 4:2ff").osis()).toEqual "Rev.3-Rev.22,Rev.4.2-Rev.4.11"
expect(p.parse("REV 3 FF, 4:2 FF").osis()).toEqual "Rev.3-Rev.22,Rev.4.2-Rev.4.11"
it "should handle translations (or)", ->
expect(p.parse("Lev 1 (ERV)").osis_and_translations()).toEqual [["Lev.1", "ERV"]]
expect(p.parse("lev 1 erv").osis_and_translations()).toEqual [["Lev.1", "ERV"]]
it "should handle book ranges (or)", ->
p.set_options {book_alone_strategy: "full", book_range_strategy: "include"}
expect(p.parse("ପ୍ରଥମ ଠାରୁ ତୃତୀୟ ଯୋହନଙ").osis()).toEqual "1John.1-3John.1"
it "should handle boundaries (or)", ->
p.set_options {book_alone_strategy: "full"}
expect(p.parse("\u2014Matt\u2014").osis()).toEqual "Matt.1-Matt.28"
expect(p.parse("\u201cMatt 1:1\u201d").osis()).toEqual "Matt.1.1"
|
[
{
"context": " table.addColumn('age')\n\n table.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n ",
"end": 662,
"score": 0.9998606443405151,
"start": 654,
"tag": "NAME",
"value": "John Doe"
},
{
"context": "ble.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n table.destroy()\n\n it 'clears its",
"end": 699,
"score": 0.9998722076416016,
"start": 691,
"tag": "NAME",
"value": "Jane Doe"
},
{
"context": " table.addColumn('age')\n\n table.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n ",
"end": 2493,
"score": 0.999863862991333,
"start": 2485,
"tag": "NAME",
"value": "John Doe"
},
{
"context": "e.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n expect(table.isModified()).toBeTr",
"end": 2532,
"score": 0.9998769164085388,
"start": 2524,
"tag": "NAME",
"value": "Jane Doe"
},
{
"context": " table.addColumn('age')\n\n table.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n ",
"end": 22137,
"score": 0.9997689723968506,
"start": 22129,
"tag": "NAME",
"value": "John Doe"
},
{
"context": "ble.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n it 'returns the cell at the given pos",
"end": 22174,
"score": 0.9973964691162109,
"start": 22166,
"tag": "NAME",
"value": "Jane Doe"
},
{
"context": " expect(table.getValueAtPosition([1,0])).toEqual('Jane Doe')\n\n it 'returns the cell at the given position",
"end": 22304,
"score": 0.9430730938911438,
"start": 22296,
"tag": "NAME",
"value": "Jane Doe"
},
{
"context": "e.getValueAtPosition(row: 1, column: 0)).toEqual('Jane Doe')\n\n it 'throws an error without a position', -",
"end": 22442,
"score": 0.9503529667854309,
"start": 22434,
"tag": "NAME",
"value": "Jane Doe"
},
{
"context": " table.addColumn('age')\n\n table.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n ",
"end": 22904,
"score": 0.9997745156288147,
"start": 22896,
"tag": "NAME",
"value": "John Doe"
},
{
"context": "ble.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n it 'changes the value at the given po",
"end": 22941,
"score": 0.9997506141662598,
"start": 22933,
"tag": "NAME",
"value": "Jane Doe"
},
{
"context": ",1], 40)\n\n expect(table.getRow(1)).toEqual(['Jane Doe', 40])\n\n it 'emits a did-change-cell-value eve",
"end": 23094,
"score": 0.9978258609771729,
"start": 23086,
"tag": "NAME",
"value": "Jane Doe"
},
{
"context": " table.addColumn('age')\n\n table.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n ",
"end": 23676,
"score": 0.999791145324707,
"start": 23668,
"tag": "NAME",
"value": "John Doe"
},
{
"context": "ble.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n it 'changes the value at the given po",
"end": 23713,
"score": 0.9994313716888428,
"start": 23705,
"tag": "NAME",
"value": "Jane Doe"
},
{
"context": "40, 40])\n\n expect(table.getRow(0)).toEqual(['John Doe', 40])\n expect(table.getRow(1)).toEqual(['Ja",
"end": 23882,
"score": 0.9995210766792297,
"start": 23874,
"tag": "NAME",
"value": "John Doe"
},
{
"context": "oe', 40])\n expect(table.getRow(1)).toEqual(['Jane Doe', 40])\n\n it 'emits a did-change-cell-value eve",
"end": 23938,
"score": 0.9977644085884094,
"start": 23930,
"tag": "NAME",
"value": "Jane Doe"
},
{
"context": " table.addColumn('age')\n\n table.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n ",
"end": 24548,
"score": 0.9998810291290283,
"start": 24540,
"tag": "NAME",
"value": "John Doe"
},
{
"context": "ble.addRow(['John Doe', 30])\n table.addRow(['Jane Doe', 30])\n\n it 'changes the value at the given po",
"end": 24585,
"score": 0.9998743534088135,
"start": 24577,
"tag": "NAME",
"value": "Jane Doe"
},
{
"context": ", [40]])\n\n expect(table.getRow(0)).toEqual(['John Doe', 40])\n expect(table.getRow(1)).toEqual(['Ja",
"end": 24754,
"score": 0.9998749494552612,
"start": 24746,
"tag": "NAME",
"value": "John Doe"
},
{
"context": "oe', 40])\n expect(table.getRow(1)).toEqual(['Jane Doe', 40])\n\n it 'emits a did-change-cell-value eve",
"end": 24810,
"score": 0.999873697757721,
"start": 24802,
"tag": "NAME",
"value": "Jane Doe"
}
] | spec/table-spec.coffee | alorlov/SmartCSV | 0 | require './helpers/spec-helper'
{Point} = require 'atom'
Table = require '../lib/table'
describe 'Table', ->
[table, row, column, spy] = []
beforeEach ->
table = new Table
it 'has 0 columns', ->
expect(table.getColumnCount()).toEqual(0)
it 'has 0 rows', ->
expect(table.getRowCount()).toEqual(0)
it 'has 0 cells', ->
expect(table.getCellCount()).toEqual(0)
describe 'adding a row on a table without columns', ->
it 'raises an exception', ->
expect(-> table.addRow {}).toThrow()
describe 'when destroyed', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['John Doe', 30])
table.addRow(['Jane Doe', 30])
table.destroy()
it 'clears its content', ->
expect(table.getRowCount()).toEqual(0)
expect(table.getColumnCount()).toEqual(0)
it 'throws an error when adding a row', ->
expect(-> table.addRow(['foo'])).toThrow()
expect(-> table.addRows([['foo']])).toThrow()
it 'throws an error when adding a column', ->
expect(-> table.addColumn('foo')).toThrow()
describe '::retain', ->
it 'increments the reference count', ->
expect(table.refcount).toEqual(0)
table.retain()
expect(table.refcount).toEqual(1)
expect(table.isRetained()).toBeTruthy()
table.retain()
expect(table.refcount).toEqual(2)
describe '::release', ->
it 'decrements the reference count', ->
table.retain()
table.retain()
table.release()
expect(table.refcount).toEqual(1)
expect(table.isRetained()).toBeTruthy()
table.release()
expect(table.refcount).toEqual(0)
expect(table.isRetained()).toBeFalsy()
it 'destroys the table when the refcount drop to 0', ->
spy = jasmine.createSpy('did-destroy')
table.onDidDestroy(spy)
table.retain()
table.retain()
table.release()
table.release()
expect(spy).toHaveBeenCalled()
expect(table.isDestroyed()).toBeTruthy()
# ###### ### ## ## ########
# ## ## ## ## ## ## ##
# ## ## ## ## ## ##
# ###### ## ## ## ## ######
# ## ######### ## ## ##
# ## ## ## ## ## ## ##
# ###### ## ## ### ########
describe '::save', ->
describe 'when modified', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['John Doe', 30])
table.addRow(['Jane Doe', 30])
expect(table.isModified()).toBeTruthy()
it 'is marked as saved', ->
table.save()
expect(table.isModified()).toBeFalsy()
describe 'with a synchronous save handler', ->
it 'calls the handler on save', ->
calls = []
table.addColumn('age')
table.setSaveHandler -> calls.push 'save'
table.onDidSave -> calls.push 'did-save'
table.save()
expect(calls).toEqual(['save', 'did-save'])
it 'marks the table as saved if the handler returned true', ->
table.addColumn('age')
table.setSaveHandler -> true
table.save()
expect(table.isModified()).toBeFalsy()
it 'leaves the table as modified if the handler returned false', ->
table.addColumn('age')
table.setSaveHandler -> false
table.save()
expect(table.isModified()).toBeTruthy()
describe 'when not modified', ->
it 'does nothing', ->
calls = []
table.setSaveHandler -> calls.push 'save'
table.onDidSave -> calls.push 'did-save'
table.save()
expect(calls).toEqual([])
describe 'with an asynchronous save handler', ->
promise = null
it 'calls the handler on save', ->
calls = []
table.addColumn('age')
table.setSaveHandler -> promise = new Promise (resolve) ->
calls.push('save')
resolve()
table.onDidSave -> calls.push 'did-save'
table.save()
waitsForPromise -> promise
runs -> expect(calls).toEqual(['save', 'did-save'])
it 'marks the table as saved if the handler resolve the promise', ->
table.addColumn('age')
table.setSaveHandler -> promise = new Promise (resolve) -> resolve()
table.save()
waitsForPromise -> promise
runs -> expect(table.isModified()).toBeFalsy()
it 'leaves the table as modified if the handler reject the promise', ->
table.addColumn('age')
table.setSaveHandler ->
promise = new Promise (resolve, reject) -> reject()
table.save()
waitsForPromise shouldReject: true, -> promise
runs -> expect(table.isModified()).toBeTruthy()
# ######## ######## ###### ######## ####### ######## ########
# ## ## ## ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ## ## ##
# ######## ###### ###### ## ## ## ######## ######
# ## ## ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ## ## ## ##
# ## ## ######## ###### ## ####### ## ## ########
describe '::serialize', ->
it 'serializes the empty table', ->
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: []
rows: []
id: table.id
})
it 'serializes the table with its empty rows and columns', ->
table.addColumn()
table.addColumn()
table.addRow()
table.addRow()
table.save()
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: [undefined, undefined]
rows: [
[undefined, undefined]
[undefined, undefined]
]
id: table.id
})
it 'serializes the table with its values', ->
table.addColumn('foo')
table.addColumn('bar')
table.addRow([1,2])
table.addRow([3,4])
table.save()
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: ['foo', 'bar']
rows: [
[1,2]
[3,4]
]
id: table.id
})
it 'serializes the table in its modified state', ->
table.addColumn('foo')
table.addColumn('bar')
table.addRow([1,2])
table.addRow([3,4])
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: ['foo', 'bar']
modified: true
cachedContents: undefined
rows: [
[1,2]
[3,4]
]
id: table.id
})
describe '.deserialize', ->
it 'deserialize a table', ->
table = atom.deserializers.deserialize({
deserializer: 'Table'
columns: ['foo', 'bar']
rows: [
[1,2]
[3,4]
]
id: 1
})
expect(table.id).toEqual(1)
expect(table.getColumns()).toEqual(['foo','bar'])
expect(table.getRows()).toEqual([
[1,2]
[3,4]
])
expect(table.isModified()).toBeFalsy()
it 'deserialize a table in a modified state', ->
table = atom.deserializers.deserialize({
deserializer: 'Table'
columns: ['foo', 'bar']
modified: true
cachedContents: undefined
rows: [
[1,2]
[3,4]
]
id: 1
})
expect(table.getColumns()).toEqual(['foo','bar'])
expect(table.getRows()).toEqual([
[1,2]
[3,4]
])
expect(table.isModified()).toBeTruthy()
# ###### ####### ## ## ## ## ## ## ## ######
# ## ## ## ## ## ## ## ### ### ### ## ## ##
# ## ## ## ## ## ## #### #### #### ## ##
# ## ## ## ## ## ## ## ### ## ## ## ## ######
# ## ## ## ## ## ## ## ## ## #### ##
# ## ## ## ## ## ## ## ## ## ## ### ## ##
# ###### ####### ######## ####### ## ## ## ## ######
describe 'with columns added to the table', ->
beforeEach ->
table.addColumn('key')
table.addColumn('value')
it 'has 2 columns', ->
expect(table.getColumnCount()).toEqual(2)
expect(table.getColumn(0)).toEqual('key')
expect(table.getColumn(1)).toEqual('value')
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe 'when adding a column whose name already exist in table', ->
it 'does not raise an exception', ->
expect(-> table.addColumn('key')).not.toThrow()
describe 'when adding a column whose name is undefined', ->
it 'does not raise an exception', ->
expect(-> table.addColumn('key')).not.toThrow()
describe 'when there is already rows in the table', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
describe 'adding a column', ->
it 'extend all the rows with a new cell', ->
table.addColumn 'required'
expect(table.getRow(0).length).toEqual(3)
it 'dispatches a did-add-column event', ->
spy = jasmine.createSpy 'addColumn'
table.onDidAddColumn spy
table.addColumn 'required'
expect(spy).toHaveBeenCalled()
describe 'adding a column at a given index', ->
beforeEach ->
column = table.addColumnAt 1, 'required'
it 'adds the column at the right place', ->
expect(table.getColumnCount()).toEqual(3)
expect(table.getColumn(1)).toEqual('required')
expect(table.getColumn(2)).toEqual('value')
it 'extend the existing rows at the right place', ->
expect(table.getRow(0).length).toEqual(3)
expect(table.getRow(1).length).toEqual(3)
it 'throws an error if the index is negative', ->
expect(-> table.addColumnAt -1, 'foo').toThrow()
describe 'removing a column', ->
describe 'when there is alredy rows in the table', ->
beforeEach ->
spy = jasmine.createSpy 'removeColumn'
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
table.onDidRemoveColumn spy
table.removeColumn('value')
it 'removes the column', ->
expect(table.getColumnCount()).toEqual(1)
it 'dispatches a did-add-column event', ->
expect(spy).toHaveBeenCalled()
it 'removes the corresponding row cell', ->
expect(table.getRow(0).length).toEqual(1)
expect(table.getRow(1).length).toEqual(1)
it 'throws an exception when the column is undefined', ->
expect(-> table.removeColumn()).toThrow()
it 'throws an error with a negative index', ->
expect(-> table.removeColumnAt(-1)).toThrow()
it 'throws an error with an index greater that the columns count', ->
expect(-> table.removeColumnAt(2)).toThrow()
describe 'when saved', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
table.save()
table.removeColumn('value')
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe 'changing a column name', ->
beforeEach ->
row = table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
it 'changes the column name', ->
table.changeColumnName 'value', 'content'
expect(table.getColumn(1)).toEqual('content')
describe 'when saved', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.save()
table.changeColumnName 'value', 'content'
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
# ######## ####### ## ## ######
# ## ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ##
# ######## ## ## ## ## ## ######
# ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ## ##
# ## ## ####### ### ### ######
describe 'adding a row', ->
describe 'with an object', ->
it 'is marked as modified', ->
table.addRow key: 'foo', value: 'bar'
expect(table.isModified()).toBeTruthy()
it 'creates a row containing the values', ->
table.addRow key: 'foo', value: 'bar'
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
it 'dispatches a did-add-row event', ->
spy = jasmine.createSpy 'addRow'
table.onDidAddRow spy
table.addRow key: 'foo', value: 'bar'
expect(spy).toHaveBeenCalled()
it 'dispatches a did-change event', ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRow key: 'foo', value: 'bar'
expect(spy).toHaveBeenCalled()
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 0}
newRange: {start: 0, end: 1}
})
it "fills the row with undefined values", ->
row = table.addRow {}
expect(row).toEqual(new Array(2))
it 'ignores data that not match any column', ->
row = table.addRow key: 'foo', data: 'fooo'
expect(row).toEqual(['foo', undefined])
describe 'at a specified index', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
it 'inserts the row at the specified position', ->
table.addRowAt(1, key: 'hello', value: 'world')
expect(table.getRowCount()).toEqual(3)
expect(table.getRow(1)).toEqual(['hello','world'])
it 'throws an error if the index is negative', ->
expect(-> table.addRowAt -1, {}).toThrow()
it 'dispatches a did-change event', ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRowAt(1, key: 'hello', value: 'world')
expect(spy).toHaveBeenCalled()
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 1, end: 1}
newRange: {start: 1, end: 2}
})
describe 'with an array', ->
it 'creates a row with a cell for each value', ->
table.addRow ['foo', 'bar']
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
it "fills the row with undefined values", ->
row = table.addRow []
expect(row).toEqual(new Array(2))
describe 'at a specified index', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
it 'inserts the row at the specified position', ->
table.addRowAt(1, ['hello', 'world'])
expect(table.getRowCount()).toEqual(3)
expect(table.getRow(1)).toEqual(['hello', 'world'])
describe 'adding many rows', ->
beforeEach ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRows [
{ key: 'foo', value: 'bar' }
{ key: 'oof', value: 'rab' }
]
it 'adds the rows in the table', ->
expect(table.getRowCount()).toEqual(2)
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
it 'dispatch only one did-change event', ->
expect(spy).toHaveBeenCalled()
expect(spy.calls.length).toEqual(1)
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 0}
newRange: {start: 0, end: 2}
})
describe 'at a given index', ->
beforeEach ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRowsAt 1, [
{ key: 'foo', value: 'bar' }
{ key: 'oof', value: 'rab' }
]
it 'adds the rows in the table', ->
expect(table.getRowCount()).toEqual(4)
it 'dispatch only one did-change event', ->
expect(spy).toHaveBeenCalled()
expect(spy.calls.length).toEqual(1)
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 1, end: 1}
newRange: {start: 1, end: 3}
})
describe '::removeRow', ->
beforeEach ->
spy = jasmine.createSpy 'removeRow'
row = table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.onDidRemoveRow spy
it 'removes the row', ->
table.removeRow(row)
expect(table.getRowCount()).toEqual(1)
it 'dispatches a did-remove-row event', ->
table.removeRow(row)
expect(spy).toHaveBeenCalled()
it 'dispatches a did-change event', ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.removeRow(row)
expect(spy).toHaveBeenCalled()
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 1}
newRange: {start: 0, end: 0}
})
it 'throws an exception when the row is undefined', ->
expect(-> table.removeRow()).toThrow()
it 'throws an exception when the row is not in the table', ->
expect(-> table.removeRow({})).toThrow()
it 'throws an error with a negative index', ->
expect(-> table.removeRowAt(-1)).toThrow()
it 'throws an error with an index greater that the rows count', ->
expect(-> table.removeRowAt(2)).toThrow()
describe 'when saved', ->
beforeEach ->
table.save()
table.removeRow(row)
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::removeRowsInRange', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
spy = jasmine.createSpy 'removeRows'
table.onDidChange spy
it 'removes the rows from the table', ->
table.removeRowsInRange([0,2])
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['ofo', 'arb'])
it 'dispatches a single did-change', ->
table.removeRowsInRange([0,2])
expect(spy).toHaveBeenCalled()
expect(spy.calls.length).toEqual(1)
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 2}
newRange: {start: 0, end: 0}
})
it 'throws an error without range', ->
expect(-> table.removeRowsInRange()).toThrow()
it 'throws an error with an invalid range', ->
expect(-> table.removeRowsInRange {start: 1}).toThrow()
expect(-> table.removeRowsInRange [1]).toThrow()
describe 'with a range running to infinity', ->
it 'removes all the rows in the table', ->
table.removeRowsInRange([0, Infinity])
expect(table.getRowCount()).toEqual(0)
describe 'when saved', ->
beforeEach ->
table.save()
table.removeRowsInRange([0,2])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::removeRowsAtIndices', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
spy = jasmine.createSpy 'removeRows'
table.onDidChange spy
it 'removes the rows at indices', ->
table.removeRowsAtIndices([0,2])
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['oof','rab'])
describe 'when saved', ->
beforeEach ->
table.save()
table.removeRowsAtIndices([0,2])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::swapRows', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
it 'swaps the rows', ->
table.swapRows(0,2)
expect(table.getRows()).toEqual([
['ofo','arb']
['oof','rab']
['foo','bar']
])
it 'dispatches a change event', ->
changeSpy = jasmine.createSpy('did-change')
table.onDidChange(changeSpy)
table.swapRows(0,2)
expect(changeSpy).toHaveBeenCalledWith({rowIndices: [0,2]})
describe '::swapColumns', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
it 'swaps the column', ->
table.swapColumns(0,1)
expect(table.getRows()).toEqual([
['bar', 'foo']
['rab', 'oof']
['arb', 'ofo']
])
expect(table.getColumn(0)).toEqual('value')
expect(table.getColumn(1)).toEqual('key')
it 'dispatches a change event', ->
changeSpy = jasmine.createSpy('did-change')
swapSpy = jasmine.createSpy('did-swap-columns')
table.onDidChange(changeSpy)
table.onDidSwapColumns(swapSpy)
table.swapColumns(0,1)
expect(changeSpy).toHaveBeenCalledWith({
oldRange: {start: 0, end: 3}
newRange: {start: 0, end: 3}
})
expect(swapSpy).toHaveBeenCalledWith({
columnA: 0
columnB: 1
})
# ###### ######## ## ## ######
# ## ## ## ## ## ## ##
# ## ## ## ## ##
# ## ###### ## ## ######
# ## ## ## ## ##
# ## ## ## ## ## ## ##
# ###### ######## ######## ######## ######
describe '::getValueAtPosition', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['John Doe', 30])
table.addRow(['Jane Doe', 30])
it 'returns the cell at the given position array', ->
expect(table.getValueAtPosition([1,0])).toEqual('Jane Doe')
it 'returns the cell at the given position object', ->
expect(table.getValueAtPosition(row: 1, column: 0)).toEqual('Jane Doe')
it 'throws an error without a position', ->
expect(-> table.getValueAtPosition()).toThrow()
it 'returns undefined with a position out of bounds', ->
expect(table.getValueAtPosition(row: 2, column: 0)).toBeUndefined()
expect(table.getValueAtPosition(row: 0, column: 2)).toBeUndefined()
describe '::setValueAtPosition', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['John Doe', 30])
table.addRow(['Jane Doe', 30])
it 'changes the value at the given position', ->
table.setValueAtPosition([1,1], 40)
expect(table.getRow(1)).toEqual(['Jane Doe', 40])
it 'emits a did-change-cell-value event', ->
spy = jasmine.createSpy('did-change-cell-value')
table.onDidChangeCellValue(spy)
table.setValueAtPosition([1,1], 40)
expect(spy).toHaveBeenCalled()
describe 'when saved', ->
beforeEach ->
table.save()
table.setValueAtPosition([1,1], 40)
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::setValuesAtPositions', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['John Doe', 30])
table.addRow(['Jane Doe', 30])
it 'changes the value at the given position', ->
table.setValuesAtPositions([[0,1], [1,1]],[40, 40])
expect(table.getRow(0)).toEqual(['John Doe', 40])
expect(table.getRow(1)).toEqual(['Jane Doe', 40])
it 'emits a did-change-cell-value event', ->
spy = jasmine.createSpy('did-change-cell-value')
table.onDidChangeCellValue(spy)
table.setValuesAtPositions([[0,1], [1,1]],[40, 40])
expect(spy).toHaveBeenCalled()
describe 'when saved', ->
beforeEach ->
table.save()
table.setValuesAtPositions([[0,1], [1,1]],[40, 40])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::setValuesInRange', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['John Doe', 30])
table.addRow(['Jane Doe', 30])
it 'changes the value at the given position', ->
table.setValuesInRange([[0,1], [2,2]],[[40], [40]])
expect(table.getRow(0)).toEqual(['John Doe', 40])
expect(table.getRow(1)).toEqual(['Jane Doe', 40])
it 'emits a did-change-cell-value event', ->
spy = jasmine.createSpy('did-change-cell-value')
table.onDidChangeCellValue(spy)
table.setValuesInRange([[0,1], [2,2]],[[40], [40]])
expect(spy).toHaveBeenCalled()
describe 'when saved', ->
beforeEach ->
table.save()
table.setValuesInRange([[0,1], [2,2]],[[40], [40]])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
# ## ## ## ## ######## #######
# ## ## ### ## ## ## ## ##
# ## ## #### ## ## ## ## ##
# ## ## ## ## ## ## ## ## ##
# ## ## ## #### ## ## ## ##
# ## ## ## ### ## ## ## ##
# ####### ## ## ######## #######
describe 'transactions', ->
it 'drops old transactions when reaching the size limit', ->
Table.MAX_HISTORY_SIZE = 10
table.addColumn('foo')
table.addRow ["foo#{i}"] for i in [0...20]
expect(table.undoStack.length).toEqual(10)
table.undo()
expect(table.getLastRow()).toEqual(['foo18'])
it 'rolls back a column addition', ->
table.addColumn('key')
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getColumnCount()).toEqual(0)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getColumnCount()).toEqual(1)
expect(table.getColumn(0)).toEqual('key')
it 'rolls back a column deletion', ->
column = table.addColumn('key')
table.addRow(['foo'])
table.addRow(['bar'])
table.addRow(['baz'])
table.clearUndoStack()
table.removeColumn(column)
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getColumnCount()).toEqual(1)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getColumn(0)).toEqual('key')
expect(table.getRow(0)).toEqual(['foo'])
expect(table.getRow(1)).toEqual(['bar'])
expect(table.getRow(2)).toEqual(['baz'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getColumnCount()).toEqual(0)
describe 'with columns in the table', ->
beforeEach ->
table.addColumn('key')
column = table.addColumn('value')
it 'rolls back a row addition', ->
table.clearUndoStack()
row = table.addRow ['foo', 'bar']
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(0)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
it 'rolls back a batched rows addition', ->
table.clearUndoStack()
rows = table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(0)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(2)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
it 'rolls back a row deletion', ->
row = table.addRow ['foo', 'bar']
table.clearUndoStack()
table.removeRowAt(0)
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(1)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(0)
it 'rolls back a batched rows deletion', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.removeRowsInRange([0,2])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(2)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(0)
it 'rolls back a batched rows deletion by indices', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
['baz', 'foo']
]
table.clearUndoStack()
table.removeRowsAtIndices([0,2])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(3)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
expect(table.getRow(2)).toEqual(['baz', 'foo'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(1)
it 'rolls back a change in a column', ->
table.clearUndoStack()
table.changeColumnName('value', 'foo')
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getColumn(1)).toEqual('value')
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.getColumn(1)).toEqual('foo')
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
it 'rolls back a change in a row data', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.setValueAtPosition([0,0], 'hello')
expect(table.getRow(0)).toEqual(['hello', 'bar'])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRow(0)).toEqual(['hello', 'bar'])
it 'rolls back many changes in row data', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.setValuesAtPositions([[0,0], [1,1]], ['hello', 'world'])
expect(table.getRow(0)).toEqual(['hello', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'world'])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRow(0)).toEqual(['hello', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'world'])
it 'rolls back many changes in row data', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.setValuesInRange([[0,0], [1,2]], [['hello', 'world']])
expect(table.getRow(0)).toEqual(['hello', 'world'])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRow(0)).toEqual(['hello', 'world'])
it 'rolls back a swap of rows', ->
table.addRows([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.clearUndoStack()
table.save()
table.swapRows(0,2)
table.undo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRows()).toEqual([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.redo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRows()).toEqual([
['ofo','arb']
['oof','rab']
['foo','bar']
])
it 'rolls back a swap of columns', ->
table.addRows([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.clearUndoStack()
table.save()
table.swapColumns(0,1)
table.undo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getColumn(1)).toEqual('value')
expect(table.getColumn(0)).toEqual('key')
expect(table.getRows()).toEqual([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.redo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getColumn(0)).toEqual('value')
expect(table.getColumn(1)).toEqual('key')
expect(table.getRows()).toEqual([
['bar', 'foo']
['rab', 'oof']
['arb', 'ofo']
])
describe '::clearUndoStack', ->
it 'removes all the transactions in the undo stack', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.setValueAtPosition([0, 0], 'hello')
table.undo()
table.clearUndoStack()
expect(table.undoStack.length).toEqual(0)
describe '::clearRedoStack', ->
it 'removes all the transactions in the redo stack', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.setValueAtPosition([0, 0], 'hello')
table.undo()
table.clearRedoStack()
expect(table.redoStack.length).toEqual(0)
| 181473 | require './helpers/spec-helper'
{Point} = require 'atom'
Table = require '../lib/table'
describe 'Table', ->
[table, row, column, spy] = []
beforeEach ->
table = new Table
it 'has 0 columns', ->
expect(table.getColumnCount()).toEqual(0)
it 'has 0 rows', ->
expect(table.getRowCount()).toEqual(0)
it 'has 0 cells', ->
expect(table.getCellCount()).toEqual(0)
describe 'adding a row on a table without columns', ->
it 'raises an exception', ->
expect(-> table.addRow {}).toThrow()
describe 'when destroyed', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['<NAME>', 30])
table.addRow(['<NAME>', 30])
table.destroy()
it 'clears its content', ->
expect(table.getRowCount()).toEqual(0)
expect(table.getColumnCount()).toEqual(0)
it 'throws an error when adding a row', ->
expect(-> table.addRow(['foo'])).toThrow()
expect(-> table.addRows([['foo']])).toThrow()
it 'throws an error when adding a column', ->
expect(-> table.addColumn('foo')).toThrow()
describe '::retain', ->
it 'increments the reference count', ->
expect(table.refcount).toEqual(0)
table.retain()
expect(table.refcount).toEqual(1)
expect(table.isRetained()).toBeTruthy()
table.retain()
expect(table.refcount).toEqual(2)
describe '::release', ->
it 'decrements the reference count', ->
table.retain()
table.retain()
table.release()
expect(table.refcount).toEqual(1)
expect(table.isRetained()).toBeTruthy()
table.release()
expect(table.refcount).toEqual(0)
expect(table.isRetained()).toBeFalsy()
it 'destroys the table when the refcount drop to 0', ->
spy = jasmine.createSpy('did-destroy')
table.onDidDestroy(spy)
table.retain()
table.retain()
table.release()
table.release()
expect(spy).toHaveBeenCalled()
expect(table.isDestroyed()).toBeTruthy()
# ###### ### ## ## ########
# ## ## ## ## ## ## ##
# ## ## ## ## ## ##
# ###### ## ## ## ## ######
# ## ######### ## ## ##
# ## ## ## ## ## ## ##
# ###### ## ## ### ########
describe '::save', ->
describe 'when modified', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['<NAME>', 30])
table.addRow(['<NAME>', 30])
expect(table.isModified()).toBeTruthy()
it 'is marked as saved', ->
table.save()
expect(table.isModified()).toBeFalsy()
describe 'with a synchronous save handler', ->
it 'calls the handler on save', ->
calls = []
table.addColumn('age')
table.setSaveHandler -> calls.push 'save'
table.onDidSave -> calls.push 'did-save'
table.save()
expect(calls).toEqual(['save', 'did-save'])
it 'marks the table as saved if the handler returned true', ->
table.addColumn('age')
table.setSaveHandler -> true
table.save()
expect(table.isModified()).toBeFalsy()
it 'leaves the table as modified if the handler returned false', ->
table.addColumn('age')
table.setSaveHandler -> false
table.save()
expect(table.isModified()).toBeTruthy()
describe 'when not modified', ->
it 'does nothing', ->
calls = []
table.setSaveHandler -> calls.push 'save'
table.onDidSave -> calls.push 'did-save'
table.save()
expect(calls).toEqual([])
describe 'with an asynchronous save handler', ->
promise = null
it 'calls the handler on save', ->
calls = []
table.addColumn('age')
table.setSaveHandler -> promise = new Promise (resolve) ->
calls.push('save')
resolve()
table.onDidSave -> calls.push 'did-save'
table.save()
waitsForPromise -> promise
runs -> expect(calls).toEqual(['save', 'did-save'])
it 'marks the table as saved if the handler resolve the promise', ->
table.addColumn('age')
table.setSaveHandler -> promise = new Promise (resolve) -> resolve()
table.save()
waitsForPromise -> promise
runs -> expect(table.isModified()).toBeFalsy()
it 'leaves the table as modified if the handler reject the promise', ->
table.addColumn('age')
table.setSaveHandler ->
promise = new Promise (resolve, reject) -> reject()
table.save()
waitsForPromise shouldReject: true, -> promise
runs -> expect(table.isModified()).toBeTruthy()
# ######## ######## ###### ######## ####### ######## ########
# ## ## ## ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ## ## ##
# ######## ###### ###### ## ## ## ######## ######
# ## ## ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ## ## ## ##
# ## ## ######## ###### ## ####### ## ## ########
describe '::serialize', ->
it 'serializes the empty table', ->
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: []
rows: []
id: table.id
})
it 'serializes the table with its empty rows and columns', ->
table.addColumn()
table.addColumn()
table.addRow()
table.addRow()
table.save()
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: [undefined, undefined]
rows: [
[undefined, undefined]
[undefined, undefined]
]
id: table.id
})
it 'serializes the table with its values', ->
table.addColumn('foo')
table.addColumn('bar')
table.addRow([1,2])
table.addRow([3,4])
table.save()
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: ['foo', 'bar']
rows: [
[1,2]
[3,4]
]
id: table.id
})
it 'serializes the table in its modified state', ->
table.addColumn('foo')
table.addColumn('bar')
table.addRow([1,2])
table.addRow([3,4])
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: ['foo', 'bar']
modified: true
cachedContents: undefined
rows: [
[1,2]
[3,4]
]
id: table.id
})
describe '.deserialize', ->
it 'deserialize a table', ->
table = atom.deserializers.deserialize({
deserializer: 'Table'
columns: ['foo', 'bar']
rows: [
[1,2]
[3,4]
]
id: 1
})
expect(table.id).toEqual(1)
expect(table.getColumns()).toEqual(['foo','bar'])
expect(table.getRows()).toEqual([
[1,2]
[3,4]
])
expect(table.isModified()).toBeFalsy()
it 'deserialize a table in a modified state', ->
table = atom.deserializers.deserialize({
deserializer: 'Table'
columns: ['foo', 'bar']
modified: true
cachedContents: undefined
rows: [
[1,2]
[3,4]
]
id: 1
})
expect(table.getColumns()).toEqual(['foo','bar'])
expect(table.getRows()).toEqual([
[1,2]
[3,4]
])
expect(table.isModified()).toBeTruthy()
# ###### ####### ## ## ## ## ## ## ## ######
# ## ## ## ## ## ## ## ### ### ### ## ## ##
# ## ## ## ## ## ## #### #### #### ## ##
# ## ## ## ## ## ## ## ### ## ## ## ## ######
# ## ## ## ## ## ## ## ## ## #### ##
# ## ## ## ## ## ## ## ## ## ## ### ## ##
# ###### ####### ######## ####### ## ## ## ## ######
describe 'with columns added to the table', ->
beforeEach ->
table.addColumn('key')
table.addColumn('value')
it 'has 2 columns', ->
expect(table.getColumnCount()).toEqual(2)
expect(table.getColumn(0)).toEqual('key')
expect(table.getColumn(1)).toEqual('value')
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe 'when adding a column whose name already exist in table', ->
it 'does not raise an exception', ->
expect(-> table.addColumn('key')).not.toThrow()
describe 'when adding a column whose name is undefined', ->
it 'does not raise an exception', ->
expect(-> table.addColumn('key')).not.toThrow()
describe 'when there is already rows in the table', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
describe 'adding a column', ->
it 'extend all the rows with a new cell', ->
table.addColumn 'required'
expect(table.getRow(0).length).toEqual(3)
it 'dispatches a did-add-column event', ->
spy = jasmine.createSpy 'addColumn'
table.onDidAddColumn spy
table.addColumn 'required'
expect(spy).toHaveBeenCalled()
describe 'adding a column at a given index', ->
beforeEach ->
column = table.addColumnAt 1, 'required'
it 'adds the column at the right place', ->
expect(table.getColumnCount()).toEqual(3)
expect(table.getColumn(1)).toEqual('required')
expect(table.getColumn(2)).toEqual('value')
it 'extend the existing rows at the right place', ->
expect(table.getRow(0).length).toEqual(3)
expect(table.getRow(1).length).toEqual(3)
it 'throws an error if the index is negative', ->
expect(-> table.addColumnAt -1, 'foo').toThrow()
describe 'removing a column', ->
describe 'when there is alredy rows in the table', ->
beforeEach ->
spy = jasmine.createSpy 'removeColumn'
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
table.onDidRemoveColumn spy
table.removeColumn('value')
it 'removes the column', ->
expect(table.getColumnCount()).toEqual(1)
it 'dispatches a did-add-column event', ->
expect(spy).toHaveBeenCalled()
it 'removes the corresponding row cell', ->
expect(table.getRow(0).length).toEqual(1)
expect(table.getRow(1).length).toEqual(1)
it 'throws an exception when the column is undefined', ->
expect(-> table.removeColumn()).toThrow()
it 'throws an error with a negative index', ->
expect(-> table.removeColumnAt(-1)).toThrow()
it 'throws an error with an index greater that the columns count', ->
expect(-> table.removeColumnAt(2)).toThrow()
describe 'when saved', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
table.save()
table.removeColumn('value')
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe 'changing a column name', ->
beforeEach ->
row = table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
it 'changes the column name', ->
table.changeColumnName 'value', 'content'
expect(table.getColumn(1)).toEqual('content')
describe 'when saved', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.save()
table.changeColumnName 'value', 'content'
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
# ######## ####### ## ## ######
# ## ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ##
# ######## ## ## ## ## ## ######
# ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ## ##
# ## ## ####### ### ### ######
describe 'adding a row', ->
describe 'with an object', ->
it 'is marked as modified', ->
table.addRow key: 'foo', value: 'bar'
expect(table.isModified()).toBeTruthy()
it 'creates a row containing the values', ->
table.addRow key: 'foo', value: 'bar'
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
it 'dispatches a did-add-row event', ->
spy = jasmine.createSpy 'addRow'
table.onDidAddRow spy
table.addRow key: 'foo', value: 'bar'
expect(spy).toHaveBeenCalled()
it 'dispatches a did-change event', ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRow key: 'foo', value: 'bar'
expect(spy).toHaveBeenCalled()
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 0}
newRange: {start: 0, end: 1}
})
it "fills the row with undefined values", ->
row = table.addRow {}
expect(row).toEqual(new Array(2))
it 'ignores data that not match any column', ->
row = table.addRow key: 'foo', data: 'fooo'
expect(row).toEqual(['foo', undefined])
describe 'at a specified index', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
it 'inserts the row at the specified position', ->
table.addRowAt(1, key: 'hello', value: 'world')
expect(table.getRowCount()).toEqual(3)
expect(table.getRow(1)).toEqual(['hello','world'])
it 'throws an error if the index is negative', ->
expect(-> table.addRowAt -1, {}).toThrow()
it 'dispatches a did-change event', ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRowAt(1, key: 'hello', value: 'world')
expect(spy).toHaveBeenCalled()
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 1, end: 1}
newRange: {start: 1, end: 2}
})
describe 'with an array', ->
it 'creates a row with a cell for each value', ->
table.addRow ['foo', 'bar']
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
it "fills the row with undefined values", ->
row = table.addRow []
expect(row).toEqual(new Array(2))
describe 'at a specified index', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
it 'inserts the row at the specified position', ->
table.addRowAt(1, ['hello', 'world'])
expect(table.getRowCount()).toEqual(3)
expect(table.getRow(1)).toEqual(['hello', 'world'])
describe 'adding many rows', ->
beforeEach ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRows [
{ key: 'foo', value: 'bar' }
{ key: 'oof', value: 'rab' }
]
it 'adds the rows in the table', ->
expect(table.getRowCount()).toEqual(2)
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
it 'dispatch only one did-change event', ->
expect(spy).toHaveBeenCalled()
expect(spy.calls.length).toEqual(1)
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 0}
newRange: {start: 0, end: 2}
})
describe 'at a given index', ->
beforeEach ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRowsAt 1, [
{ key: 'foo', value: 'bar' }
{ key: 'oof', value: 'rab' }
]
it 'adds the rows in the table', ->
expect(table.getRowCount()).toEqual(4)
it 'dispatch only one did-change event', ->
expect(spy).toHaveBeenCalled()
expect(spy.calls.length).toEqual(1)
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 1, end: 1}
newRange: {start: 1, end: 3}
})
describe '::removeRow', ->
beforeEach ->
spy = jasmine.createSpy 'removeRow'
row = table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.onDidRemoveRow spy
it 'removes the row', ->
table.removeRow(row)
expect(table.getRowCount()).toEqual(1)
it 'dispatches a did-remove-row event', ->
table.removeRow(row)
expect(spy).toHaveBeenCalled()
it 'dispatches a did-change event', ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.removeRow(row)
expect(spy).toHaveBeenCalled()
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 1}
newRange: {start: 0, end: 0}
})
it 'throws an exception when the row is undefined', ->
expect(-> table.removeRow()).toThrow()
it 'throws an exception when the row is not in the table', ->
expect(-> table.removeRow({})).toThrow()
it 'throws an error with a negative index', ->
expect(-> table.removeRowAt(-1)).toThrow()
it 'throws an error with an index greater that the rows count', ->
expect(-> table.removeRowAt(2)).toThrow()
describe 'when saved', ->
beforeEach ->
table.save()
table.removeRow(row)
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::removeRowsInRange', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
spy = jasmine.createSpy 'removeRows'
table.onDidChange spy
it 'removes the rows from the table', ->
table.removeRowsInRange([0,2])
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['ofo', 'arb'])
it 'dispatches a single did-change', ->
table.removeRowsInRange([0,2])
expect(spy).toHaveBeenCalled()
expect(spy.calls.length).toEqual(1)
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 2}
newRange: {start: 0, end: 0}
})
it 'throws an error without range', ->
expect(-> table.removeRowsInRange()).toThrow()
it 'throws an error with an invalid range', ->
expect(-> table.removeRowsInRange {start: 1}).toThrow()
expect(-> table.removeRowsInRange [1]).toThrow()
describe 'with a range running to infinity', ->
it 'removes all the rows in the table', ->
table.removeRowsInRange([0, Infinity])
expect(table.getRowCount()).toEqual(0)
describe 'when saved', ->
beforeEach ->
table.save()
table.removeRowsInRange([0,2])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::removeRowsAtIndices', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
spy = jasmine.createSpy 'removeRows'
table.onDidChange spy
it 'removes the rows at indices', ->
table.removeRowsAtIndices([0,2])
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['oof','rab'])
describe 'when saved', ->
beforeEach ->
table.save()
table.removeRowsAtIndices([0,2])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::swapRows', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
it 'swaps the rows', ->
table.swapRows(0,2)
expect(table.getRows()).toEqual([
['ofo','arb']
['oof','rab']
['foo','bar']
])
it 'dispatches a change event', ->
changeSpy = jasmine.createSpy('did-change')
table.onDidChange(changeSpy)
table.swapRows(0,2)
expect(changeSpy).toHaveBeenCalledWith({rowIndices: [0,2]})
describe '::swapColumns', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
it 'swaps the column', ->
table.swapColumns(0,1)
expect(table.getRows()).toEqual([
['bar', 'foo']
['rab', 'oof']
['arb', 'ofo']
])
expect(table.getColumn(0)).toEqual('value')
expect(table.getColumn(1)).toEqual('key')
it 'dispatches a change event', ->
changeSpy = jasmine.createSpy('did-change')
swapSpy = jasmine.createSpy('did-swap-columns')
table.onDidChange(changeSpy)
table.onDidSwapColumns(swapSpy)
table.swapColumns(0,1)
expect(changeSpy).toHaveBeenCalledWith({
oldRange: {start: 0, end: 3}
newRange: {start: 0, end: 3}
})
expect(swapSpy).toHaveBeenCalledWith({
columnA: 0
columnB: 1
})
# ###### ######## ## ## ######
# ## ## ## ## ## ## ##
# ## ## ## ## ##
# ## ###### ## ## ######
# ## ## ## ## ##
# ## ## ## ## ## ## ##
# ###### ######## ######## ######## ######
describe '::getValueAtPosition', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['<NAME>', 30])
table.addRow(['<NAME>', 30])
it 'returns the cell at the given position array', ->
expect(table.getValueAtPosition([1,0])).toEqual('<NAME>')
it 'returns the cell at the given position object', ->
expect(table.getValueAtPosition(row: 1, column: 0)).toEqual('<NAME>')
it 'throws an error without a position', ->
expect(-> table.getValueAtPosition()).toThrow()
it 'returns undefined with a position out of bounds', ->
expect(table.getValueAtPosition(row: 2, column: 0)).toBeUndefined()
expect(table.getValueAtPosition(row: 0, column: 2)).toBeUndefined()
describe '::setValueAtPosition', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['<NAME>', 30])
table.addRow(['<NAME>', 30])
it 'changes the value at the given position', ->
table.setValueAtPosition([1,1], 40)
expect(table.getRow(1)).toEqual(['<NAME>', 40])
it 'emits a did-change-cell-value event', ->
spy = jasmine.createSpy('did-change-cell-value')
table.onDidChangeCellValue(spy)
table.setValueAtPosition([1,1], 40)
expect(spy).toHaveBeenCalled()
describe 'when saved', ->
beforeEach ->
table.save()
table.setValueAtPosition([1,1], 40)
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::setValuesAtPositions', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['<NAME>', 30])
table.addRow(['<NAME>', 30])
it 'changes the value at the given position', ->
table.setValuesAtPositions([[0,1], [1,1]],[40, 40])
expect(table.getRow(0)).toEqual(['<NAME>', 40])
expect(table.getRow(1)).toEqual(['<NAME>', 40])
it 'emits a did-change-cell-value event', ->
spy = jasmine.createSpy('did-change-cell-value')
table.onDidChangeCellValue(spy)
table.setValuesAtPositions([[0,1], [1,1]],[40, 40])
expect(spy).toHaveBeenCalled()
describe 'when saved', ->
beforeEach ->
table.save()
table.setValuesAtPositions([[0,1], [1,1]],[40, 40])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::setValuesInRange', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['<NAME>', 30])
table.addRow(['<NAME>', 30])
it 'changes the value at the given position', ->
table.setValuesInRange([[0,1], [2,2]],[[40], [40]])
expect(table.getRow(0)).toEqual(['<NAME>', 40])
expect(table.getRow(1)).toEqual(['<NAME>', 40])
it 'emits a did-change-cell-value event', ->
spy = jasmine.createSpy('did-change-cell-value')
table.onDidChangeCellValue(spy)
table.setValuesInRange([[0,1], [2,2]],[[40], [40]])
expect(spy).toHaveBeenCalled()
describe 'when saved', ->
beforeEach ->
table.save()
table.setValuesInRange([[0,1], [2,2]],[[40], [40]])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
# ## ## ## ## ######## #######
# ## ## ### ## ## ## ## ##
# ## ## #### ## ## ## ## ##
# ## ## ## ## ## ## ## ## ##
# ## ## ## #### ## ## ## ##
# ## ## ## ### ## ## ## ##
# ####### ## ## ######## #######
describe 'transactions', ->
it 'drops old transactions when reaching the size limit', ->
Table.MAX_HISTORY_SIZE = 10
table.addColumn('foo')
table.addRow ["foo#{i}"] for i in [0...20]
expect(table.undoStack.length).toEqual(10)
table.undo()
expect(table.getLastRow()).toEqual(['foo18'])
it 'rolls back a column addition', ->
table.addColumn('key')
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getColumnCount()).toEqual(0)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getColumnCount()).toEqual(1)
expect(table.getColumn(0)).toEqual('key')
it 'rolls back a column deletion', ->
column = table.addColumn('key')
table.addRow(['foo'])
table.addRow(['bar'])
table.addRow(['baz'])
table.clearUndoStack()
table.removeColumn(column)
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getColumnCount()).toEqual(1)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getColumn(0)).toEqual('key')
expect(table.getRow(0)).toEqual(['foo'])
expect(table.getRow(1)).toEqual(['bar'])
expect(table.getRow(2)).toEqual(['baz'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getColumnCount()).toEqual(0)
describe 'with columns in the table', ->
beforeEach ->
table.addColumn('key')
column = table.addColumn('value')
it 'rolls back a row addition', ->
table.clearUndoStack()
row = table.addRow ['foo', 'bar']
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(0)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
it 'rolls back a batched rows addition', ->
table.clearUndoStack()
rows = table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(0)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(2)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
it 'rolls back a row deletion', ->
row = table.addRow ['foo', 'bar']
table.clearUndoStack()
table.removeRowAt(0)
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(1)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(0)
it 'rolls back a batched rows deletion', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.removeRowsInRange([0,2])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(2)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(0)
it 'rolls back a batched rows deletion by indices', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
['baz', 'foo']
]
table.clearUndoStack()
table.removeRowsAtIndices([0,2])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(3)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
expect(table.getRow(2)).toEqual(['baz', 'foo'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(1)
it 'rolls back a change in a column', ->
table.clearUndoStack()
table.changeColumnName('value', 'foo')
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getColumn(1)).toEqual('value')
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.getColumn(1)).toEqual('foo')
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
it 'rolls back a change in a row data', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.setValueAtPosition([0,0], 'hello')
expect(table.getRow(0)).toEqual(['hello', 'bar'])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRow(0)).toEqual(['hello', 'bar'])
it 'rolls back many changes in row data', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.setValuesAtPositions([[0,0], [1,1]], ['hello', 'world'])
expect(table.getRow(0)).toEqual(['hello', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'world'])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRow(0)).toEqual(['hello', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'world'])
it 'rolls back many changes in row data', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.setValuesInRange([[0,0], [1,2]], [['hello', 'world']])
expect(table.getRow(0)).toEqual(['hello', 'world'])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRow(0)).toEqual(['hello', 'world'])
it 'rolls back a swap of rows', ->
table.addRows([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.clearUndoStack()
table.save()
table.swapRows(0,2)
table.undo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRows()).toEqual([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.redo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRows()).toEqual([
['ofo','arb']
['oof','rab']
['foo','bar']
])
it 'rolls back a swap of columns', ->
table.addRows([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.clearUndoStack()
table.save()
table.swapColumns(0,1)
table.undo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getColumn(1)).toEqual('value')
expect(table.getColumn(0)).toEqual('key')
expect(table.getRows()).toEqual([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.redo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getColumn(0)).toEqual('value')
expect(table.getColumn(1)).toEqual('key')
expect(table.getRows()).toEqual([
['bar', 'foo']
['rab', 'oof']
['arb', 'ofo']
])
describe '::clearUndoStack', ->
it 'removes all the transactions in the undo stack', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.setValueAtPosition([0, 0], 'hello')
table.undo()
table.clearUndoStack()
expect(table.undoStack.length).toEqual(0)
describe '::clearRedoStack', ->
it 'removes all the transactions in the redo stack', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.setValueAtPosition([0, 0], 'hello')
table.undo()
table.clearRedoStack()
expect(table.redoStack.length).toEqual(0)
| true | require './helpers/spec-helper'
{Point} = require 'atom'
Table = require '../lib/table'
describe 'Table', ->
[table, row, column, spy] = []
beforeEach ->
table = new Table
it 'has 0 columns', ->
expect(table.getColumnCount()).toEqual(0)
it 'has 0 rows', ->
expect(table.getRowCount()).toEqual(0)
it 'has 0 cells', ->
expect(table.getCellCount()).toEqual(0)
describe 'adding a row on a table without columns', ->
it 'raises an exception', ->
expect(-> table.addRow {}).toThrow()
describe 'when destroyed', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['PI:NAME:<NAME>END_PI', 30])
table.addRow(['PI:NAME:<NAME>END_PI', 30])
table.destroy()
it 'clears its content', ->
expect(table.getRowCount()).toEqual(0)
expect(table.getColumnCount()).toEqual(0)
it 'throws an error when adding a row', ->
expect(-> table.addRow(['foo'])).toThrow()
expect(-> table.addRows([['foo']])).toThrow()
it 'throws an error when adding a column', ->
expect(-> table.addColumn('foo')).toThrow()
describe '::retain', ->
it 'increments the reference count', ->
expect(table.refcount).toEqual(0)
table.retain()
expect(table.refcount).toEqual(1)
expect(table.isRetained()).toBeTruthy()
table.retain()
expect(table.refcount).toEqual(2)
describe '::release', ->
it 'decrements the reference count', ->
table.retain()
table.retain()
table.release()
expect(table.refcount).toEqual(1)
expect(table.isRetained()).toBeTruthy()
table.release()
expect(table.refcount).toEqual(0)
expect(table.isRetained()).toBeFalsy()
it 'destroys the table when the refcount drop to 0', ->
spy = jasmine.createSpy('did-destroy')
table.onDidDestroy(spy)
table.retain()
table.retain()
table.release()
table.release()
expect(spy).toHaveBeenCalled()
expect(table.isDestroyed()).toBeTruthy()
# ###### ### ## ## ########
# ## ## ## ## ## ## ##
# ## ## ## ## ## ##
# ###### ## ## ## ## ######
# ## ######### ## ## ##
# ## ## ## ## ## ## ##
# ###### ## ## ### ########
describe '::save', ->
describe 'when modified', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['PI:NAME:<NAME>END_PI', 30])
table.addRow(['PI:NAME:<NAME>END_PI', 30])
expect(table.isModified()).toBeTruthy()
it 'is marked as saved', ->
table.save()
expect(table.isModified()).toBeFalsy()
describe 'with a synchronous save handler', ->
it 'calls the handler on save', ->
calls = []
table.addColumn('age')
table.setSaveHandler -> calls.push 'save'
table.onDidSave -> calls.push 'did-save'
table.save()
expect(calls).toEqual(['save', 'did-save'])
it 'marks the table as saved if the handler returned true', ->
table.addColumn('age')
table.setSaveHandler -> true
table.save()
expect(table.isModified()).toBeFalsy()
it 'leaves the table as modified if the handler returned false', ->
table.addColumn('age')
table.setSaveHandler -> false
table.save()
expect(table.isModified()).toBeTruthy()
describe 'when not modified', ->
it 'does nothing', ->
calls = []
table.setSaveHandler -> calls.push 'save'
table.onDidSave -> calls.push 'did-save'
table.save()
expect(calls).toEqual([])
describe 'with an asynchronous save handler', ->
promise = null
it 'calls the handler on save', ->
calls = []
table.addColumn('age')
table.setSaveHandler -> promise = new Promise (resolve) ->
calls.push('save')
resolve()
table.onDidSave -> calls.push 'did-save'
table.save()
waitsForPromise -> promise
runs -> expect(calls).toEqual(['save', 'did-save'])
it 'marks the table as saved if the handler resolve the promise', ->
table.addColumn('age')
table.setSaveHandler -> promise = new Promise (resolve) -> resolve()
table.save()
waitsForPromise -> promise
runs -> expect(table.isModified()).toBeFalsy()
it 'leaves the table as modified if the handler reject the promise', ->
table.addColumn('age')
table.setSaveHandler ->
promise = new Promise (resolve, reject) -> reject()
table.save()
waitsForPromise shouldReject: true, -> promise
runs -> expect(table.isModified()).toBeTruthy()
# ######## ######## ###### ######## ####### ######## ########
# ## ## ## ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ## ## ##
# ######## ###### ###### ## ## ## ######## ######
# ## ## ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ## ## ## ##
# ## ## ######## ###### ## ####### ## ## ########
describe '::serialize', ->
it 'serializes the empty table', ->
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: []
rows: []
id: table.id
})
it 'serializes the table with its empty rows and columns', ->
table.addColumn()
table.addColumn()
table.addRow()
table.addRow()
table.save()
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: [undefined, undefined]
rows: [
[undefined, undefined]
[undefined, undefined]
]
id: table.id
})
it 'serializes the table with its values', ->
table.addColumn('foo')
table.addColumn('bar')
table.addRow([1,2])
table.addRow([3,4])
table.save()
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: ['foo', 'bar']
rows: [
[1,2]
[3,4]
]
id: table.id
})
it 'serializes the table in its modified state', ->
table.addColumn('foo')
table.addColumn('bar')
table.addRow([1,2])
table.addRow([3,4])
expect(table.serialize()).toEqual({
deserializer: 'Table'
columns: ['foo', 'bar']
modified: true
cachedContents: undefined
rows: [
[1,2]
[3,4]
]
id: table.id
})
describe '.deserialize', ->
it 'deserialize a table', ->
table = atom.deserializers.deserialize({
deserializer: 'Table'
columns: ['foo', 'bar']
rows: [
[1,2]
[3,4]
]
id: 1
})
expect(table.id).toEqual(1)
expect(table.getColumns()).toEqual(['foo','bar'])
expect(table.getRows()).toEqual([
[1,2]
[3,4]
])
expect(table.isModified()).toBeFalsy()
it 'deserialize a table in a modified state', ->
table = atom.deserializers.deserialize({
deserializer: 'Table'
columns: ['foo', 'bar']
modified: true
cachedContents: undefined
rows: [
[1,2]
[3,4]
]
id: 1
})
expect(table.getColumns()).toEqual(['foo','bar'])
expect(table.getRows()).toEqual([
[1,2]
[3,4]
])
expect(table.isModified()).toBeTruthy()
# ###### ####### ## ## ## ## ## ## ## ######
# ## ## ## ## ## ## ## ### ### ### ## ## ##
# ## ## ## ## ## ## #### #### #### ## ##
# ## ## ## ## ## ## ## ### ## ## ## ## ######
# ## ## ## ## ## ## ## ## ## #### ##
# ## ## ## ## ## ## ## ## ## ## ### ## ##
# ###### ####### ######## ####### ## ## ## ## ######
describe 'with columns added to the table', ->
beforeEach ->
table.addColumn('key')
table.addColumn('value')
it 'has 2 columns', ->
expect(table.getColumnCount()).toEqual(2)
expect(table.getColumn(0)).toEqual('key')
expect(table.getColumn(1)).toEqual('value')
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe 'when adding a column whose name already exist in table', ->
it 'does not raise an exception', ->
expect(-> table.addColumn('key')).not.toThrow()
describe 'when adding a column whose name is undefined', ->
it 'does not raise an exception', ->
expect(-> table.addColumn('key')).not.toThrow()
describe 'when there is already rows in the table', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
describe 'adding a column', ->
it 'extend all the rows with a new cell', ->
table.addColumn 'required'
expect(table.getRow(0).length).toEqual(3)
it 'dispatches a did-add-column event', ->
spy = jasmine.createSpy 'addColumn'
table.onDidAddColumn spy
table.addColumn 'required'
expect(spy).toHaveBeenCalled()
describe 'adding a column at a given index', ->
beforeEach ->
column = table.addColumnAt 1, 'required'
it 'adds the column at the right place', ->
expect(table.getColumnCount()).toEqual(3)
expect(table.getColumn(1)).toEqual('required')
expect(table.getColumn(2)).toEqual('value')
it 'extend the existing rows at the right place', ->
expect(table.getRow(0).length).toEqual(3)
expect(table.getRow(1).length).toEqual(3)
it 'throws an error if the index is negative', ->
expect(-> table.addColumnAt -1, 'foo').toThrow()
describe 'removing a column', ->
describe 'when there is alredy rows in the table', ->
beforeEach ->
spy = jasmine.createSpy 'removeColumn'
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
table.onDidRemoveColumn spy
table.removeColumn('value')
it 'removes the column', ->
expect(table.getColumnCount()).toEqual(1)
it 'dispatches a did-add-column event', ->
expect(spy).toHaveBeenCalled()
it 'removes the corresponding row cell', ->
expect(table.getRow(0).length).toEqual(1)
expect(table.getRow(1).length).toEqual(1)
it 'throws an exception when the column is undefined', ->
expect(-> table.removeColumn()).toThrow()
it 'throws an error with a negative index', ->
expect(-> table.removeColumnAt(-1)).toThrow()
it 'throws an error with an index greater that the columns count', ->
expect(-> table.removeColumnAt(2)).toThrow()
describe 'when saved', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
table.save()
table.removeColumn('value')
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe 'changing a column name', ->
beforeEach ->
row = table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
it 'changes the column name', ->
table.changeColumnName 'value', 'content'
expect(table.getColumn(1)).toEqual('content')
describe 'when saved', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.save()
table.changeColumnName 'value', 'content'
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
# ######## ####### ## ## ######
# ## ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ##
# ######## ## ## ## ## ## ######
# ## ## ## ## ## ## ## ##
# ## ## ## ## ## ## ## ## ##
# ## ## ####### ### ### ######
describe 'adding a row', ->
describe 'with an object', ->
it 'is marked as modified', ->
table.addRow key: 'foo', value: 'bar'
expect(table.isModified()).toBeTruthy()
it 'creates a row containing the values', ->
table.addRow key: 'foo', value: 'bar'
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
it 'dispatches a did-add-row event', ->
spy = jasmine.createSpy 'addRow'
table.onDidAddRow spy
table.addRow key: 'foo', value: 'bar'
expect(spy).toHaveBeenCalled()
it 'dispatches a did-change event', ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRow key: 'foo', value: 'bar'
expect(spy).toHaveBeenCalled()
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 0}
newRange: {start: 0, end: 1}
})
it "fills the row with undefined values", ->
row = table.addRow {}
expect(row).toEqual(new Array(2))
it 'ignores data that not match any column', ->
row = table.addRow key: 'foo', data: 'fooo'
expect(row).toEqual(['foo', undefined])
describe 'at a specified index', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
it 'inserts the row at the specified position', ->
table.addRowAt(1, key: 'hello', value: 'world')
expect(table.getRowCount()).toEqual(3)
expect(table.getRow(1)).toEqual(['hello','world'])
it 'throws an error if the index is negative', ->
expect(-> table.addRowAt -1, {}).toThrow()
it 'dispatches a did-change event', ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRowAt(1, key: 'hello', value: 'world')
expect(spy).toHaveBeenCalled()
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 1, end: 1}
newRange: {start: 1, end: 2}
})
describe 'with an array', ->
it 'creates a row with a cell for each value', ->
table.addRow ['foo', 'bar']
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
it "fills the row with undefined values", ->
row = table.addRow []
expect(row).toEqual(new Array(2))
describe 'at a specified index', ->
beforeEach ->
table.addRow ['foo', 'bar']
table.addRow ['oof', 'rab']
it 'inserts the row at the specified position', ->
table.addRowAt(1, ['hello', 'world'])
expect(table.getRowCount()).toEqual(3)
expect(table.getRow(1)).toEqual(['hello', 'world'])
describe 'adding many rows', ->
beforeEach ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRows [
{ key: 'foo', value: 'bar' }
{ key: 'oof', value: 'rab' }
]
it 'adds the rows in the table', ->
expect(table.getRowCount()).toEqual(2)
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
it 'dispatch only one did-change event', ->
expect(spy).toHaveBeenCalled()
expect(spy.calls.length).toEqual(1)
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 0}
newRange: {start: 0, end: 2}
})
describe 'at a given index', ->
beforeEach ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.addRowsAt 1, [
{ key: 'foo', value: 'bar' }
{ key: 'oof', value: 'rab' }
]
it 'adds the rows in the table', ->
expect(table.getRowCount()).toEqual(4)
it 'dispatch only one did-change event', ->
expect(spy).toHaveBeenCalled()
expect(spy.calls.length).toEqual(1)
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 1, end: 1}
newRange: {start: 1, end: 3}
})
describe '::removeRow', ->
beforeEach ->
spy = jasmine.createSpy 'removeRow'
row = table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.onDidRemoveRow spy
it 'removes the row', ->
table.removeRow(row)
expect(table.getRowCount()).toEqual(1)
it 'dispatches a did-remove-row event', ->
table.removeRow(row)
expect(spy).toHaveBeenCalled()
it 'dispatches a did-change event', ->
spy = jasmine.createSpy 'changeRows'
table.onDidChange spy
table.removeRow(row)
expect(spy).toHaveBeenCalled()
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 1}
newRange: {start: 0, end: 0}
})
it 'throws an exception when the row is undefined', ->
expect(-> table.removeRow()).toThrow()
it 'throws an exception when the row is not in the table', ->
expect(-> table.removeRow({})).toThrow()
it 'throws an error with a negative index', ->
expect(-> table.removeRowAt(-1)).toThrow()
it 'throws an error with an index greater that the rows count', ->
expect(-> table.removeRowAt(2)).toThrow()
describe 'when saved', ->
beforeEach ->
table.save()
table.removeRow(row)
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::removeRowsInRange', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
spy = jasmine.createSpy 'removeRows'
table.onDidChange spy
it 'removes the rows from the table', ->
table.removeRowsInRange([0,2])
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['ofo', 'arb'])
it 'dispatches a single did-change', ->
table.removeRowsInRange([0,2])
expect(spy).toHaveBeenCalled()
expect(spy.calls.length).toEqual(1)
expect(spy.calls[0].args[0]).toEqual({
oldRange: {start: 0, end: 2}
newRange: {start: 0, end: 0}
})
it 'throws an error without range', ->
expect(-> table.removeRowsInRange()).toThrow()
it 'throws an error with an invalid range', ->
expect(-> table.removeRowsInRange {start: 1}).toThrow()
expect(-> table.removeRowsInRange [1]).toThrow()
describe 'with a range running to infinity', ->
it 'removes all the rows in the table', ->
table.removeRowsInRange([0, Infinity])
expect(table.getRowCount()).toEqual(0)
describe 'when saved', ->
beforeEach ->
table.save()
table.removeRowsInRange([0,2])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::removeRowsAtIndices', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
spy = jasmine.createSpy 'removeRows'
table.onDidChange spy
it 'removes the rows at indices', ->
table.removeRowsAtIndices([0,2])
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['oof','rab'])
describe 'when saved', ->
beforeEach ->
table.save()
table.removeRowsAtIndices([0,2])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::swapRows', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
it 'swaps the rows', ->
table.swapRows(0,2)
expect(table.getRows()).toEqual([
['ofo','arb']
['oof','rab']
['foo','bar']
])
it 'dispatches a change event', ->
changeSpy = jasmine.createSpy('did-change')
table.onDidChange(changeSpy)
table.swapRows(0,2)
expect(changeSpy).toHaveBeenCalledWith({rowIndices: [0,2]})
describe '::swapColumns', ->
beforeEach ->
table.addRow key: 'foo', value: 'bar'
table.addRow key: 'oof', value: 'rab'
table.addRow key: 'ofo', value: 'arb'
it 'swaps the column', ->
table.swapColumns(0,1)
expect(table.getRows()).toEqual([
['bar', 'foo']
['rab', 'oof']
['arb', 'ofo']
])
expect(table.getColumn(0)).toEqual('value')
expect(table.getColumn(1)).toEqual('key')
it 'dispatches a change event', ->
changeSpy = jasmine.createSpy('did-change')
swapSpy = jasmine.createSpy('did-swap-columns')
table.onDidChange(changeSpy)
table.onDidSwapColumns(swapSpy)
table.swapColumns(0,1)
expect(changeSpy).toHaveBeenCalledWith({
oldRange: {start: 0, end: 3}
newRange: {start: 0, end: 3}
})
expect(swapSpy).toHaveBeenCalledWith({
columnA: 0
columnB: 1
})
# ###### ######## ## ## ######
# ## ## ## ## ## ## ##
# ## ## ## ## ##
# ## ###### ## ## ######
# ## ## ## ## ##
# ## ## ## ## ## ## ##
# ###### ######## ######## ######## ######
describe '::getValueAtPosition', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['PI:NAME:<NAME>END_PI', 30])
table.addRow(['PI:NAME:<NAME>END_PI', 30])
it 'returns the cell at the given position array', ->
expect(table.getValueAtPosition([1,0])).toEqual('PI:NAME:<NAME>END_PI')
it 'returns the cell at the given position object', ->
expect(table.getValueAtPosition(row: 1, column: 0)).toEqual('PI:NAME:<NAME>END_PI')
it 'throws an error without a position', ->
expect(-> table.getValueAtPosition()).toThrow()
it 'returns undefined with a position out of bounds', ->
expect(table.getValueAtPosition(row: 2, column: 0)).toBeUndefined()
expect(table.getValueAtPosition(row: 0, column: 2)).toBeUndefined()
describe '::setValueAtPosition', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['PI:NAME:<NAME>END_PI', 30])
table.addRow(['PI:NAME:<NAME>END_PI', 30])
it 'changes the value at the given position', ->
table.setValueAtPosition([1,1], 40)
expect(table.getRow(1)).toEqual(['PI:NAME:<NAME>END_PI', 40])
it 'emits a did-change-cell-value event', ->
spy = jasmine.createSpy('did-change-cell-value')
table.onDidChangeCellValue(spy)
table.setValueAtPosition([1,1], 40)
expect(spy).toHaveBeenCalled()
describe 'when saved', ->
beforeEach ->
table.save()
table.setValueAtPosition([1,1], 40)
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::setValuesAtPositions', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['PI:NAME:<NAME>END_PI', 30])
table.addRow(['PI:NAME:<NAME>END_PI', 30])
it 'changes the value at the given position', ->
table.setValuesAtPositions([[0,1], [1,1]],[40, 40])
expect(table.getRow(0)).toEqual(['PI:NAME:<NAME>END_PI', 40])
expect(table.getRow(1)).toEqual(['PI:NAME:<NAME>END_PI', 40])
it 'emits a did-change-cell-value event', ->
spy = jasmine.createSpy('did-change-cell-value')
table.onDidChangeCellValue(spy)
table.setValuesAtPositions([[0,1], [1,1]],[40, 40])
expect(spy).toHaveBeenCalled()
describe 'when saved', ->
beforeEach ->
table.save()
table.setValuesAtPositions([[0,1], [1,1]],[40, 40])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
describe '::setValuesInRange', ->
beforeEach ->
table.addColumn('name')
table.addColumn('age')
table.addRow(['PI:NAME:<NAME>END_PI', 30])
table.addRow(['PI:NAME:<NAME>END_PI', 30])
it 'changes the value at the given position', ->
table.setValuesInRange([[0,1], [2,2]],[[40], [40]])
expect(table.getRow(0)).toEqual(['PI:NAME:<NAME>END_PI', 40])
expect(table.getRow(1)).toEqual(['PI:NAME:<NAME>END_PI', 40])
it 'emits a did-change-cell-value event', ->
spy = jasmine.createSpy('did-change-cell-value')
table.onDidChangeCellValue(spy)
table.setValuesInRange([[0,1], [2,2]],[[40], [40]])
expect(spy).toHaveBeenCalled()
describe 'when saved', ->
beforeEach ->
table.save()
table.setValuesInRange([[0,1], [2,2]],[[40], [40]])
it 'is marked as modified', ->
expect(table.isModified()).toBeTruthy()
# ## ## ## ## ######## #######
# ## ## ### ## ## ## ## ##
# ## ## #### ## ## ## ## ##
# ## ## ## ## ## ## ## ## ##
# ## ## ## #### ## ## ## ##
# ## ## ## ### ## ## ## ##
# ####### ## ## ######## #######
describe 'transactions', ->
it 'drops old transactions when reaching the size limit', ->
Table.MAX_HISTORY_SIZE = 10
table.addColumn('foo')
table.addRow ["foo#{i}"] for i in [0...20]
expect(table.undoStack.length).toEqual(10)
table.undo()
expect(table.getLastRow()).toEqual(['foo18'])
it 'rolls back a column addition', ->
table.addColumn('key')
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getColumnCount()).toEqual(0)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getColumnCount()).toEqual(1)
expect(table.getColumn(0)).toEqual('key')
it 'rolls back a column deletion', ->
column = table.addColumn('key')
table.addRow(['foo'])
table.addRow(['bar'])
table.addRow(['baz'])
table.clearUndoStack()
table.removeColumn(column)
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getColumnCount()).toEqual(1)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getColumn(0)).toEqual('key')
expect(table.getRow(0)).toEqual(['foo'])
expect(table.getRow(1)).toEqual(['bar'])
expect(table.getRow(2)).toEqual(['baz'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getColumnCount()).toEqual(0)
describe 'with columns in the table', ->
beforeEach ->
table.addColumn('key')
column = table.addColumn('value')
it 'rolls back a row addition', ->
table.clearUndoStack()
row = table.addRow ['foo', 'bar']
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(0)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
it 'rolls back a batched rows addition', ->
table.clearUndoStack()
rows = table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(0)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(2)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
it 'rolls back a row deletion', ->
row = table.addRow ['foo', 'bar']
table.clearUndoStack()
table.removeRowAt(0)
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(1)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(0)
it 'rolls back a batched rows deletion', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.removeRowsInRange([0,2])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(2)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(0)
it 'rolls back a batched rows deletion by indices', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
['baz', 'foo']
]
table.clearUndoStack()
table.removeRowsAtIndices([0,2])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getRowCount()).toEqual(3)
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
expect(table.getRow(2)).toEqual(['baz', 'foo'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRowCount()).toEqual(1)
it 'rolls back a change in a column', ->
table.clearUndoStack()
table.changeColumnName('value', 'foo')
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.getColumn(1)).toEqual('value')
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.getColumn(1)).toEqual('foo')
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
it 'rolls back a change in a row data', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.setValueAtPosition([0,0], 'hello')
expect(table.getRow(0)).toEqual(['hello', 'bar'])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRow(0)).toEqual(['hello', 'bar'])
it 'rolls back many changes in row data', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.setValuesAtPositions([[0,0], [1,1]], ['hello', 'world'])
expect(table.getRow(0)).toEqual(['hello', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'world'])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'baz'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRow(0)).toEqual(['hello', 'bar'])
expect(table.getRow(1)).toEqual(['bar', 'world'])
it 'rolls back many changes in row data', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.clearUndoStack()
table.setValuesInRange([[0,0], [1,2]], [['hello', 'world']])
expect(table.getRow(0)).toEqual(['hello', 'world'])
table.save()
table.undo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRow(0)).toEqual(['foo', 'bar'])
table.redo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRow(0)).toEqual(['hello', 'world'])
it 'rolls back a swap of rows', ->
table.addRows([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.clearUndoStack()
table.save()
table.swapRows(0,2)
table.undo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getRows()).toEqual([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.redo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getRows()).toEqual([
['ofo','arb']
['oof','rab']
['foo','bar']
])
it 'rolls back a swap of columns', ->
table.addRows([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.clearUndoStack()
table.save()
table.swapColumns(0,1)
table.undo()
expect(table.isModified()).toBeFalsy()
expect(table.undoStack.length).toEqual(0)
expect(table.redoStack.length).toEqual(1)
expect(table.getColumn(1)).toEqual('value')
expect(table.getColumn(0)).toEqual('key')
expect(table.getRows()).toEqual([
['foo', 'bar']
['oof', 'rab']
['ofo', 'arb']
])
table.redo()
expect(table.isModified()).toBeTruthy()
expect(table.undoStack.length).toEqual(1)
expect(table.redoStack.length).toEqual(0)
expect(table.getColumn(0)).toEqual('value')
expect(table.getColumn(1)).toEqual('key')
expect(table.getRows()).toEqual([
['bar', 'foo']
['rab', 'oof']
['arb', 'ofo']
])
describe '::clearUndoStack', ->
it 'removes all the transactions in the undo stack', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.setValueAtPosition([0, 0], 'hello')
table.undo()
table.clearUndoStack()
expect(table.undoStack.length).toEqual(0)
describe '::clearRedoStack', ->
it 'removes all the transactions in the redo stack', ->
table.addRows [
['foo', 'bar']
['bar', 'baz']
]
table.setValueAtPosition([0, 0], 'hello')
table.undo()
table.clearRedoStack()
expect(table.redoStack.length).toEqual(0)
|
[
{
"context": " backbone-orm.js 0.7.14\n Copyright (c) 2013-2016 Vidigami\n License: MIT (http://www.opensource.org/license",
"end": 63,
"score": 0.9998612403869629,
"start": 55,
"tag": "NAME",
"value": "Vidigami"
},
{
"context": "ses/mit-license.php)\n Source: https://github.com/vidigami/backbone-orm\n Dependencies: Backbone.js and Unde",
"end": 169,
"score": 0.9922344088554382,
"start": 161,
"tag": "USERNAME",
"value": "vidigami"
}
] | src/lib/cursor.coffee | dk-dev/backbone-orm | 54 | ###
backbone-orm.js 0.7.14
Copyright (c) 2013-2016 Vidigami
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Source: https://github.com/vidigami/backbone-orm
Dependencies: Backbone.js and Underscore.js.
###
_ = require 'underscore'
Utils = require './utils'
JSONUtils = require './json_utils'
CURSOR_KEYS = ['$count', '$exists', '$zero', '$one', '$offset', '$limit', '$page', '$sort', '$unique', '$whitelist', '$select', '$include', '$values', '$ids', '$or']
module.exports = class Cursor
# @nodoc
constructor: (query, options) ->
@[key] = value for key, value of options
parsed_query = Cursor.parseQuery(query, @model_type)
@_find = parsed_query.find; @_cursor = parsed_query.cursor
# ensure arrays
@_cursor[key] = [@_cursor[key]] for key in ['$whitelist', '$select', '$values', '$unique'] when @_cursor[key] and not _.isArray(@_cursor[key])
# @nodoc
@validateQuery = (query, memo, model_type) =>
for key, value of query
continue unless _.isUndefined(value) or _.isObject(value)
full_key = if memo then "#{memo}.#{key}" else key
throw new Error "Unexpected undefined for query key '#{full_key}' on #{model_type?.model_name}" if _.isUndefined(value)
@validateQuery(value, full_key, model_type) if _.isObject(value)
# @nodoc
@parseQuery: (query, model_type) =>
if not query
return {find: {}, cursor: {}}
else if not _.isObject(query)
return {find: {id: query}, cursor: {$one: true}}
else if query.find or query.cursor
return {find: query.find or {}, cursor: query.cursor or {}}
else
try
@validateQuery(query, null, model_type)
catch e
throw new Error "Error: #{e}. Query: ", query
parsed_query = {find: {}, cursor: {}}
for key, value of query
if key[0] isnt '$' then (parsed_query.find[key] = value) else (parsed_query.cursor[key] = value)
return parsed_query
offset: (offset) -> @_cursor.$offset = offset; return @
limit: (limit) -> @_cursor.$limit = limit; return @
sort: (sort) -> @_cursor.$sort = sort; return @
whiteList: (args) ->
keys = _.flatten(arguments)
@_cursor.$whitelist = if @_cursor.$whitelist then _.intersection(@_cursor.$whitelist, keys) else keys
return @
select: (args) ->
keys = _.flatten(arguments)
@_cursor.$select = if @_cursor.$select then _.intersection(@_cursor.$select, keys) else keys
return @
include: (args) ->
keys = _.flatten(arguments)
@_cursor.$include = if @_cursor.$include then _.intersection(@_cursor.$include, keys) else keys
return @
values: (args) ->
keys = _.flatten(arguments)
@_cursor.$values = if @_cursor.$values then _.intersection(@_cursor.$values, keys) else keys
return @
unique: (args) ->
keys = _.flatten(arguments)
@_cursor.$unique = if @_cursor.$unique then _.intersection(@_cursor.$unique, keys) else keys
return @
# @nodoc
ids: -> @_cursor.$values = ['id']; return @
##############################################
# Execution of the Query
count: (callback) -> @execWithCursorQuery('$count', 'toJSON', callback)
exists: (callback) -> @execWithCursorQuery('$exists', 'toJSON', callback)
toModel: (callback) -> @execWithCursorQuery('$one', 'toModels', callback)
toModels: (callback) ->
return callback(new Error "Cannot call toModels on cursor with values for model #{@model_type.model_name}. Values: #{JSONUtils.stringify(@_cursor.$values)}") if @_cursor.$values
@toJSON (err, json) =>
return callback(err) if err
return callback(null, null) if @_cursor.$one and not json
json = [json] unless _.isArray(json)
@prepareIncludes json, (err, json) =>
if can_cache = !(@_cursor.$select or @_cursor.$whitelist) # don't cache if we may not have fetched the full model
models = (Utils.updateOrNew(item, @model_type) for item in json)
else
models = ((model = new @model_type(@model_type::parse(item)); model.setPartial(true); model) for item in json)
return callback(null, if @_cursor.$one then models[0] else models)
toJSON: (callback) -> @queryToJSON(callback)
# @nodoc
# Provided by a concrete cursor for a Backbone Sync type
queryToJSON: (callback) -> throw new Error 'queryToJSON must be implemented by a concrete cursor for a Backbone Sync type'
##############################################
# Helpers
##############################################
# @nodoc
hasCursorQuery: (key) -> return @_cursor[key] or (@_cursor[key] is '')
# @nodoc
execWithCursorQuery: (key, method, callback) ->
value = @_cursor[key]
@_cursor[key] = true
@[method] (err, json) =>
if _.isUndefined(value) then delete @_cursor[key] else (@_cursor[key] = value)
callback(err, json)
# @nodoc
relatedModelTypesInQuery: =>
related_fields = []
related_model_types = []
for key, value of @_find
# A dot indicates a condition on a related model
if key.indexOf('.') > 0
[relation_key, key] = key.split('.')
related_fields.push(relation_key)
# Many to Many relationships may be queried on the foreign key of the join table
else if (reverse_relation = @model_type.reverseRelation(key)) and reverse_relation.join_table
related_model_types.push(reverse_relation.model_type)
related_model_types.push(reverse_relation.join_table)
related_fields = related_fields.concat(@_cursor.$include) if @_cursor?.$include
for relation_key in related_fields
if relation = @model_type.relation(relation_key)
related_model_types.push(relation.reverse_model_type)
related_model_types.push(relation.join_table) if relation.join_table
return related_model_types
# @nodoc
selectResults: (json) ->
json = json.slice(0, 1) if @_cursor.$one
# TODO: OPTIMIZE TO REMOVE 'id' and '_rev' if needed
if @_cursor.$values
$values = if @_cursor.$whitelist then _.intersection(@_cursor.$values, @_cursor.$whitelist) else @_cursor.$values
if @_cursor.$values.length is 1
key = @_cursor.$values[0]
json = if $values.length then ((if item.hasOwnProperty(key) then item[key] else null) for item in json) else _.map(json, -> null)
else
json = (((item[key] for key in $values when item.hasOwnProperty(key))) for item in json)
else if @_cursor.$select
$select = if @_cursor.$whitelist then _.intersection(@_cursor.$select, @_cursor.$whitelist) else @_cursor.$select
json = (_.pick(item, $select) for item in json)
else if @_cursor.$whitelist
json = (_.pick(item, @_cursor.$whitelist) for item in json)
return json if @hasCursorQuery('$page') # paging expects an array
return if @_cursor.$one then (json[0] or null) else json
# @nodoc
selectFromModels: (models, callback) ->
if @_cursor.$select
$select = if @_cursor.$whitelist then _.intersection(@_cursor.$select, @_cursor.$whitelist) else @_cursor.$select
models = (model = new @model_type(_.pick(model.attributes, $select)); model.setPartial(true); model for item in models)
else if @_cursor.$whitelist
models = (model = new @model_type(_.pick(model.attributes, @_cursor.$whitelist)); model.setPartial(true); model for item in models)
return models
# @nodoc
prepareIncludes: (json, callback) ->
return callback(null, json) if not _.isArray(@_cursor.$include) or _.isEmpty(@_cursor.$include)
schema = @model_type.schema()
shared_related_models = {}
findOrNew = (related_json, reverse_model_type) =>
related_id = related_json[reverse_model_type::idAttribute]
unless shared_related_models[related_id]
if reverse_model_type.cache
unless shared_related_models[related_id] = reverse_model_type.cache.get(related_id)
reverse_model_type.cache.set(related_id, shared_related_models[related_id] = new reverse_model_type(related_json))
else
shared_related_models[related_id] = new reverse_model_type(related_json)
return shared_related_models[related_id]
for include in @_cursor.$include
relation = schema.relation(include)
shared_related_models = {} # reset
for model_json in json
# many
if _.isArray(related_json = model_json[include])
model_json[include] = (findOrNew(item, relation.reverse_model_type) for item in related_json)
# one
else if related_json
model_json[include] = findOrNew(related_json, relation.reverse_model_type)
callback(null, json)
| 8592 | ###
backbone-orm.js 0.7.14
Copyright (c) 2013-2016 <NAME>
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Source: https://github.com/vidigami/backbone-orm
Dependencies: Backbone.js and Underscore.js.
###
_ = require 'underscore'
Utils = require './utils'
JSONUtils = require './json_utils'
CURSOR_KEYS = ['$count', '$exists', '$zero', '$one', '$offset', '$limit', '$page', '$sort', '$unique', '$whitelist', '$select', '$include', '$values', '$ids', '$or']
module.exports = class Cursor
# @nodoc
constructor: (query, options) ->
@[key] = value for key, value of options
parsed_query = Cursor.parseQuery(query, @model_type)
@_find = parsed_query.find; @_cursor = parsed_query.cursor
# ensure arrays
@_cursor[key] = [@_cursor[key]] for key in ['$whitelist', '$select', '$values', '$unique'] when @_cursor[key] and not _.isArray(@_cursor[key])
# @nodoc
@validateQuery = (query, memo, model_type) =>
for key, value of query
continue unless _.isUndefined(value) or _.isObject(value)
full_key = if memo then "#{memo}.#{key}" else key
throw new Error "Unexpected undefined for query key '#{full_key}' on #{model_type?.model_name}" if _.isUndefined(value)
@validateQuery(value, full_key, model_type) if _.isObject(value)
# @nodoc
@parseQuery: (query, model_type) =>
if not query
return {find: {}, cursor: {}}
else if not _.isObject(query)
return {find: {id: query}, cursor: {$one: true}}
else if query.find or query.cursor
return {find: query.find or {}, cursor: query.cursor or {}}
else
try
@validateQuery(query, null, model_type)
catch e
throw new Error "Error: #{e}. Query: ", query
parsed_query = {find: {}, cursor: {}}
for key, value of query
if key[0] isnt '$' then (parsed_query.find[key] = value) else (parsed_query.cursor[key] = value)
return parsed_query
offset: (offset) -> @_cursor.$offset = offset; return @
limit: (limit) -> @_cursor.$limit = limit; return @
sort: (sort) -> @_cursor.$sort = sort; return @
whiteList: (args) ->
keys = _.flatten(arguments)
@_cursor.$whitelist = if @_cursor.$whitelist then _.intersection(@_cursor.$whitelist, keys) else keys
return @
select: (args) ->
keys = _.flatten(arguments)
@_cursor.$select = if @_cursor.$select then _.intersection(@_cursor.$select, keys) else keys
return @
include: (args) ->
keys = _.flatten(arguments)
@_cursor.$include = if @_cursor.$include then _.intersection(@_cursor.$include, keys) else keys
return @
values: (args) ->
keys = _.flatten(arguments)
@_cursor.$values = if @_cursor.$values then _.intersection(@_cursor.$values, keys) else keys
return @
unique: (args) ->
keys = _.flatten(arguments)
@_cursor.$unique = if @_cursor.$unique then _.intersection(@_cursor.$unique, keys) else keys
return @
# @nodoc
ids: -> @_cursor.$values = ['id']; return @
##############################################
# Execution of the Query
count: (callback) -> @execWithCursorQuery('$count', 'toJSON', callback)
exists: (callback) -> @execWithCursorQuery('$exists', 'toJSON', callback)
toModel: (callback) -> @execWithCursorQuery('$one', 'toModels', callback)
toModels: (callback) ->
return callback(new Error "Cannot call toModels on cursor with values for model #{@model_type.model_name}. Values: #{JSONUtils.stringify(@_cursor.$values)}") if @_cursor.$values
@toJSON (err, json) =>
return callback(err) if err
return callback(null, null) if @_cursor.$one and not json
json = [json] unless _.isArray(json)
@prepareIncludes json, (err, json) =>
if can_cache = !(@_cursor.$select or @_cursor.$whitelist) # don't cache if we may not have fetched the full model
models = (Utils.updateOrNew(item, @model_type) for item in json)
else
models = ((model = new @model_type(@model_type::parse(item)); model.setPartial(true); model) for item in json)
return callback(null, if @_cursor.$one then models[0] else models)
toJSON: (callback) -> @queryToJSON(callback)
# @nodoc
# Provided by a concrete cursor for a Backbone Sync type
queryToJSON: (callback) -> throw new Error 'queryToJSON must be implemented by a concrete cursor for a Backbone Sync type'
##############################################
# Helpers
##############################################
# @nodoc
hasCursorQuery: (key) -> return @_cursor[key] or (@_cursor[key] is '')
# @nodoc
execWithCursorQuery: (key, method, callback) ->
value = @_cursor[key]
@_cursor[key] = true
@[method] (err, json) =>
if _.isUndefined(value) then delete @_cursor[key] else (@_cursor[key] = value)
callback(err, json)
# @nodoc
relatedModelTypesInQuery: =>
related_fields = []
related_model_types = []
for key, value of @_find
# A dot indicates a condition on a related model
if key.indexOf('.') > 0
[relation_key, key] = key.split('.')
related_fields.push(relation_key)
# Many to Many relationships may be queried on the foreign key of the join table
else if (reverse_relation = @model_type.reverseRelation(key)) and reverse_relation.join_table
related_model_types.push(reverse_relation.model_type)
related_model_types.push(reverse_relation.join_table)
related_fields = related_fields.concat(@_cursor.$include) if @_cursor?.$include
for relation_key in related_fields
if relation = @model_type.relation(relation_key)
related_model_types.push(relation.reverse_model_type)
related_model_types.push(relation.join_table) if relation.join_table
return related_model_types
# @nodoc
selectResults: (json) ->
json = json.slice(0, 1) if @_cursor.$one
# TODO: OPTIMIZE TO REMOVE 'id' and '_rev' if needed
if @_cursor.$values
$values = if @_cursor.$whitelist then _.intersection(@_cursor.$values, @_cursor.$whitelist) else @_cursor.$values
if @_cursor.$values.length is 1
key = @_cursor.$values[0]
json = if $values.length then ((if item.hasOwnProperty(key) then item[key] else null) for item in json) else _.map(json, -> null)
else
json = (((item[key] for key in $values when item.hasOwnProperty(key))) for item in json)
else if @_cursor.$select
$select = if @_cursor.$whitelist then _.intersection(@_cursor.$select, @_cursor.$whitelist) else @_cursor.$select
json = (_.pick(item, $select) for item in json)
else if @_cursor.$whitelist
json = (_.pick(item, @_cursor.$whitelist) for item in json)
return json if @hasCursorQuery('$page') # paging expects an array
return if @_cursor.$one then (json[0] or null) else json
# @nodoc
selectFromModels: (models, callback) ->
if @_cursor.$select
$select = if @_cursor.$whitelist then _.intersection(@_cursor.$select, @_cursor.$whitelist) else @_cursor.$select
models = (model = new @model_type(_.pick(model.attributes, $select)); model.setPartial(true); model for item in models)
else if @_cursor.$whitelist
models = (model = new @model_type(_.pick(model.attributes, @_cursor.$whitelist)); model.setPartial(true); model for item in models)
return models
# @nodoc
prepareIncludes: (json, callback) ->
return callback(null, json) if not _.isArray(@_cursor.$include) or _.isEmpty(@_cursor.$include)
schema = @model_type.schema()
shared_related_models = {}
findOrNew = (related_json, reverse_model_type) =>
related_id = related_json[reverse_model_type::idAttribute]
unless shared_related_models[related_id]
if reverse_model_type.cache
unless shared_related_models[related_id] = reverse_model_type.cache.get(related_id)
reverse_model_type.cache.set(related_id, shared_related_models[related_id] = new reverse_model_type(related_json))
else
shared_related_models[related_id] = new reverse_model_type(related_json)
return shared_related_models[related_id]
for include in @_cursor.$include
relation = schema.relation(include)
shared_related_models = {} # reset
for model_json in json
# many
if _.isArray(related_json = model_json[include])
model_json[include] = (findOrNew(item, relation.reverse_model_type) for item in related_json)
# one
else if related_json
model_json[include] = findOrNew(related_json, relation.reverse_model_type)
callback(null, json)
| true | ###
backbone-orm.js 0.7.14
Copyright (c) 2013-2016 PI:NAME:<NAME>END_PI
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Source: https://github.com/vidigami/backbone-orm
Dependencies: Backbone.js and Underscore.js.
###
_ = require 'underscore'
Utils = require './utils'
JSONUtils = require './json_utils'
CURSOR_KEYS = ['$count', '$exists', '$zero', '$one', '$offset', '$limit', '$page', '$sort', '$unique', '$whitelist', '$select', '$include', '$values', '$ids', '$or']
module.exports = class Cursor
# @nodoc
constructor: (query, options) ->
@[key] = value for key, value of options
parsed_query = Cursor.parseQuery(query, @model_type)
@_find = parsed_query.find; @_cursor = parsed_query.cursor
# ensure arrays
@_cursor[key] = [@_cursor[key]] for key in ['$whitelist', '$select', '$values', '$unique'] when @_cursor[key] and not _.isArray(@_cursor[key])
# @nodoc
@validateQuery = (query, memo, model_type) =>
for key, value of query
continue unless _.isUndefined(value) or _.isObject(value)
full_key = if memo then "#{memo}.#{key}" else key
throw new Error "Unexpected undefined for query key '#{full_key}' on #{model_type?.model_name}" if _.isUndefined(value)
@validateQuery(value, full_key, model_type) if _.isObject(value)
# @nodoc
@parseQuery: (query, model_type) =>
if not query
return {find: {}, cursor: {}}
else if not _.isObject(query)
return {find: {id: query}, cursor: {$one: true}}
else if query.find or query.cursor
return {find: query.find or {}, cursor: query.cursor or {}}
else
try
@validateQuery(query, null, model_type)
catch e
throw new Error "Error: #{e}. Query: ", query
parsed_query = {find: {}, cursor: {}}
for key, value of query
if key[0] isnt '$' then (parsed_query.find[key] = value) else (parsed_query.cursor[key] = value)
return parsed_query
offset: (offset) -> @_cursor.$offset = offset; return @
limit: (limit) -> @_cursor.$limit = limit; return @
sort: (sort) -> @_cursor.$sort = sort; return @
whiteList: (args) ->
keys = _.flatten(arguments)
@_cursor.$whitelist = if @_cursor.$whitelist then _.intersection(@_cursor.$whitelist, keys) else keys
return @
select: (args) ->
keys = _.flatten(arguments)
@_cursor.$select = if @_cursor.$select then _.intersection(@_cursor.$select, keys) else keys
return @
include: (args) ->
keys = _.flatten(arguments)
@_cursor.$include = if @_cursor.$include then _.intersection(@_cursor.$include, keys) else keys
return @
values: (args) ->
keys = _.flatten(arguments)
@_cursor.$values = if @_cursor.$values then _.intersection(@_cursor.$values, keys) else keys
return @
unique: (args) ->
keys = _.flatten(arguments)
@_cursor.$unique = if @_cursor.$unique then _.intersection(@_cursor.$unique, keys) else keys
return @
# @nodoc
ids: -> @_cursor.$values = ['id']; return @
##############################################
# Execution of the Query
count: (callback) -> @execWithCursorQuery('$count', 'toJSON', callback)
exists: (callback) -> @execWithCursorQuery('$exists', 'toJSON', callback)
toModel: (callback) -> @execWithCursorQuery('$one', 'toModels', callback)
toModels: (callback) ->
return callback(new Error "Cannot call toModels on cursor with values for model #{@model_type.model_name}. Values: #{JSONUtils.stringify(@_cursor.$values)}") if @_cursor.$values
@toJSON (err, json) =>
return callback(err) if err
return callback(null, null) if @_cursor.$one and not json
json = [json] unless _.isArray(json)
@prepareIncludes json, (err, json) =>
if can_cache = !(@_cursor.$select or @_cursor.$whitelist) # don't cache if we may not have fetched the full model
models = (Utils.updateOrNew(item, @model_type) for item in json)
else
models = ((model = new @model_type(@model_type::parse(item)); model.setPartial(true); model) for item in json)
return callback(null, if @_cursor.$one then models[0] else models)
toJSON: (callback) -> @queryToJSON(callback)
# @nodoc
# Provided by a concrete cursor for a Backbone Sync type
queryToJSON: (callback) -> throw new Error 'queryToJSON must be implemented by a concrete cursor for a Backbone Sync type'
##############################################
# Helpers
##############################################
# @nodoc
hasCursorQuery: (key) -> return @_cursor[key] or (@_cursor[key] is '')
# @nodoc
execWithCursorQuery: (key, method, callback) ->
value = @_cursor[key]
@_cursor[key] = true
@[method] (err, json) =>
if _.isUndefined(value) then delete @_cursor[key] else (@_cursor[key] = value)
callback(err, json)
# @nodoc
relatedModelTypesInQuery: =>
related_fields = []
related_model_types = []
for key, value of @_find
# A dot indicates a condition on a related model
if key.indexOf('.') > 0
[relation_key, key] = key.split('.')
related_fields.push(relation_key)
# Many to Many relationships may be queried on the foreign key of the join table
else if (reverse_relation = @model_type.reverseRelation(key)) and reverse_relation.join_table
related_model_types.push(reverse_relation.model_type)
related_model_types.push(reverse_relation.join_table)
related_fields = related_fields.concat(@_cursor.$include) if @_cursor?.$include
for relation_key in related_fields
if relation = @model_type.relation(relation_key)
related_model_types.push(relation.reverse_model_type)
related_model_types.push(relation.join_table) if relation.join_table
return related_model_types
# @nodoc
selectResults: (json) ->
json = json.slice(0, 1) if @_cursor.$one
# TODO: OPTIMIZE TO REMOVE 'id' and '_rev' if needed
if @_cursor.$values
$values = if @_cursor.$whitelist then _.intersection(@_cursor.$values, @_cursor.$whitelist) else @_cursor.$values
if @_cursor.$values.length is 1
key = @_cursor.$values[0]
json = if $values.length then ((if item.hasOwnProperty(key) then item[key] else null) for item in json) else _.map(json, -> null)
else
json = (((item[key] for key in $values when item.hasOwnProperty(key))) for item in json)
else if @_cursor.$select
$select = if @_cursor.$whitelist then _.intersection(@_cursor.$select, @_cursor.$whitelist) else @_cursor.$select
json = (_.pick(item, $select) for item in json)
else if @_cursor.$whitelist
json = (_.pick(item, @_cursor.$whitelist) for item in json)
return json if @hasCursorQuery('$page') # paging expects an array
return if @_cursor.$one then (json[0] or null) else json
# @nodoc
selectFromModels: (models, callback) ->
if @_cursor.$select
$select = if @_cursor.$whitelist then _.intersection(@_cursor.$select, @_cursor.$whitelist) else @_cursor.$select
models = (model = new @model_type(_.pick(model.attributes, $select)); model.setPartial(true); model for item in models)
else if @_cursor.$whitelist
models = (model = new @model_type(_.pick(model.attributes, @_cursor.$whitelist)); model.setPartial(true); model for item in models)
return models
# @nodoc
prepareIncludes: (json, callback) ->
return callback(null, json) if not _.isArray(@_cursor.$include) or _.isEmpty(@_cursor.$include)
schema = @model_type.schema()
shared_related_models = {}
findOrNew = (related_json, reverse_model_type) =>
related_id = related_json[reverse_model_type::idAttribute]
unless shared_related_models[related_id]
if reverse_model_type.cache
unless shared_related_models[related_id] = reverse_model_type.cache.get(related_id)
reverse_model_type.cache.set(related_id, shared_related_models[related_id] = new reverse_model_type(related_json))
else
shared_related_models[related_id] = new reverse_model_type(related_json)
return shared_related_models[related_id]
for include in @_cursor.$include
relation = schema.relation(include)
shared_related_models = {} # reset
for model_json in json
# many
if _.isArray(related_json = model_json[include])
model_json[include] = (findOrNew(item, relation.reverse_model_type) for item in related_json)
# one
else if related_json
model_json[include] = findOrNew(related_json, relation.reverse_model_type)
callback(null, json)
|
[
{
"context": "ire \"./src/api.coffee\"\n\nFirstRally.set\n api_key: \"66fef8f84648b0a9190265296bb210c9\"\n api_key_secret: \"a11dc2b47c9f059d31a1d1d3b63723",
"end": 187,
"score": 0.9996445775032043,
"start": 155,
"tag": "KEY",
"value": "66fef8f84648b0a9190265296bb210c9"
},
{
"context": "fef8f84648b0a9190265296bb210c9\"\n api_key_secret: \"a11dc2b47c9f059d31a1d1d3b63723c90802bcdaaa0cb890b85c89971b591bf1\"\n\n# FirstRally.DataStream.list (error, body) ->\n#",
"end": 271,
"score": 0.9997845888137817,
"start": 207,
"tag": "KEY",
"value": "a11dc2b47c9f059d31a1d1d3b63723c90802bcdaaa0cb890b85c89971b591bf1"
},
{
"context": "# FirstRally.User.update_profile\n# first_name: \"Tim\"\n# last_name: \"Coulter\"\n# email: \"tim@timothy",
"end": 458,
"score": 0.9998318552970886,
"start": 455,
"tag": "NAME",
"value": "Tim"
},
{
"context": "ate_profile\n# first_name: \"Tim\"\n# last_name: \"Coulter\"\n# email: \"tim@timothyjcoulter.com\"\n# passwor",
"end": 483,
"score": 0.9935693144798279,
"start": 476,
"tag": "NAME",
"value": "Coulter"
},
{
"context": "_name: \"Tim\"\n# last_name: \"Coulter\"\n# email: \"tim@timothyjcoulter.com\"\n# password: \"Wrong password!\"\n# , (error, json",
"end": 520,
"score": 0.9999197125434875,
"start": 497,
"tag": "EMAIL",
"value": "tim@timothyjcoulter.com"
},
{
"context": " email: \"tim@timothyjcoulter.com\"\n# password: \"Wrong password!\"\n# , (error, json) ->\n# console.log error\n# co",
"end": 551,
"score": 0.9993292689323425,
"start": 537,
"tag": "PASSWORD",
"value": "Wrong password"
}
] | example.coffee | firstrally/api | 1 | #!/usr/bin/env coffee
fs = require "fs"
#FirstRally = require "./dist/firstrally-api"
FirstRally = require "./src/api.coffee"
FirstRally.set
api_key: "66fef8f84648b0a9190265296bb210c9"
api_key_secret: "a11dc2b47c9f059d31a1d1d3b63723c90802bcdaaa0cb890b85c89971b591bf1"
# FirstRally.DataStream.list (error, body) ->
# console.log body
# If no error, body is a list of streams. See documentation.
# FirstRally.User.update_profile
# first_name: "Tim"
# last_name: "Coulter"
# email: "tim@timothyjcoulter.com"
# password: "Wrong password!"
# , (error, json) ->
# console.log error
# console.log error instanceof Error
# FirstRally.Conversion.current, "usd", "btc" (error, json) ->
# console.log error, json
# FirstRally.DataStream.subscribe "coinbase/usd/btc",
# message: (message) ->
# console.log message
# subscribe: () ->
# console.log "Subscribed!"
# # Example of what you *can't* do: Send messages.
# # You can only receive messages with our API, so you'll receive an error.
# publication = FirstRally.DataStream.client.publish("/coinbase/usd/btc", {something: "Something"})
# publication.then () ->
# # Shouldn't ever get here.
# console.log('Message received by server!')
# , (error) ->
# console.log('There was a problem: ' + error.message)
# setTimeout () ->
# console.log "Unsubscribing from stream..."
# FirstRally.DataStream.unsubscribe "coinbase/usd/btc"
# , 30000
# now = new Date()
# yesterday = new Date(now.getTime() - 86400000)
# FirstRally.DataBatch.quote "coinbase/usd/btc", yesterday, now, (error, quote) ->
# console.log error, quote
# FirstRally.DataBatch.create quote, (error, json) ->
# console.log error, json
FirstRally.DataBatch.status 28, (error, json) ->
if !json.batch_file?
console.log "No downloadable batch file yet."
return
console.log json
# FirstRally.BatchFile.download json.batch_file.id, (response) ->
# response.on "error", (err) ->
# console.log "Error! #{err.message}"
# .pipe(fs.createWriteStream(json.batch_file.file_name)) | 150934 | #!/usr/bin/env coffee
fs = require "fs"
#FirstRally = require "./dist/firstrally-api"
FirstRally = require "./src/api.coffee"
FirstRally.set
api_key: "<KEY>"
api_key_secret: "<KEY>"
# FirstRally.DataStream.list (error, body) ->
# console.log body
# If no error, body is a list of streams. See documentation.
# FirstRally.User.update_profile
# first_name: "<NAME>"
# last_name: "<NAME>"
# email: "<EMAIL>"
# password: "<PASSWORD>!"
# , (error, json) ->
# console.log error
# console.log error instanceof Error
# FirstRally.Conversion.current, "usd", "btc" (error, json) ->
# console.log error, json
# FirstRally.DataStream.subscribe "coinbase/usd/btc",
# message: (message) ->
# console.log message
# subscribe: () ->
# console.log "Subscribed!"
# # Example of what you *can't* do: Send messages.
# # You can only receive messages with our API, so you'll receive an error.
# publication = FirstRally.DataStream.client.publish("/coinbase/usd/btc", {something: "Something"})
# publication.then () ->
# # Shouldn't ever get here.
# console.log('Message received by server!')
# , (error) ->
# console.log('There was a problem: ' + error.message)
# setTimeout () ->
# console.log "Unsubscribing from stream..."
# FirstRally.DataStream.unsubscribe "coinbase/usd/btc"
# , 30000
# now = new Date()
# yesterday = new Date(now.getTime() - 86400000)
# FirstRally.DataBatch.quote "coinbase/usd/btc", yesterday, now, (error, quote) ->
# console.log error, quote
# FirstRally.DataBatch.create quote, (error, json) ->
# console.log error, json
FirstRally.DataBatch.status 28, (error, json) ->
if !json.batch_file?
console.log "No downloadable batch file yet."
return
console.log json
# FirstRally.BatchFile.download json.batch_file.id, (response) ->
# response.on "error", (err) ->
# console.log "Error! #{err.message}"
# .pipe(fs.createWriteStream(json.batch_file.file_name)) | true | #!/usr/bin/env coffee
fs = require "fs"
#FirstRally = require "./dist/firstrally-api"
FirstRally = require "./src/api.coffee"
FirstRally.set
api_key: "PI:KEY:<KEY>END_PI"
api_key_secret: "PI:KEY:<KEY>END_PI"
# FirstRally.DataStream.list (error, body) ->
# console.log body
# If no error, body is a list of streams. See documentation.
# FirstRally.User.update_profile
# first_name: "PI:NAME:<NAME>END_PI"
# last_name: "PI:NAME:<NAME>END_PI"
# email: "PI:EMAIL:<EMAIL>END_PI"
# password: "PI:PASSWORD:<PASSWORD>END_PI!"
# , (error, json) ->
# console.log error
# console.log error instanceof Error
# FirstRally.Conversion.current, "usd", "btc" (error, json) ->
# console.log error, json
# FirstRally.DataStream.subscribe "coinbase/usd/btc",
# message: (message) ->
# console.log message
# subscribe: () ->
# console.log "Subscribed!"
# # Example of what you *can't* do: Send messages.
# # You can only receive messages with our API, so you'll receive an error.
# publication = FirstRally.DataStream.client.publish("/coinbase/usd/btc", {something: "Something"})
# publication.then () ->
# # Shouldn't ever get here.
# console.log('Message received by server!')
# , (error) ->
# console.log('There was a problem: ' + error.message)
# setTimeout () ->
# console.log "Unsubscribing from stream..."
# FirstRally.DataStream.unsubscribe "coinbase/usd/btc"
# , 30000
# now = new Date()
# yesterday = new Date(now.getTime() - 86400000)
# FirstRally.DataBatch.quote "coinbase/usd/btc", yesterday, now, (error, quote) ->
# console.log error, quote
# FirstRally.DataBatch.create quote, (error, json) ->
# console.log error, json
FirstRally.DataBatch.status 28, (error, json) ->
if !json.batch_file?
console.log "No downloadable batch file yet."
return
console.log json
# FirstRally.BatchFile.download json.batch_file.id, (response) ->
# response.on "error", (err) ->
# console.log "Error! #{err.message}"
# .pipe(fs.createWriteStream(json.batch_file.file_name)) |
[
{
"context": " ds, [\n { '$key': '^pre1' }\n { '$key': '<pre2' }\n 'wat',\n { '$key': '>pre2' }\n { '$key",
"end": 5743,
"score": 0.6432263851165771,
"start": 5742,
"tag": "KEY",
"value": "2"
},
{
"context": " { text: '42', '$key': '^text' }\n { '$key': '>two' }\n { '$key': '<three' }\n { '$key': '<four'",
"end": 5883,
"score": 0.5282232165336609,
"start": 5880,
"tag": "KEY",
"value": "two"
}
] | dev/cupofjoe/src/main.tests.coffee | loveencounterflow/hengist | 0 |
'use strict'
############################################################################################################
CND = require 'cnd'
rpr = CND.rpr.bind CND
badge = 'CUPOFJOE/TESTS'
log = CND.get_logger 'plain', badge
info = CND.get_logger 'info', badge
whisper = CND.get_logger 'whisper', badge
alert = CND.get_logger 'alert', badge
debug = CND.get_logger 'debug', badge
warn = CND.get_logger 'warn', badge
help = CND.get_logger 'help', badge
urge = CND.get_logger 'urge', badge
#...........................................................................................................
# # types = require '../types'
# { isa
# validate
# type_of } = ( new ( require 'intertype' ).Intertype() ).export()
#...........................................................................................................
# CUPOFJOE = require '../../../apps/cupofjoe'
{ jr } = CND
test = require 'guy-test'
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo 1" ] = ( T, done ) ->
# debug ( k for k of ( require '../../../apps/cupofjoe' ) ); process.exit 1
{ Cupofjoe } = require '../../../apps/cupofjoe'
cupofjoe = new Cupofjoe()
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
cram null, ->
cram 'pre1'
cram 'pre2', 'wat'
cram 'one', ->
cram 'two', 42
cram 'three', ->
cram 'four', ->
cram 'five', ->
cram 'six'
cram 'post'
help rpr cupofjoe
ds = expand()
info rpr ds
info jr ds.flat Infinity
# urge '^4443^', ds
T.eq ds, [ [
[ 'pre1' ],
[ 'pre2', 'wat' ],
[ 'one',
[ 'two', 42 ],
[ 'three',
[ 'four', [ 'five', [ 'six' ] ] ] ] ],
[ 'post' ] ] ]
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo 2" ] = ( T, done ) ->
cupofjoe = new ( require '../../../apps/cupofjoe' ).Cupofjoe()
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
DATOM = new ( require 'datom' ).Datom { dirty: false, }
{ new_datom
lets
select } = DATOM.export()
#.........................................................................................................
h = ( tagname, content... ) ->
if content.length is 0
d = new_datom "^#{tagname}"
return cram d, content...
d1 = new_datom "<#{tagname}"
d2 = new_datom ">#{tagname}"
return cram d1, content..., d2
#.........................................................................................................
cram null, ->
h 'pre1'
cram null
h 'pre2', 'wat'
h 'one', ->
h 'two', ( new_datom '^text', text: '42' )
h 'three', ->
h 'four', ->
h 'five', ->
h 'six', ->
cram ( new_datom '^text', text: 'bottom' )
h 'post'
urge rpr cupofjoe.collector
ds = expand()
info jr ds
T.eq ds, [ [
[ { '$key': '^pre1' } ],
[ { '$key': '<pre2' }, 'wat', { '$key': '>pre2' } ],
[ { '$key': '<one' },
[ { '$key': '<two' },
{ text: '42', '$key': '^text' },
{ '$key': '>two' } ],
[ { '$key': '<three' },
[ { '$key': '<four' },
[ { '$key': '<five' },
[ { '$key': '<six' },
[ { text: 'bottom', '$key': '^text' } ],
{ '$key': '>six' } ],
{ '$key': '>five' } ],
{ '$key': '>four' } ],
{ '$key': '>three' } ],
{ '$key': '>one' } ],
[ { '$key': '^post' } ] ] ]
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo 2 flat" ] = ( T, done ) ->
cupofjoe = new ( require '../../../apps/cupofjoe' ).Cupofjoe { flatten: true, }
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
DATOM = new ( require 'datom' ).Datom { dirty: false, }
{ new_datom
lets
select } = DATOM.export()
#.........................................................................................................
h = ( tagname, content... ) ->
if content.length is 0
d = new_datom "^#{tagname}"
return cram d, content...
d1 = new_datom "<#{tagname}"
d2 = new_datom ">#{tagname}"
return cram d1, content..., d2
#.........................................................................................................
cram null, ->
h 'pre1'
cram null
h 'pre2', 'wat'
h 'one', ->
h 'two', ( new_datom '^text', text: '42' )
h 'three', ->
h 'four', ->
h 'five', ->
h 'six', ->
cram ( new_datom '^text', text: 'bottom' )
h 'post'
urge rpr cupofjoe.collector
ds = expand()
info jr ds
T.eq ds, [
{ '$key': '^pre1' }
{ '$key': '<pre2' }
'wat',
{ '$key': '>pre2' }
{ '$key': '<one' }
{ '$key': '<two' }
{ text: '42', '$key': '^text' }
{ '$key': '>two' }
{ '$key': '<three' }
{ '$key': '<four' }
{ '$key': '<five' }
{ '$key': '<six' }
{ text: 'bottom', '$key': '^text' }
{ '$key': '>six' }
{ '$key': '>five' }
{ '$key': '>four' }
{ '$key': '>three' }
{ '$key': '>one' }
{ '$key': '^post' } ]
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo reformat" ] = ( T, done ) ->
cupofjoe = new ( require '../../../apps/cupofjoe' ).Cupofjoe { flatten: true, }
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
h = ( tagname, content... ) ->
return cram content... if ( not tagname? ) or ( tagname is 'text' )
return cram "<#{tagname}/>" if content.length is 0
return cram "<#{tagname}>", content..., "</#{tagname}>"
#.........................................................................................................
h 'paper', ->
h 'article', ->
h 'title', "Some Thoughts on Nested Data Structures"
h 'par', ->
h 'text', "A interesting "
h 'em', "fact"
h 'text', " about CupOfJoe is that you "
h 'em', "can"
h 'text', " nest with both sequences and function calls."
h 'conclusion', ->
h 'text', "With CupOfJoe, you don't need brackets."
html = expand().join '|'
info jr html
# info html
T.eq html, "<paper>|<article>|<title>|Some Thoughts on Nested Data Structures|</title>|<par>|A interesting |<em>|fact|</em>| about CupOfJoe is that you |<em>|can|</em>| nest with both sequences and function calls.|</par>|</article>|<conclusion>|With CupOfJoe, you don't need brackets.|</conclusion>|</paper>"
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "Cupofjoe linear structure" ] = ( T, done ) ->
{ Cupofjoe } = require '../../../apps/cupofjoe'
c = new Cupofjoe { flatten: false, }
{ cram
expand } = c.export()
#.........................................................................................................
c.cram 'p', ->
c.cram null, "It is very ", ( -> c.cram 'em', "convenient" ), " to write"
ds = c.expand()
info d for d in ds
help ds
T.eq ds, [ [ 'p', [ 'It is very ', [ 'em', 'convenient' ], ' to write' ] ] ]
#.........................................................................................................
done()
return null
############################################################################################################
if module is require.main then do =>
test @
# test @[ "CUP cram w/out functions" ]
# @[ "CUP demo 1" ]()
# test @[ "expand()" ]
# test @[ "CUP configuration" ]
# test @[ "CUP demo 2" ]
| 130147 |
'use strict'
############################################################################################################
CND = require 'cnd'
rpr = CND.rpr.bind CND
badge = 'CUPOFJOE/TESTS'
log = CND.get_logger 'plain', badge
info = CND.get_logger 'info', badge
whisper = CND.get_logger 'whisper', badge
alert = CND.get_logger 'alert', badge
debug = CND.get_logger 'debug', badge
warn = CND.get_logger 'warn', badge
help = CND.get_logger 'help', badge
urge = CND.get_logger 'urge', badge
#...........................................................................................................
# # types = require '../types'
# { isa
# validate
# type_of } = ( new ( require 'intertype' ).Intertype() ).export()
#...........................................................................................................
# CUPOFJOE = require '../../../apps/cupofjoe'
{ jr } = CND
test = require 'guy-test'
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo 1" ] = ( T, done ) ->
# debug ( k for k of ( require '../../../apps/cupofjoe' ) ); process.exit 1
{ Cupofjoe } = require '../../../apps/cupofjoe'
cupofjoe = new Cupofjoe()
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
cram null, ->
cram 'pre1'
cram 'pre2', 'wat'
cram 'one', ->
cram 'two', 42
cram 'three', ->
cram 'four', ->
cram 'five', ->
cram 'six'
cram 'post'
help rpr cupofjoe
ds = expand()
info rpr ds
info jr ds.flat Infinity
# urge '^4443^', ds
T.eq ds, [ [
[ 'pre1' ],
[ 'pre2', 'wat' ],
[ 'one',
[ 'two', 42 ],
[ 'three',
[ 'four', [ 'five', [ 'six' ] ] ] ] ],
[ 'post' ] ] ]
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo 2" ] = ( T, done ) ->
cupofjoe = new ( require '../../../apps/cupofjoe' ).Cupofjoe()
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
DATOM = new ( require 'datom' ).Datom { dirty: false, }
{ new_datom
lets
select } = DATOM.export()
#.........................................................................................................
h = ( tagname, content... ) ->
if content.length is 0
d = new_datom "^#{tagname}"
return cram d, content...
d1 = new_datom "<#{tagname}"
d2 = new_datom ">#{tagname}"
return cram d1, content..., d2
#.........................................................................................................
cram null, ->
h 'pre1'
cram null
h 'pre2', 'wat'
h 'one', ->
h 'two', ( new_datom '^text', text: '42' )
h 'three', ->
h 'four', ->
h 'five', ->
h 'six', ->
cram ( new_datom '^text', text: 'bottom' )
h 'post'
urge rpr cupofjoe.collector
ds = expand()
info jr ds
T.eq ds, [ [
[ { '$key': '^pre1' } ],
[ { '$key': '<pre2' }, 'wat', { '$key': '>pre2' } ],
[ { '$key': '<one' },
[ { '$key': '<two' },
{ text: '42', '$key': '^text' },
{ '$key': '>two' } ],
[ { '$key': '<three' },
[ { '$key': '<four' },
[ { '$key': '<five' },
[ { '$key': '<six' },
[ { text: 'bottom', '$key': '^text' } ],
{ '$key': '>six' } ],
{ '$key': '>five' } ],
{ '$key': '>four' } ],
{ '$key': '>three' } ],
{ '$key': '>one' } ],
[ { '$key': '^post' } ] ] ]
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo 2 flat" ] = ( T, done ) ->
cupofjoe = new ( require '../../../apps/cupofjoe' ).Cupofjoe { flatten: true, }
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
DATOM = new ( require 'datom' ).Datom { dirty: false, }
{ new_datom
lets
select } = DATOM.export()
#.........................................................................................................
h = ( tagname, content... ) ->
if content.length is 0
d = new_datom "^#{tagname}"
return cram d, content...
d1 = new_datom "<#{tagname}"
d2 = new_datom ">#{tagname}"
return cram d1, content..., d2
#.........................................................................................................
cram null, ->
h 'pre1'
cram null
h 'pre2', 'wat'
h 'one', ->
h 'two', ( new_datom '^text', text: '42' )
h 'three', ->
h 'four', ->
h 'five', ->
h 'six', ->
cram ( new_datom '^text', text: 'bottom' )
h 'post'
urge rpr cupofjoe.collector
ds = expand()
info jr ds
T.eq ds, [
{ '$key': '^pre1' }
{ '$key': '<pre<KEY>' }
'wat',
{ '$key': '>pre2' }
{ '$key': '<one' }
{ '$key': '<two' }
{ text: '42', '$key': '^text' }
{ '$key': '><KEY>' }
{ '$key': '<three' }
{ '$key': '<four' }
{ '$key': '<five' }
{ '$key': '<six' }
{ text: 'bottom', '$key': '^text' }
{ '$key': '>six' }
{ '$key': '>five' }
{ '$key': '>four' }
{ '$key': '>three' }
{ '$key': '>one' }
{ '$key': '^post' } ]
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo reformat" ] = ( T, done ) ->
cupofjoe = new ( require '../../../apps/cupofjoe' ).Cupofjoe { flatten: true, }
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
h = ( tagname, content... ) ->
return cram content... if ( not tagname? ) or ( tagname is 'text' )
return cram "<#{tagname}/>" if content.length is 0
return cram "<#{tagname}>", content..., "</#{tagname}>"
#.........................................................................................................
h 'paper', ->
h 'article', ->
h 'title', "Some Thoughts on Nested Data Structures"
h 'par', ->
h 'text', "A interesting "
h 'em', "fact"
h 'text', " about CupOfJoe is that you "
h 'em', "can"
h 'text', " nest with both sequences and function calls."
h 'conclusion', ->
h 'text', "With CupOfJoe, you don't need brackets."
html = expand().join '|'
info jr html
# info html
T.eq html, "<paper>|<article>|<title>|Some Thoughts on Nested Data Structures|</title>|<par>|A interesting |<em>|fact|</em>| about CupOfJoe is that you |<em>|can|</em>| nest with both sequences and function calls.|</par>|</article>|<conclusion>|With CupOfJoe, you don't need brackets.|</conclusion>|</paper>"
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "Cupofjoe linear structure" ] = ( T, done ) ->
{ Cupofjoe } = require '../../../apps/cupofjoe'
c = new Cupofjoe { flatten: false, }
{ cram
expand } = c.export()
#.........................................................................................................
c.cram 'p', ->
c.cram null, "It is very ", ( -> c.cram 'em', "convenient" ), " to write"
ds = c.expand()
info d for d in ds
help ds
T.eq ds, [ [ 'p', [ 'It is very ', [ 'em', 'convenient' ], ' to write' ] ] ]
#.........................................................................................................
done()
return null
############################################################################################################
if module is require.main then do =>
test @
# test @[ "CUP cram w/out functions" ]
# @[ "CUP demo 1" ]()
# test @[ "expand()" ]
# test @[ "CUP configuration" ]
# test @[ "CUP demo 2" ]
| true |
'use strict'
############################################################################################################
CND = require 'cnd'
rpr = CND.rpr.bind CND
badge = 'CUPOFJOE/TESTS'
log = CND.get_logger 'plain', badge
info = CND.get_logger 'info', badge
whisper = CND.get_logger 'whisper', badge
alert = CND.get_logger 'alert', badge
debug = CND.get_logger 'debug', badge
warn = CND.get_logger 'warn', badge
help = CND.get_logger 'help', badge
urge = CND.get_logger 'urge', badge
#...........................................................................................................
# # types = require '../types'
# { isa
# validate
# type_of } = ( new ( require 'intertype' ).Intertype() ).export()
#...........................................................................................................
# CUPOFJOE = require '../../../apps/cupofjoe'
{ jr } = CND
test = require 'guy-test'
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo 1" ] = ( T, done ) ->
# debug ( k for k of ( require '../../../apps/cupofjoe' ) ); process.exit 1
{ Cupofjoe } = require '../../../apps/cupofjoe'
cupofjoe = new Cupofjoe()
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
cram null, ->
cram 'pre1'
cram 'pre2', 'wat'
cram 'one', ->
cram 'two', 42
cram 'three', ->
cram 'four', ->
cram 'five', ->
cram 'six'
cram 'post'
help rpr cupofjoe
ds = expand()
info rpr ds
info jr ds.flat Infinity
# urge '^4443^', ds
T.eq ds, [ [
[ 'pre1' ],
[ 'pre2', 'wat' ],
[ 'one',
[ 'two', 42 ],
[ 'three',
[ 'four', [ 'five', [ 'six' ] ] ] ] ],
[ 'post' ] ] ]
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo 2" ] = ( T, done ) ->
cupofjoe = new ( require '../../../apps/cupofjoe' ).Cupofjoe()
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
DATOM = new ( require 'datom' ).Datom { dirty: false, }
{ new_datom
lets
select } = DATOM.export()
#.........................................................................................................
h = ( tagname, content... ) ->
if content.length is 0
d = new_datom "^#{tagname}"
return cram d, content...
d1 = new_datom "<#{tagname}"
d2 = new_datom ">#{tagname}"
return cram d1, content..., d2
#.........................................................................................................
cram null, ->
h 'pre1'
cram null
h 'pre2', 'wat'
h 'one', ->
h 'two', ( new_datom '^text', text: '42' )
h 'three', ->
h 'four', ->
h 'five', ->
h 'six', ->
cram ( new_datom '^text', text: 'bottom' )
h 'post'
urge rpr cupofjoe.collector
ds = expand()
info jr ds
T.eq ds, [ [
[ { '$key': '^pre1' } ],
[ { '$key': '<pre2' }, 'wat', { '$key': '>pre2' } ],
[ { '$key': '<one' },
[ { '$key': '<two' },
{ text: '42', '$key': '^text' },
{ '$key': '>two' } ],
[ { '$key': '<three' },
[ { '$key': '<four' },
[ { '$key': '<five' },
[ { '$key': '<six' },
[ { text: 'bottom', '$key': '^text' } ],
{ '$key': '>six' } ],
{ '$key': '>five' } ],
{ '$key': '>four' } ],
{ '$key': '>three' } ],
{ '$key': '>one' } ],
[ { '$key': '^post' } ] ] ]
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo 2 flat" ] = ( T, done ) ->
cupofjoe = new ( require '../../../apps/cupofjoe' ).Cupofjoe { flatten: true, }
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
DATOM = new ( require 'datom' ).Datom { dirty: false, }
{ new_datom
lets
select } = DATOM.export()
#.........................................................................................................
h = ( tagname, content... ) ->
if content.length is 0
d = new_datom "^#{tagname}"
return cram d, content...
d1 = new_datom "<#{tagname}"
d2 = new_datom ">#{tagname}"
return cram d1, content..., d2
#.........................................................................................................
cram null, ->
h 'pre1'
cram null
h 'pre2', 'wat'
h 'one', ->
h 'two', ( new_datom '^text', text: '42' )
h 'three', ->
h 'four', ->
h 'five', ->
h 'six', ->
cram ( new_datom '^text', text: 'bottom' )
h 'post'
urge rpr cupofjoe.collector
ds = expand()
info jr ds
T.eq ds, [
{ '$key': '^pre1' }
{ '$key': '<prePI:KEY:<KEY>END_PI' }
'wat',
{ '$key': '>pre2' }
{ '$key': '<one' }
{ '$key': '<two' }
{ text: '42', '$key': '^text' }
{ '$key': '>PI:KEY:<KEY>END_PI' }
{ '$key': '<three' }
{ '$key': '<four' }
{ '$key': '<five' }
{ '$key': '<six' }
{ text: 'bottom', '$key': '^text' }
{ '$key': '>six' }
{ '$key': '>five' }
{ '$key': '>four' }
{ '$key': '>three' }
{ '$key': '>one' }
{ '$key': '^post' } ]
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "CUP demo reformat" ] = ( T, done ) ->
cupofjoe = new ( require '../../../apps/cupofjoe' ).Cupofjoe { flatten: true, }
{ cram
expand } = cupofjoe.export()
#.........................................................................................................
h = ( tagname, content... ) ->
return cram content... if ( not tagname? ) or ( tagname is 'text' )
return cram "<#{tagname}/>" if content.length is 0
return cram "<#{tagname}>", content..., "</#{tagname}>"
#.........................................................................................................
h 'paper', ->
h 'article', ->
h 'title', "Some Thoughts on Nested Data Structures"
h 'par', ->
h 'text', "A interesting "
h 'em', "fact"
h 'text', " about CupOfJoe is that you "
h 'em', "can"
h 'text', " nest with both sequences and function calls."
h 'conclusion', ->
h 'text', "With CupOfJoe, you don't need brackets."
html = expand().join '|'
info jr html
# info html
T.eq html, "<paper>|<article>|<title>|Some Thoughts on Nested Data Structures|</title>|<par>|A interesting |<em>|fact|</em>| about CupOfJoe is that you |<em>|can|</em>| nest with both sequences and function calls.|</par>|</article>|<conclusion>|With CupOfJoe, you don't need brackets.|</conclusion>|</paper>"
#.........................................................................................................
done() if done?
#-----------------------------------------------------------------------------------------------------------
@[ "Cupofjoe linear structure" ] = ( T, done ) ->
{ Cupofjoe } = require '../../../apps/cupofjoe'
c = new Cupofjoe { flatten: false, }
{ cram
expand } = c.export()
#.........................................................................................................
c.cram 'p', ->
c.cram null, "It is very ", ( -> c.cram 'em', "convenient" ), " to write"
ds = c.expand()
info d for d in ds
help ds
T.eq ds, [ [ 'p', [ 'It is very ', [ 'em', 'convenient' ], ' to write' ] ] ]
#.........................................................................................................
done()
return null
############################################################################################################
if module is require.main then do =>
test @
# test @[ "CUP cram w/out functions" ]
# @[ "CUP demo 1" ]()
# test @[ "expand()" ]
# test @[ "CUP configuration" ]
# test @[ "CUP demo 2" ]
|
[
{
"context": "u-test-pepper'\nextensionUrl = 'http://47.98.33.233/meshbluapi/meshblu.php/meshblu/meshbluapi/extensi",
"end": 521,
"score": 0.9824008941650391,
"start": 509,
"tag": "IP_ADDRESS",
"value": "47.98.33.233"
},
{
"context": "->\n @redisClient = Redis.createClient(\"6379\", \"127.0.0.1\")\n\n prepare: (request, response, next) =>\n {e",
"end": 735,
"score": 0.9997291564941406,
"start": 726,
"tag": "IP_ADDRESS",
"value": "127.0.0.1"
},
{
"context": "\n\n request.email = email\n request.password = password\n request.deviceQuery = query\n\n keyCode = \"#",
"end": 1069,
"score": 0.9983349442481995,
"start": 1061,
"tag": "PASSWORD",
"value": "password"
},
{
"context": " 'octoblu:user'\n user_id: email\n secret: password\n , @reply(request.body.callbackUrl, email, res",
"end": 2128,
"score": 0.9980119466781616,
"start": 2120,
"tag": "PASSWORD",
"value": "password"
},
{
"context": "ha1').update(queryStr).digest('hex')\n key = \"datastore:tokens:#{cacheKey}\"\n @checkTokenInRedis key, (error",
"end": 4904,
"score": 0.7869102954864502,
"start": 4888,
"tag": "KEY",
"value": "datastore:tokens"
}
] | app/controllers/device-controller.coffee | DesertEagleX/meshblu-sms-plugin-3.0 | 0 | debug = require('debug')('meshblu-authenticator-email-password:device-controller')
_ = require 'lodash'
validator = require 'validator'
url = require 'url'
Crypto = require 'crypto'
stringify = require 'json-stable-stringify'
Redis = require 'redis'
request = require 'request'
pepper = 'meshblu-test-pepper'
extensionUrl = 'http://47.98.33.233/meshbluapi/meshblu.php/meshblu/meshbluapi/extensions'
result = ''
class DeviceController
constructor: ({@meshbluHttp, @deviceModel}) ->
@redisClient = Redis.createClient("6379", "127.0.0.1")
prepare: (request, response, next) =>
{email,password,checkCode} = request.body
return response.status(422).send 'Password required' if _.isEmpty(password)
query = {}
email = email.toLowerCase()
query[@deviceModel.authenticatorUuid + '.id'] = email
request.email = email
request.password = password
request.deviceQuery = query
keyCode = "#{email}#{checkCode}"
@redisClient.exists keyCode, (error, result) =>
if result
next()
else
return response.status(404).send 'checkCode wrong'
prepareDevices: (request, response, next) =>
{deviceId,secret} = request.body
return response.status(422).send 'secret required' if _.isEmpty(secret)
return response.status(422).send 'deviceId required' if _.isEmpty(deviceId)
deviceId = deviceId.toLowerCase()
query =
deviceId:deviceId
request.deviceQuery = query
@meshbluHttp.devices query, (error, devices) =>
return response.status(500).json error: error.message if error?
return response.status(423).send 'Mac Address has registered' unless _.isEmpty devices
next()
createUser: (request, response) =>
{deviceQuery, email, password} = request
debug 'device query', deviceQuery
@deviceModel.create
query: deviceQuery
data:
type: 'octoblu:user'
user_id: email
secret: password
, @reply(request.body.callbackUrl, email, response)
createDevices: (request, response) =>
{deviceQuery} = request
data = request.body
console.log "data",data
debug 'device query', deviceQuery
@deviceModel.createDevices
query: deviceQuery
data: data
, @replyDevices(response)
reply: (callbackUrl, email, response) =>
(error, device) =>
console.log "callbackUrl",callbackUrl
if error?
debug 'got an error', error.message
if error.message == 'device already exists'
return response.status(401).json error: "Unable to create user"
if error.message == @ERROR_DEVICE_NOT_FOUND
return response.status(401).json error: "Unable to find user"
return response.status(500).json error: error.message
@meshbluHttp.generateAndStoreToken device.uuid, (error, device) =>
console.log '**********', device
if !callbackUrl
request.post {url: extensionUrl, form:{'extension':email}}, (err, res, body)=>
console.log body
result = JSON.parse body
if result[0] == 'ERRCODE_1001' || result[0] == 'ERRCODE_1002'
return response.status(405).send 'generate extension failed'
else
return response.status(201).send(device: device)
else
uriParams = url.parse callbackUrl, true
delete uriParams.search
uriParams.query ?= {}
uriParams.query.uuid = device.uuid
uriParams.query.token = device.token
uri = decodeURIComponent url.format(uriParams)
response.status(201).location(uri).send(device: device, callbackUrl: uri)
replyDevices: (response) =>
(error, device) =>
if error?
debug 'got an error', error.message
if error.message == 'device already exists'
return response.status(401).json error: "Unable to create user"
if error.message == @ERROR_DEVICE_NOT_FOUND
return response.status(401).json error: "Unable to find user"
return response.status(500).json error: error.message
@meshbluHttp.generateAndStoreToken device.uuid, (error, device) =>
return response.status(201).send(device: device)
checkOnline:(request, response) =>
uuid = request.query.uuid
token = request.query.token
return response.status(422).send() unless uuid? && token?
hasher = Crypto.createHash 'sha256'
hasher.update token
hasher.update uuid
hasher.update pepper
console.log hasher
hashedToken = hasher.digest 'base64'
query = {uuid,hashedToken}
queryStr = stringify(query)
cacheKey = Crypto.createHash('sha1').update(queryStr).digest('hex')
key = "datastore:tokens:#{cacheKey}"
@checkTokenInRedis key, (error, result) =>
if result
response.status(200).send status: 'online'
else
response.status(503).send status: 'offline'
checkTokenInRedis: (key, callback) =>
@redisClient.exists key, callback
module.exports = DeviceController
| 169503 | debug = require('debug')('meshblu-authenticator-email-password:device-controller')
_ = require 'lodash'
validator = require 'validator'
url = require 'url'
Crypto = require 'crypto'
stringify = require 'json-stable-stringify'
Redis = require 'redis'
request = require 'request'
pepper = 'meshblu-test-pepper'
extensionUrl = 'http://172.16.17.32/meshbluapi/meshblu.php/meshblu/meshbluapi/extensions'
result = ''
class DeviceController
constructor: ({@meshbluHttp, @deviceModel}) ->
@redisClient = Redis.createClient("6379", "127.0.0.1")
prepare: (request, response, next) =>
{email,password,checkCode} = request.body
return response.status(422).send 'Password required' if _.isEmpty(password)
query = {}
email = email.toLowerCase()
query[@deviceModel.authenticatorUuid + '.id'] = email
request.email = email
request.password = <PASSWORD>
request.deviceQuery = query
keyCode = "#{email}#{checkCode}"
@redisClient.exists keyCode, (error, result) =>
if result
next()
else
return response.status(404).send 'checkCode wrong'
prepareDevices: (request, response, next) =>
{deviceId,secret} = request.body
return response.status(422).send 'secret required' if _.isEmpty(secret)
return response.status(422).send 'deviceId required' if _.isEmpty(deviceId)
deviceId = deviceId.toLowerCase()
query =
deviceId:deviceId
request.deviceQuery = query
@meshbluHttp.devices query, (error, devices) =>
return response.status(500).json error: error.message if error?
return response.status(423).send 'Mac Address has registered' unless _.isEmpty devices
next()
createUser: (request, response) =>
{deviceQuery, email, password} = request
debug 'device query', deviceQuery
@deviceModel.create
query: deviceQuery
data:
type: 'octoblu:user'
user_id: email
secret: <PASSWORD>
, @reply(request.body.callbackUrl, email, response)
createDevices: (request, response) =>
{deviceQuery} = request
data = request.body
console.log "data",data
debug 'device query', deviceQuery
@deviceModel.createDevices
query: deviceQuery
data: data
, @replyDevices(response)
reply: (callbackUrl, email, response) =>
(error, device) =>
console.log "callbackUrl",callbackUrl
if error?
debug 'got an error', error.message
if error.message == 'device already exists'
return response.status(401).json error: "Unable to create user"
if error.message == @ERROR_DEVICE_NOT_FOUND
return response.status(401).json error: "Unable to find user"
return response.status(500).json error: error.message
@meshbluHttp.generateAndStoreToken device.uuid, (error, device) =>
console.log '**********', device
if !callbackUrl
request.post {url: extensionUrl, form:{'extension':email}}, (err, res, body)=>
console.log body
result = JSON.parse body
if result[0] == 'ERRCODE_1001' || result[0] == 'ERRCODE_1002'
return response.status(405).send 'generate extension failed'
else
return response.status(201).send(device: device)
else
uriParams = url.parse callbackUrl, true
delete uriParams.search
uriParams.query ?= {}
uriParams.query.uuid = device.uuid
uriParams.query.token = device.token
uri = decodeURIComponent url.format(uriParams)
response.status(201).location(uri).send(device: device, callbackUrl: uri)
replyDevices: (response) =>
(error, device) =>
if error?
debug 'got an error', error.message
if error.message == 'device already exists'
return response.status(401).json error: "Unable to create user"
if error.message == @ERROR_DEVICE_NOT_FOUND
return response.status(401).json error: "Unable to find user"
return response.status(500).json error: error.message
@meshbluHttp.generateAndStoreToken device.uuid, (error, device) =>
return response.status(201).send(device: device)
checkOnline:(request, response) =>
uuid = request.query.uuid
token = request.query.token
return response.status(422).send() unless uuid? && token?
hasher = Crypto.createHash 'sha256'
hasher.update token
hasher.update uuid
hasher.update pepper
console.log hasher
hashedToken = hasher.digest 'base64'
query = {uuid,hashedToken}
queryStr = stringify(query)
cacheKey = Crypto.createHash('sha1').update(queryStr).digest('hex')
key = "<KEY>:#{cacheKey}"
@checkTokenInRedis key, (error, result) =>
if result
response.status(200).send status: 'online'
else
response.status(503).send status: 'offline'
checkTokenInRedis: (key, callback) =>
@redisClient.exists key, callback
module.exports = DeviceController
| true | debug = require('debug')('meshblu-authenticator-email-password:device-controller')
_ = require 'lodash'
validator = require 'validator'
url = require 'url'
Crypto = require 'crypto'
stringify = require 'json-stable-stringify'
Redis = require 'redis'
request = require 'request'
pepper = 'meshblu-test-pepper'
extensionUrl = 'http://PI:IP_ADDRESS:172.16.17.32END_PI/meshbluapi/meshblu.php/meshblu/meshbluapi/extensions'
result = ''
class DeviceController
constructor: ({@meshbluHttp, @deviceModel}) ->
@redisClient = Redis.createClient("6379", "127.0.0.1")
prepare: (request, response, next) =>
{email,password,checkCode} = request.body
return response.status(422).send 'Password required' if _.isEmpty(password)
query = {}
email = email.toLowerCase()
query[@deviceModel.authenticatorUuid + '.id'] = email
request.email = email
request.password = PI:PASSWORD:<PASSWORD>END_PI
request.deviceQuery = query
keyCode = "#{email}#{checkCode}"
@redisClient.exists keyCode, (error, result) =>
if result
next()
else
return response.status(404).send 'checkCode wrong'
prepareDevices: (request, response, next) =>
{deviceId,secret} = request.body
return response.status(422).send 'secret required' if _.isEmpty(secret)
return response.status(422).send 'deviceId required' if _.isEmpty(deviceId)
deviceId = deviceId.toLowerCase()
query =
deviceId:deviceId
request.deviceQuery = query
@meshbluHttp.devices query, (error, devices) =>
return response.status(500).json error: error.message if error?
return response.status(423).send 'Mac Address has registered' unless _.isEmpty devices
next()
createUser: (request, response) =>
{deviceQuery, email, password} = request
debug 'device query', deviceQuery
@deviceModel.create
query: deviceQuery
data:
type: 'octoblu:user'
user_id: email
secret: PI:PASSWORD:<PASSWORD>END_PI
, @reply(request.body.callbackUrl, email, response)
createDevices: (request, response) =>
{deviceQuery} = request
data = request.body
console.log "data",data
debug 'device query', deviceQuery
@deviceModel.createDevices
query: deviceQuery
data: data
, @replyDevices(response)
reply: (callbackUrl, email, response) =>
(error, device) =>
console.log "callbackUrl",callbackUrl
if error?
debug 'got an error', error.message
if error.message == 'device already exists'
return response.status(401).json error: "Unable to create user"
if error.message == @ERROR_DEVICE_NOT_FOUND
return response.status(401).json error: "Unable to find user"
return response.status(500).json error: error.message
@meshbluHttp.generateAndStoreToken device.uuid, (error, device) =>
console.log '**********', device
if !callbackUrl
request.post {url: extensionUrl, form:{'extension':email}}, (err, res, body)=>
console.log body
result = JSON.parse body
if result[0] == 'ERRCODE_1001' || result[0] == 'ERRCODE_1002'
return response.status(405).send 'generate extension failed'
else
return response.status(201).send(device: device)
else
uriParams = url.parse callbackUrl, true
delete uriParams.search
uriParams.query ?= {}
uriParams.query.uuid = device.uuid
uriParams.query.token = device.token
uri = decodeURIComponent url.format(uriParams)
response.status(201).location(uri).send(device: device, callbackUrl: uri)
replyDevices: (response) =>
(error, device) =>
if error?
debug 'got an error', error.message
if error.message == 'device already exists'
return response.status(401).json error: "Unable to create user"
if error.message == @ERROR_DEVICE_NOT_FOUND
return response.status(401).json error: "Unable to find user"
return response.status(500).json error: error.message
@meshbluHttp.generateAndStoreToken device.uuid, (error, device) =>
return response.status(201).send(device: device)
checkOnline:(request, response) =>
uuid = request.query.uuid
token = request.query.token
return response.status(422).send() unless uuid? && token?
hasher = Crypto.createHash 'sha256'
hasher.update token
hasher.update uuid
hasher.update pepper
console.log hasher
hashedToken = hasher.digest 'base64'
query = {uuid,hashedToken}
queryStr = stringify(query)
cacheKey = Crypto.createHash('sha1').update(queryStr).digest('hex')
key = "PI:KEY:<KEY>END_PI:#{cacheKey}"
@checkTokenInRedis key, (error, result) =>
if result
response.status(200).send status: 'online'
else
response.status(503).send status: 'offline'
checkTokenInRedis: (key, callback) =>
@redisClient.exists key, callback
module.exports = DeviceController
|
[
{
"context": "otected\n @type String\n ###\n @modelName: 'diary'\n\n client: new MemoryResource()\n\nmodule.export",
"end": 361,
"score": 0.9710896611213684,
"start": 356,
"tag": "NAME",
"value": "diary"
}
] | spec/domain/diary-repository.coffee | CureApp/base-domain | 37 |
{ BaseAsyncRepository } = require('../base-domain')
{ MemoryResource } = require '../others'
###*
repository of diary
@class DiaryRepository
@extends BaseAsyncRepository
###
class DiaryRepository extends BaseAsyncRepository
###*
model name to create
@property modelName
@static
@protected
@type String
###
@modelName: 'diary'
client: new MemoryResource()
module.exports = DiaryRepository
| 164515 |
{ BaseAsyncRepository } = require('../base-domain')
{ MemoryResource } = require '../others'
###*
repository of diary
@class DiaryRepository
@extends BaseAsyncRepository
###
class DiaryRepository extends BaseAsyncRepository
###*
model name to create
@property modelName
@static
@protected
@type String
###
@modelName: '<NAME>'
client: new MemoryResource()
module.exports = DiaryRepository
| true |
{ BaseAsyncRepository } = require('../base-domain')
{ MemoryResource } = require '../others'
###*
repository of diary
@class DiaryRepository
@extends BaseAsyncRepository
###
class DiaryRepository extends BaseAsyncRepository
###*
model name to create
@property modelName
@static
@protected
@type String
###
@modelName: 'PI:NAME:<NAME>END_PI'
client: new MemoryResource()
module.exports = DiaryRepository
|
[
{
"context": "gAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGNikAQAACIAHF/uBd8AAAAASUVORK5CYII=\"')\n writeMessageBody: ->\n ",
"end": 5781,
"score": 0.5070763826370239,
"start": 5780,
"tag": "KEY",
"value": "u"
},
{
"context": "AAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGNikAQAACIAHF/uBd8AAAAASUVORK5CYII=\"')\n writeMessageBody: ->\n body = @props.mess",
"end": 5800,
"score": 0.5778713226318359,
"start": 5783,
"tag": "KEY",
"value": "8AAAAASUVORK5CYII"
}
] | src/components/ConversationView/main.cjsx | marcus433/dropmail | 0 | require './_main.scss'
Promise = require 'bluebird'
React = require 'react'
ReactDOM = require 'react-dom'
backend = require '../../api/bridge'
Compose = require '../Compose/Main'
TimeNotation = require '../../utils/time-notation'
Lazy = require 'lazy.js'
RubberBand = require '../Rubberband/Main'
onClickOutside = require 'react-onclickoutside'
Store = require '../../store'
{ shell, remote: { app }, remote } = require 'electron'
FILES_PATH = app.getPath('userData')+'/files/'
realm = require '../../api/realm'
SwipeController = require '../../store/swipe'
AVATAR_PATH = app.getPath('userData')+'/avatars/'
# TODO: issues here when 0 items
Participant = onClickOutside React.createClass
displayName: 'Participant'
getInitialState: ->
detailed: false
onClick: ->
@setState(detailed: true)
handleClickOutside: ->
# TODO, add 'popout' class for 100 ms or something and then set detailed: false
@setState(detailed: false)
render: ->
{ address, name, addressHash, cached } = @props.contact
<div className="ptp-rel" onClick={@onClick}>
<div className="participant #{if @state.detailed then 'active' else ''}">
<div className="avatar #{if not cached then @props.tag else ''}" style={background:if cached then "url('#{AVATAR_PATH + addressHash}') no-repeat" else ''}>
{ if not cached then (name[0] or address[0]).toUpperCase() else '' }
</div>
<div className="name">{ name }</div>
<div className="extra">
<div className="ename">{address}</div>
<paper-button onClick={=> Store.actions.compose()}>New Message</paper-button>
</div>
</div>
</div>
frameClick = (event) ->
event.preventDefault()
href = @getAttribute('href')
if href.indexOf('mailto:') is 0
alert 'todo; will compose message'
else
remote.dialog.showMessageBox({
type: 'none'
message: 'Do you want to open this link?'
detail: if href.length > 100 then href.slice(0,101)+'...' else href
buttons: ['Open Link', 'Cancel']
}, (idx) ->
shell.openExternal(href) if not idx
)
Message = React.createClass
displayName: "Message"
getInitialState: ->
minimized: false
url: null
initials: null
sizeFrame: ->
window.requestAnimationFrame( =>
message = @props.message
messageId = message.id
target = ReactDOM.findDOMNode(@refs["message-#{messageId}"])
frame = ReactDOM.findDOMNode(@refs["body-#{messageId}"])
target.style.height = 0 + 'px'
frame.style.height = 0 + 'px'
doc = frame.contentWindow.document
# TODO figure out why it gets stuck sometimes
target.style.height = doc.body.scrollHeight + 36 + 'px'
frame.style.height = doc.body.scrollHeight + 'px'
)
shouldComponentUpdate: (props, state) ->
props.message isnt @props.message or
props.tag isnt @props.tag or
props.message.from[0]?.cached isnt @props.message.from[0]?.cached
toggleMinimize: ->
###
return if @props.idx is 0 and @props.last
@setState(minimized: not @state.minimized)
###
componentDidMount: ->
conversation = Store.collections.focus?[Store.selections.lastSelected]
if conversation?.isValid()
message = conversation.messages.filtered('id == $0', @props.message.id).find(-> true)
backend.getInlineFiles(conversation.account?.address, message.folder?.path, @props.message.id)
.then =>
@writeMessageBody() # TODO
console.log 'fetched attachments'
.catch (err) ->
console.log 'failed to fetch: ', err
componentWillUnmount: ->
frame = ReactDOM.findDOMNode(@refs["body-#{@props.message.id}"])?.contentDocument
if @props.wheel? and not @props.message.draft
frame.removeEventListener('wheel', @props.wheel)
if frame?
for element in frame.getElementsByTagName('a')
element.removeEventListener('click', frameClick)
frame.innerHTML = ''
frame.src = 'about:blank'
clearTimeout(@sizeFrame)
if @props.message.draft
for element in document.querySelectorAll('.redactor-toolbar-tooltip')
element.parentElement?.removeChild(element)
for element in document.querySelectorAll('.redactor-dropdown')
element.parentElement?.removeChild(element)
mergeFiles: (body) ->
message = Store.collections.focus?[Store.selections.lastSelected]?.messages.filtered('id == $0', @props.message.id).find(-> true)
for file in message.files
if file.mimeType.indexOf('image') isnt 0 or file.size > 12 * 1024 * 1024
body += """
<div class=\"dropmail-inline-attachment\">
<div class=\"dropmail-attachment-preview\" mimeType=\"#{file.mimeType}\"></div>
<div class=\"dropmail-attachment-filename\">
#{file.filename ? '(No Name)'}
</div>
<div class=\"dropmail-attachment-size\">
#{Math.ceil(file.size / 1024)}kB
</div>
</div>
"""
else
if file.saved
if file.contentId?
cidRegexp = new RegExp("cid:#{file.contentId}(['\"])", 'gi')
body = body.replace cidRegexp, (text, quote) ->
"#{FILES_PATH}#{file.id}#{quote}"
else
body += "<img src=\"#{FILES_PATH}#{file.id}\" class=\"dropmail-inline\" />"
else
inlineImgRegexp = new RegExp("<\s*img.*src=['\"]cid:#{file.contentId}['\"][^>]*>", 'gi')
body = body.replace inlineImgRegexp, =>
'<img alt="spinner.gif" src="" style="-webkit-user-drag: none;">'
body.replace(new RegExp("src=['\"]cid:([^'\"]*)['\"]", 'g'), 'src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGNikAQAACIAHF/uBd8AAAAASUVORK5CYII="')
writeMessageBody: ->
body = @props.message.body
body = @mergeFiles(body)
style =
"""
<style>
* {
transition: .25s ease-in-out;
-moz-transition: .25s ease-in-out;
-webkit-transition: .25s ease-in-out;
}
html, body {
font-family: Roboto-Regular;
border: 0;
-webkit-text-size-adjust: auto;
word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;
line-height: 22px;
font-size:15px;
color: #1E1E1E;
margin:0;
padding:5px;
}
.gmail_extra {
display: none !important;
}
.gmail_quote {
display: none !important;
}
.mailbox_signature#mb-reply {
display: block !important;
}
#orc-full-body-initial-text {
display: none !important;
}
#orc-email-signature {
display: none !important;
}
#psignature
.dropmail_signature {
display: none !important;
}
.dropmail-inline-link {
margin-top: 10px;
height: 40px;
width: 300px;
border-radius: 3px;
border: 1px solid #CCC;
font-size: 13px;
font-family: Roboto-Medium;
color: #1E1E1E;
}
.dropmail-inline-attachment {
margin-top: 10px;
height: 40px;
width: 300px;
border-radius: 3px;
border: 1px solid #CCC;
font-size: 13px;
font-family: Roboto-Medium;
color: #1E1E1E;
}
.dropmail-inline-attachment .dropmail-attachment-filename {
//
}
.dropmail-inline-attachment .dropmail-attachment-preview {
//
}
.dropmail-inline-attachment .dropmail-attachment-size {
//
}
.dropmail-inline-attachment:hover {
background: #CCC;
}
.dropmail-inline {
display: block;
width: 100%;
height: auto;
margin-top: 10px;
}
</style>
"""
frame = ReactDOM.findDOMNode(@refs["body-#{@props.message.id}"])?.contentDocument
frame.open()
frame.write("<!DOCTYPE html>")
frame.write("<meta id='dropmail-viewport' name='viewport' content='width=device-width, maximum-scale=2.0, user-scalable=yes'>")
frame.write(style)
frame.write(body)
frame.close()
# TODO: MAJOR, remove event listeners on loop & unmount.
for element in frame.getElementsByTagName('a')
element.removeEventListener('click', frameClick)
element.addEventListener('click', frameClick)
if @props.wheel?
frame.removeEventListener('wheel', @props.wheel)
frame.addEventListener('wheel', @props.wheel)
mouseOver: ->
@props.quickReply(false)
setTimeout(@sizeFrame, 200) if not @props.message.draft
mouseOut: ->
@props.quickReply(true)
setTimeout(@sizeFrame, 200) if not @props.message.draft
fromAddress: ->
{ name, address, addressHash, cached } = @props.message.from[0]
return { name: 'No Sender', address, addressHash, cached } if not @props.message.from[0]?
if Store.global.state.accounts.length is 1
account = Store.global.state.accounts[0]
mes = [account?.address, account?.aliases.map(({ address }) -> address)...]
if @props.message.from[0].address in mes
return { name: 'Me', address, addressHash, cached }
name = @props.message.from[0].name
return { name, address, addressHash, cached }
render: ->
{ name, address, addressHash, cached } = @fromAddress()
<div className="message#{if @state.minimized then ' minimized' else ''}" style={height: if @props.message.draft then 'auto' else 80} onMouseOver={=> @mouseOver()} onMouseOut={=> @mouseOut()} ref="message-#{@props.message.id}">
{
if @props.message.draft
<Compose inline={true} />
else
<div className="message-details" onClick={@toggleMinimize}>
{
<div className="avatar #{if not cached then @props.tag else ''}" style={background:if cached then "url('#{AVATAR_PATH + addressHash}') no-repeat" else ''}>
{ if not cached then (name[0] or address[0]).toUpperCase() else '' }
</div>
}
<div className="sender">{ name }</div>
{
###
if @props.message.cc.length > 0
<div className="cc-label">CC</div>
<div className="cc"> & {@props.message.cc.length} Others</div>
###
}
<div className="reply-message">
<paper-icon-button icon="reply"></paper-icon-button>
<paper-icon-button icon="reply-all"></paper-icon-button>
<paper-icon-button icon="forward"></paper-icon-button>
</div>
<div className="timestamp"><div>{new TimeNotation(@props.message.timestamp or 0).state()}</div><div>{new TimeNotation(@props.message.timestamp or 0).replyFormat()}</div></div>
</div>
}
{
if not @props.message.draft
setTimeout(@sizeFrame, 200)
# TODO: break in to seperate iframe component?
<iframe onLoad={=> @sizeFrame()} scrolling="no" className="conversation-body" ref="body-#{@props.message.id}"></iframe>
}
</div>
Messages = React.createClass
displayName: 'Messages'
verifiedUpdate: false
getInitialState: ->
messages: []
lastSelected: 0
componentDidMount: ->
Store.collections.addListener 'messages', @refresh
@refresh()
componentDidUnmount: ->
Store.collections.removeListener('messages', @refresh)
shouldComponentUpdate: ->
@verifiedUpdate or Store.collections.focus?[Store.selections.lastSelected]?.id isnt @state.lastSelected
refresh: ->
window.requestAnimationFrame( =>
messages = []
conversation = Store.collections.focus?[Store.selections.lastSelected]
return unless conversation?.isValid()
###
only call if changed.
if conversation.unread
realm.write =>
realm.create('Outbox', {
account: Store.global.state.accounts[0]
type: 3
target: 1
initialState: '1'
targetState: '0'
timestamp: new Date()
conversations: [conversation]
})
###
messages = conversation.messages.sorted('timestamp', true).snapshot()
hashtable = {}
for i in [0...messages.length]
continue unless messages[i].isValid()
hashtable[messages[i]['serverId']] = messages[i]
messages = []
for key, message of hashtable
if message.body
messages.push({
timestamp: message.timestamp
id: message.id
from: message.from.map(({ address, name, addressHash, cached }) -> { address, name, addressHash, cached })
body: message.body
tag: message.tag
serverId: message.serverId
draft: message.folder?.type is 3
})
else
backend.getBody(conversation.account?.address, message.folder?.path, message.id)
null
hashtable = null
@verifiedUpdate = true
@setState({ messages, lastSelected: conversation.id })
)
render: ->
@verifiedUpdate = false
conversation = Store.collections.focus?[Store.selections.lastSelected]
if conversation?.isValid() and conversation.id isnt @state.lastSelected
@refresh()
<div className="messages-container">
{
for message, i in @state.messages
# TODO: event bubbling should only be on elements in view
<Message message={message} wheel={@props.wheel} quickReply={(state) => @props.quickReply(state)} tag={conversation?.tag} key={message.serverId} />
}
</div>
ConversationView = React.createClass
displayName: "ConversationView"
global: Store.global
renderTimeout: null
getInitialState: ->
show: true
hidden: false
quickReply: true
showFewParticipants: true
scrolling: false
snoozing: false
componentDidMount: ->
Store.selections.addListener =>
@prerender()
Store.global.addListener (state, prop) =>
folderType = Store.global.state.folder?.type or -1
if folderType is 6
@prerender()
Store.actions.addListener('popover', @setPopoverState)
prerender: ->
clearTimeout(@renderTimeout)
@renderTimeout = setTimeout =>
window.requestAnimationFrame( =>
@forceUpdate()
)
, 100
componentWillUnmount: ->
Store.actions.removeListener('popover', @setPopoverState)
setPopoverState: (type, orientation, boundingBox, callback) ->
@setState(snoozing: boundingBox?)
quickReply: (quickReply) ->
@setState({ quickReply })
toggleMoreParticipants: ->
@setState({ showFewParticipants: not @state.showFewParticipants })
scroll: ->
@setState(scrolling: true) if not @state.scrolling
clearTimeout(@scrolltimeout)
@scrolltimeout = setTimeout =>
@setState(scrolling:false)
, 150
snooze: ->
SwipeController.setPosition(250)
Store.actions.dispatch('popover', ['snooze', 'bottom', ReactDOM.findDOMNode(@refs['snooze']).getBoundingClientRect(), ->
SwipeController.setPosition(0, 'RESET')
])
render: ->
hide = @global.state.folder?.type is 6
selectionCount = Store.selections.count()
conversation = Store.collections.focus?[Store.selections.lastSelected]
conversation = null if not conversation?.isValid()
me = null
me = conversation.account?.address.toLowerCase() if conversation?
###
<paper-icon-button icon="list" title="snooze"></paper-icon-button>
<paper-icon-button icon="alarm" title="snooze"></paper-icon-button>
<paper-icon-button icon="visibility" title="snooze"></paper-icon-button>
<paper-icon-button icon="block" title="snooze"></paper-icon-button>
<paper-icon-button icon="print" title="snooze"></paper-icon-button>
<paper-icon-button icon="delete" title="trash"></paper-icon-button>
###
<div className="conversation-view#{if not @state.show then ' hidden' else ''}" style={display: if hide then "none"}>
{
if selectionCount is 1
styles = {
snooze: {}
}
styles.snooze = { zIndex: 2000 } if @state.snoozing
<div className="toolbar">
<paper-icon-button icon="list" title="snooze" ref="snooze"></paper-icon-button>
<paper-icon-button icon="alarm" title="snooze" style={styles.snooze} onClick={@snooze} ref="snooze"></paper-icon-button>
<paper-icon-button icon="delete" title="trash" onClick={@delete}></paper-icon-button>
<paper-icon-button icon="more-vert" title="trash"></paper-icon-button>
</div>
}
<RubberBand class="conversation-wrapper#{if @state.scrolling then ' no-events' else ''}" onScroll={@scroll}>
{
# TODO complete the selections UI
if selectionCount > 1
<div className="state-wrapper">
<div className="selectedCount">{selectionCount}</div>
<div className="state">Conversations Selected</div>
<div className="options">
<paper-icon-button icon="list" title="snooze" ref="snooze"></paper-icon-button>
<paper-icon-button icon="alarm" title="snooze" onClick={@snooze}></paper-icon-button>
<paper-icon-button icon="delete" title="trash"></paper-icon-button>
</div>
</div>
else if selectionCount is 0
<div className="state-wrapper">
<div className="alldone"></div>
<div className="state">{"You're all done"}</div>
</div>
}
{
if selectionCount is 1
<div className="conversation-details">
<div className="conversation-subject">{conversation?.subject}</div>
<div className="conversation-participants">
<div>
{
if conversation?
tag = ['social', 'personal', 'service', 'newsletter'][conversation.tag] or 0
# TODO: Remove replyTo
#ignore = conversation.messages.map((message) -> message.replyTo.snapshot()).map(({ hash }) -> hash)
count = 0
for participant in conversation.participants.snapshot()
{ address, name, hash, addressHash, cached } = participant
if address isnt me
if @state.showFewParticipants
break if ++count is 4
<Participant contact={{ address, name, addressHash, cached }} tag={tag} key={hash}></Participant>
}
{
if conversation?.participants.length > 3
if @state.showFewParticipants
<div className="more" onClick={=> @toggleMoreParticipants()}>{"#{conversation.participants.length - 3} others"}</div>
else
<div className="more" onClick={=> @toggleMoreParticipants()}>{"Show #{conversation.participants.length - 3} less"}</div>
}
</div>
</div>
</div>
}
{
if selectionCount is 1
<Messages wheel={@scroll} quickReply={@quickReply} />
}
{
if selectionCount is 1
<div className="quickreply #{if not @state.quickReply then 'hidden' else ''}">
<iron-icon icon="create"></iron-icon>
<div className="mini" ><iron-icon icon="reply"></iron-icon><paper-ripple className="circle recenteringTouch" fit></paper-ripple></div>
<div className="mini"><iron-icon icon="reply-all"></iron-icon><paper-ripple className="circle recenteringTouch" fit></paper-ripple></div>
<div className="mini"><iron-icon icon="forward"></iron-icon><paper-ripple className="circle recenteringTouch" fit></paper-ripple></div>
</div>
}
</RubberBand>
</div>
module.exports = ConversationView
| 114012 | require './_main.scss'
Promise = require 'bluebird'
React = require 'react'
ReactDOM = require 'react-dom'
backend = require '../../api/bridge'
Compose = require '../Compose/Main'
TimeNotation = require '../../utils/time-notation'
Lazy = require 'lazy.js'
RubberBand = require '../Rubberband/Main'
onClickOutside = require 'react-onclickoutside'
Store = require '../../store'
{ shell, remote: { app }, remote } = require 'electron'
FILES_PATH = app.getPath('userData')+'/files/'
realm = require '../../api/realm'
SwipeController = require '../../store/swipe'
AVATAR_PATH = app.getPath('userData')+'/avatars/'
# TODO: issues here when 0 items
Participant = onClickOutside React.createClass
displayName: 'Participant'
getInitialState: ->
detailed: false
onClick: ->
@setState(detailed: true)
handleClickOutside: ->
# TODO, add 'popout' class for 100 ms or something and then set detailed: false
@setState(detailed: false)
render: ->
{ address, name, addressHash, cached } = @props.contact
<div className="ptp-rel" onClick={@onClick}>
<div className="participant #{if @state.detailed then 'active' else ''}">
<div className="avatar #{if not cached then @props.tag else ''}" style={background:if cached then "url('#{AVATAR_PATH + addressHash}') no-repeat" else ''}>
{ if not cached then (name[0] or address[0]).toUpperCase() else '' }
</div>
<div className="name">{ name }</div>
<div className="extra">
<div className="ename">{address}</div>
<paper-button onClick={=> Store.actions.compose()}>New Message</paper-button>
</div>
</div>
</div>
frameClick = (event) ->
event.preventDefault()
href = @getAttribute('href')
if href.indexOf('mailto:') is 0
alert 'todo; will compose message'
else
remote.dialog.showMessageBox({
type: 'none'
message: 'Do you want to open this link?'
detail: if href.length > 100 then href.slice(0,101)+'...' else href
buttons: ['Open Link', 'Cancel']
}, (idx) ->
shell.openExternal(href) if not idx
)
Message = React.createClass
displayName: "Message"
getInitialState: ->
minimized: false
url: null
initials: null
sizeFrame: ->
window.requestAnimationFrame( =>
message = @props.message
messageId = message.id
target = ReactDOM.findDOMNode(@refs["message-#{messageId}"])
frame = ReactDOM.findDOMNode(@refs["body-#{messageId}"])
target.style.height = 0 + 'px'
frame.style.height = 0 + 'px'
doc = frame.contentWindow.document
# TODO figure out why it gets stuck sometimes
target.style.height = doc.body.scrollHeight + 36 + 'px'
frame.style.height = doc.body.scrollHeight + 'px'
)
shouldComponentUpdate: (props, state) ->
props.message isnt @props.message or
props.tag isnt @props.tag or
props.message.from[0]?.cached isnt @props.message.from[0]?.cached
toggleMinimize: ->
###
return if @props.idx is 0 and @props.last
@setState(minimized: not @state.minimized)
###
componentDidMount: ->
conversation = Store.collections.focus?[Store.selections.lastSelected]
if conversation?.isValid()
message = conversation.messages.filtered('id == $0', @props.message.id).find(-> true)
backend.getInlineFiles(conversation.account?.address, message.folder?.path, @props.message.id)
.then =>
@writeMessageBody() # TODO
console.log 'fetched attachments'
.catch (err) ->
console.log 'failed to fetch: ', err
componentWillUnmount: ->
frame = ReactDOM.findDOMNode(@refs["body-#{@props.message.id}"])?.contentDocument
if @props.wheel? and not @props.message.draft
frame.removeEventListener('wheel', @props.wheel)
if frame?
for element in frame.getElementsByTagName('a')
element.removeEventListener('click', frameClick)
frame.innerHTML = ''
frame.src = 'about:blank'
clearTimeout(@sizeFrame)
if @props.message.draft
for element in document.querySelectorAll('.redactor-toolbar-tooltip')
element.parentElement?.removeChild(element)
for element in document.querySelectorAll('.redactor-dropdown')
element.parentElement?.removeChild(element)
mergeFiles: (body) ->
message = Store.collections.focus?[Store.selections.lastSelected]?.messages.filtered('id == $0', @props.message.id).find(-> true)
for file in message.files
if file.mimeType.indexOf('image') isnt 0 or file.size > 12 * 1024 * 1024
body += """
<div class=\"dropmail-inline-attachment\">
<div class=\"dropmail-attachment-preview\" mimeType=\"#{file.mimeType}\"></div>
<div class=\"dropmail-attachment-filename\">
#{file.filename ? '(No Name)'}
</div>
<div class=\"dropmail-attachment-size\">
#{Math.ceil(file.size / 1024)}kB
</div>
</div>
"""
else
if file.saved
if file.contentId?
cidRegexp = new RegExp("cid:#{file.contentId}(['\"])", 'gi')
body = body.replace cidRegexp, (text, quote) ->
"#{FILES_PATH}#{file.id}#{quote}"
else
body += "<img src=\"#{FILES_PATH}#{file.id}\" class=\"dropmail-inline\" />"
else
inlineImgRegexp = new RegExp("<\s*img.*src=['\"]cid:#{file.contentId}['\"][^>]*>", 'gi')
body = body.replace inlineImgRegexp, =>
'<img alt="spinner.gif" src="" style="-webkit-user-drag: none;">'
body.replace(new RegExp("src=['\"]cid:([^'\"]*)['\"]", 'g'), 'src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGNikAQAACIAHF/<KEY>Bd<KEY>="')
writeMessageBody: ->
body = @props.message.body
body = @mergeFiles(body)
style =
"""
<style>
* {
transition: .25s ease-in-out;
-moz-transition: .25s ease-in-out;
-webkit-transition: .25s ease-in-out;
}
html, body {
font-family: Roboto-Regular;
border: 0;
-webkit-text-size-adjust: auto;
word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;
line-height: 22px;
font-size:15px;
color: #1E1E1E;
margin:0;
padding:5px;
}
.gmail_extra {
display: none !important;
}
.gmail_quote {
display: none !important;
}
.mailbox_signature#mb-reply {
display: block !important;
}
#orc-full-body-initial-text {
display: none !important;
}
#orc-email-signature {
display: none !important;
}
#psignature
.dropmail_signature {
display: none !important;
}
.dropmail-inline-link {
margin-top: 10px;
height: 40px;
width: 300px;
border-radius: 3px;
border: 1px solid #CCC;
font-size: 13px;
font-family: Roboto-Medium;
color: #1E1E1E;
}
.dropmail-inline-attachment {
margin-top: 10px;
height: 40px;
width: 300px;
border-radius: 3px;
border: 1px solid #CCC;
font-size: 13px;
font-family: Roboto-Medium;
color: #1E1E1E;
}
.dropmail-inline-attachment .dropmail-attachment-filename {
//
}
.dropmail-inline-attachment .dropmail-attachment-preview {
//
}
.dropmail-inline-attachment .dropmail-attachment-size {
//
}
.dropmail-inline-attachment:hover {
background: #CCC;
}
.dropmail-inline {
display: block;
width: 100%;
height: auto;
margin-top: 10px;
}
</style>
"""
frame = ReactDOM.findDOMNode(@refs["body-#{@props.message.id}"])?.contentDocument
frame.open()
frame.write("<!DOCTYPE html>")
frame.write("<meta id='dropmail-viewport' name='viewport' content='width=device-width, maximum-scale=2.0, user-scalable=yes'>")
frame.write(style)
frame.write(body)
frame.close()
# TODO: MAJOR, remove event listeners on loop & unmount.
for element in frame.getElementsByTagName('a')
element.removeEventListener('click', frameClick)
element.addEventListener('click', frameClick)
if @props.wheel?
frame.removeEventListener('wheel', @props.wheel)
frame.addEventListener('wheel', @props.wheel)
mouseOver: ->
@props.quickReply(false)
setTimeout(@sizeFrame, 200) if not @props.message.draft
mouseOut: ->
@props.quickReply(true)
setTimeout(@sizeFrame, 200) if not @props.message.draft
fromAddress: ->
{ name, address, addressHash, cached } = @props.message.from[0]
return { name: 'No Sender', address, addressHash, cached } if not @props.message.from[0]?
if Store.global.state.accounts.length is 1
account = Store.global.state.accounts[0]
mes = [account?.address, account?.aliases.map(({ address }) -> address)...]
if @props.message.from[0].address in mes
return { name: 'Me', address, addressHash, cached }
name = @props.message.from[0].name
return { name, address, addressHash, cached }
render: ->
{ name, address, addressHash, cached } = @fromAddress()
<div className="message#{if @state.minimized then ' minimized' else ''}" style={height: if @props.message.draft then 'auto' else 80} onMouseOver={=> @mouseOver()} onMouseOut={=> @mouseOut()} ref="message-#{@props.message.id}">
{
if @props.message.draft
<Compose inline={true} />
else
<div className="message-details" onClick={@toggleMinimize}>
{
<div className="avatar #{if not cached then @props.tag else ''}" style={background:if cached then "url('#{AVATAR_PATH + addressHash}') no-repeat" else ''}>
{ if not cached then (name[0] or address[0]).toUpperCase() else '' }
</div>
}
<div className="sender">{ name }</div>
{
###
if @props.message.cc.length > 0
<div className="cc-label">CC</div>
<div className="cc"> & {@props.message.cc.length} Others</div>
###
}
<div className="reply-message">
<paper-icon-button icon="reply"></paper-icon-button>
<paper-icon-button icon="reply-all"></paper-icon-button>
<paper-icon-button icon="forward"></paper-icon-button>
</div>
<div className="timestamp"><div>{new TimeNotation(@props.message.timestamp or 0).state()}</div><div>{new TimeNotation(@props.message.timestamp or 0).replyFormat()}</div></div>
</div>
}
{
if not @props.message.draft
setTimeout(@sizeFrame, 200)
# TODO: break in to seperate iframe component?
<iframe onLoad={=> @sizeFrame()} scrolling="no" className="conversation-body" ref="body-#{@props.message.id}"></iframe>
}
</div>
Messages = React.createClass
displayName: 'Messages'
verifiedUpdate: false
getInitialState: ->
messages: []
lastSelected: 0
componentDidMount: ->
Store.collections.addListener 'messages', @refresh
@refresh()
componentDidUnmount: ->
Store.collections.removeListener('messages', @refresh)
shouldComponentUpdate: ->
@verifiedUpdate or Store.collections.focus?[Store.selections.lastSelected]?.id isnt @state.lastSelected
refresh: ->
window.requestAnimationFrame( =>
messages = []
conversation = Store.collections.focus?[Store.selections.lastSelected]
return unless conversation?.isValid()
###
only call if changed.
if conversation.unread
realm.write =>
realm.create('Outbox', {
account: Store.global.state.accounts[0]
type: 3
target: 1
initialState: '1'
targetState: '0'
timestamp: new Date()
conversations: [conversation]
})
###
messages = conversation.messages.sorted('timestamp', true).snapshot()
hashtable = {}
for i in [0...messages.length]
continue unless messages[i].isValid()
hashtable[messages[i]['serverId']] = messages[i]
messages = []
for key, message of hashtable
if message.body
messages.push({
timestamp: message.timestamp
id: message.id
from: message.from.map(({ address, name, addressHash, cached }) -> { address, name, addressHash, cached })
body: message.body
tag: message.tag
serverId: message.serverId
draft: message.folder?.type is 3
})
else
backend.getBody(conversation.account?.address, message.folder?.path, message.id)
null
hashtable = null
@verifiedUpdate = true
@setState({ messages, lastSelected: conversation.id })
)
render: ->
@verifiedUpdate = false
conversation = Store.collections.focus?[Store.selections.lastSelected]
if conversation?.isValid() and conversation.id isnt @state.lastSelected
@refresh()
<div className="messages-container">
{
for message, i in @state.messages
# TODO: event bubbling should only be on elements in view
<Message message={message} wheel={@props.wheel} quickReply={(state) => @props.quickReply(state)} tag={conversation?.tag} key={message.serverId} />
}
</div>
ConversationView = React.createClass
displayName: "ConversationView"
global: Store.global
renderTimeout: null
getInitialState: ->
show: true
hidden: false
quickReply: true
showFewParticipants: true
scrolling: false
snoozing: false
componentDidMount: ->
Store.selections.addListener =>
@prerender()
Store.global.addListener (state, prop) =>
folderType = Store.global.state.folder?.type or -1
if folderType is 6
@prerender()
Store.actions.addListener('popover', @setPopoverState)
prerender: ->
clearTimeout(@renderTimeout)
@renderTimeout = setTimeout =>
window.requestAnimationFrame( =>
@forceUpdate()
)
, 100
componentWillUnmount: ->
Store.actions.removeListener('popover', @setPopoverState)
setPopoverState: (type, orientation, boundingBox, callback) ->
@setState(snoozing: boundingBox?)
quickReply: (quickReply) ->
@setState({ quickReply })
toggleMoreParticipants: ->
@setState({ showFewParticipants: not @state.showFewParticipants })
scroll: ->
@setState(scrolling: true) if not @state.scrolling
clearTimeout(@scrolltimeout)
@scrolltimeout = setTimeout =>
@setState(scrolling:false)
, 150
snooze: ->
SwipeController.setPosition(250)
Store.actions.dispatch('popover', ['snooze', 'bottom', ReactDOM.findDOMNode(@refs['snooze']).getBoundingClientRect(), ->
SwipeController.setPosition(0, 'RESET')
])
render: ->
hide = @global.state.folder?.type is 6
selectionCount = Store.selections.count()
conversation = Store.collections.focus?[Store.selections.lastSelected]
conversation = null if not conversation?.isValid()
me = null
me = conversation.account?.address.toLowerCase() if conversation?
###
<paper-icon-button icon="list" title="snooze"></paper-icon-button>
<paper-icon-button icon="alarm" title="snooze"></paper-icon-button>
<paper-icon-button icon="visibility" title="snooze"></paper-icon-button>
<paper-icon-button icon="block" title="snooze"></paper-icon-button>
<paper-icon-button icon="print" title="snooze"></paper-icon-button>
<paper-icon-button icon="delete" title="trash"></paper-icon-button>
###
<div className="conversation-view#{if not @state.show then ' hidden' else ''}" style={display: if hide then "none"}>
{
if selectionCount is 1
styles = {
snooze: {}
}
styles.snooze = { zIndex: 2000 } if @state.snoozing
<div className="toolbar">
<paper-icon-button icon="list" title="snooze" ref="snooze"></paper-icon-button>
<paper-icon-button icon="alarm" title="snooze" style={styles.snooze} onClick={@snooze} ref="snooze"></paper-icon-button>
<paper-icon-button icon="delete" title="trash" onClick={@delete}></paper-icon-button>
<paper-icon-button icon="more-vert" title="trash"></paper-icon-button>
</div>
}
<RubberBand class="conversation-wrapper#{if @state.scrolling then ' no-events' else ''}" onScroll={@scroll}>
{
# TODO complete the selections UI
if selectionCount > 1
<div className="state-wrapper">
<div className="selectedCount">{selectionCount}</div>
<div className="state">Conversations Selected</div>
<div className="options">
<paper-icon-button icon="list" title="snooze" ref="snooze"></paper-icon-button>
<paper-icon-button icon="alarm" title="snooze" onClick={@snooze}></paper-icon-button>
<paper-icon-button icon="delete" title="trash"></paper-icon-button>
</div>
</div>
else if selectionCount is 0
<div className="state-wrapper">
<div className="alldone"></div>
<div className="state">{"You're all done"}</div>
</div>
}
{
if selectionCount is 1
<div className="conversation-details">
<div className="conversation-subject">{conversation?.subject}</div>
<div className="conversation-participants">
<div>
{
if conversation?
tag = ['social', 'personal', 'service', 'newsletter'][conversation.tag] or 0
# TODO: Remove replyTo
#ignore = conversation.messages.map((message) -> message.replyTo.snapshot()).map(({ hash }) -> hash)
count = 0
for participant in conversation.participants.snapshot()
{ address, name, hash, addressHash, cached } = participant
if address isnt me
if @state.showFewParticipants
break if ++count is 4
<Participant contact={{ address, name, addressHash, cached }} tag={tag} key={hash}></Participant>
}
{
if conversation?.participants.length > 3
if @state.showFewParticipants
<div className="more" onClick={=> @toggleMoreParticipants()}>{"#{conversation.participants.length - 3} others"}</div>
else
<div className="more" onClick={=> @toggleMoreParticipants()}>{"Show #{conversation.participants.length - 3} less"}</div>
}
</div>
</div>
</div>
}
{
if selectionCount is 1
<Messages wheel={@scroll} quickReply={@quickReply} />
}
{
if selectionCount is 1
<div className="quickreply #{if not @state.quickReply then 'hidden' else ''}">
<iron-icon icon="create"></iron-icon>
<div className="mini" ><iron-icon icon="reply"></iron-icon><paper-ripple className="circle recenteringTouch" fit></paper-ripple></div>
<div className="mini"><iron-icon icon="reply-all"></iron-icon><paper-ripple className="circle recenteringTouch" fit></paper-ripple></div>
<div className="mini"><iron-icon icon="forward"></iron-icon><paper-ripple className="circle recenteringTouch" fit></paper-ripple></div>
</div>
}
</RubberBand>
</div>
module.exports = ConversationView
| true | require './_main.scss'
Promise = require 'bluebird'
React = require 'react'
ReactDOM = require 'react-dom'
backend = require '../../api/bridge'
Compose = require '../Compose/Main'
TimeNotation = require '../../utils/time-notation'
Lazy = require 'lazy.js'
RubberBand = require '../Rubberband/Main'
onClickOutside = require 'react-onclickoutside'
Store = require '../../store'
{ shell, remote: { app }, remote } = require 'electron'
FILES_PATH = app.getPath('userData')+'/files/'
realm = require '../../api/realm'
SwipeController = require '../../store/swipe'
AVATAR_PATH = app.getPath('userData')+'/avatars/'
# TODO: issues here when 0 items
Participant = onClickOutside React.createClass
displayName: 'Participant'
getInitialState: ->
detailed: false
onClick: ->
@setState(detailed: true)
handleClickOutside: ->
# TODO, add 'popout' class for 100 ms or something and then set detailed: false
@setState(detailed: false)
render: ->
{ address, name, addressHash, cached } = @props.contact
<div className="ptp-rel" onClick={@onClick}>
<div className="participant #{if @state.detailed then 'active' else ''}">
<div className="avatar #{if not cached then @props.tag else ''}" style={background:if cached then "url('#{AVATAR_PATH + addressHash}') no-repeat" else ''}>
{ if not cached then (name[0] or address[0]).toUpperCase() else '' }
</div>
<div className="name">{ name }</div>
<div className="extra">
<div className="ename">{address}</div>
<paper-button onClick={=> Store.actions.compose()}>New Message</paper-button>
</div>
</div>
</div>
frameClick = (event) ->
event.preventDefault()
href = @getAttribute('href')
if href.indexOf('mailto:') is 0
alert 'todo; will compose message'
else
remote.dialog.showMessageBox({
type: 'none'
message: 'Do you want to open this link?'
detail: if href.length > 100 then href.slice(0,101)+'...' else href
buttons: ['Open Link', 'Cancel']
}, (idx) ->
shell.openExternal(href) if not idx
)
Message = React.createClass
displayName: "Message"
getInitialState: ->
minimized: false
url: null
initials: null
sizeFrame: ->
window.requestAnimationFrame( =>
message = @props.message
messageId = message.id
target = ReactDOM.findDOMNode(@refs["message-#{messageId}"])
frame = ReactDOM.findDOMNode(@refs["body-#{messageId}"])
target.style.height = 0 + 'px'
frame.style.height = 0 + 'px'
doc = frame.contentWindow.document
# TODO figure out why it gets stuck sometimes
target.style.height = doc.body.scrollHeight + 36 + 'px'
frame.style.height = doc.body.scrollHeight + 'px'
)
shouldComponentUpdate: (props, state) ->
props.message isnt @props.message or
props.tag isnt @props.tag or
props.message.from[0]?.cached isnt @props.message.from[0]?.cached
toggleMinimize: ->
###
return if @props.idx is 0 and @props.last
@setState(minimized: not @state.minimized)
###
componentDidMount: ->
conversation = Store.collections.focus?[Store.selections.lastSelected]
if conversation?.isValid()
message = conversation.messages.filtered('id == $0', @props.message.id).find(-> true)
backend.getInlineFiles(conversation.account?.address, message.folder?.path, @props.message.id)
.then =>
@writeMessageBody() # TODO
console.log 'fetched attachments'
.catch (err) ->
console.log 'failed to fetch: ', err
componentWillUnmount: ->
frame = ReactDOM.findDOMNode(@refs["body-#{@props.message.id}"])?.contentDocument
if @props.wheel? and not @props.message.draft
frame.removeEventListener('wheel', @props.wheel)
if frame?
for element in frame.getElementsByTagName('a')
element.removeEventListener('click', frameClick)
frame.innerHTML = ''
frame.src = 'about:blank'
clearTimeout(@sizeFrame)
if @props.message.draft
for element in document.querySelectorAll('.redactor-toolbar-tooltip')
element.parentElement?.removeChild(element)
for element in document.querySelectorAll('.redactor-dropdown')
element.parentElement?.removeChild(element)
mergeFiles: (body) ->
message = Store.collections.focus?[Store.selections.lastSelected]?.messages.filtered('id == $0', @props.message.id).find(-> true)
for file in message.files
if file.mimeType.indexOf('image') isnt 0 or file.size > 12 * 1024 * 1024
body += """
<div class=\"dropmail-inline-attachment\">
<div class=\"dropmail-attachment-preview\" mimeType=\"#{file.mimeType}\"></div>
<div class=\"dropmail-attachment-filename\">
#{file.filename ? '(No Name)'}
</div>
<div class=\"dropmail-attachment-size\">
#{Math.ceil(file.size / 1024)}kB
</div>
</div>
"""
else
if file.saved
if file.contentId?
cidRegexp = new RegExp("cid:#{file.contentId}(['\"])", 'gi')
body = body.replace cidRegexp, (text, quote) ->
"#{FILES_PATH}#{file.id}#{quote}"
else
body += "<img src=\"#{FILES_PATH}#{file.id}\" class=\"dropmail-inline\" />"
else
inlineImgRegexp = new RegExp("<\s*img.*src=['\"]cid:#{file.contentId}['\"][^>]*>", 'gi')
body = body.replace inlineImgRegexp, =>
'<img alt="spinner.gif" src="" style="-webkit-user-drag: none;">'
body.replace(new RegExp("src=['\"]cid:([^'\"]*)['\"]", 'g'), 'src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGNikAQAACIAHF/PI:KEY:<KEY>END_PIBdPI:KEY:<KEY>END_PI="')
writeMessageBody: ->
body = @props.message.body
body = @mergeFiles(body)
style =
"""
<style>
* {
transition: .25s ease-in-out;
-moz-transition: .25s ease-in-out;
-webkit-transition: .25s ease-in-out;
}
html, body {
font-family: Roboto-Regular;
border: 0;
-webkit-text-size-adjust: auto;
word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;
line-height: 22px;
font-size:15px;
color: #1E1E1E;
margin:0;
padding:5px;
}
.gmail_extra {
display: none !important;
}
.gmail_quote {
display: none !important;
}
.mailbox_signature#mb-reply {
display: block !important;
}
#orc-full-body-initial-text {
display: none !important;
}
#orc-email-signature {
display: none !important;
}
#psignature
.dropmail_signature {
display: none !important;
}
.dropmail-inline-link {
margin-top: 10px;
height: 40px;
width: 300px;
border-radius: 3px;
border: 1px solid #CCC;
font-size: 13px;
font-family: Roboto-Medium;
color: #1E1E1E;
}
.dropmail-inline-attachment {
margin-top: 10px;
height: 40px;
width: 300px;
border-radius: 3px;
border: 1px solid #CCC;
font-size: 13px;
font-family: Roboto-Medium;
color: #1E1E1E;
}
.dropmail-inline-attachment .dropmail-attachment-filename {
//
}
.dropmail-inline-attachment .dropmail-attachment-preview {
//
}
.dropmail-inline-attachment .dropmail-attachment-size {
//
}
.dropmail-inline-attachment:hover {
background: #CCC;
}
.dropmail-inline {
display: block;
width: 100%;
height: auto;
margin-top: 10px;
}
</style>
"""
frame = ReactDOM.findDOMNode(@refs["body-#{@props.message.id}"])?.contentDocument
frame.open()
frame.write("<!DOCTYPE html>")
frame.write("<meta id='dropmail-viewport' name='viewport' content='width=device-width, maximum-scale=2.0, user-scalable=yes'>")
frame.write(style)
frame.write(body)
frame.close()
# TODO: MAJOR, remove event listeners on loop & unmount.
for element in frame.getElementsByTagName('a')
element.removeEventListener('click', frameClick)
element.addEventListener('click', frameClick)
if @props.wheel?
frame.removeEventListener('wheel', @props.wheel)
frame.addEventListener('wheel', @props.wheel)
mouseOver: ->
@props.quickReply(false)
setTimeout(@sizeFrame, 200) if not @props.message.draft
mouseOut: ->
@props.quickReply(true)
setTimeout(@sizeFrame, 200) if not @props.message.draft
fromAddress: ->
{ name, address, addressHash, cached } = @props.message.from[0]
return { name: 'No Sender', address, addressHash, cached } if not @props.message.from[0]?
if Store.global.state.accounts.length is 1
account = Store.global.state.accounts[0]
mes = [account?.address, account?.aliases.map(({ address }) -> address)...]
if @props.message.from[0].address in mes
return { name: 'Me', address, addressHash, cached }
name = @props.message.from[0].name
return { name, address, addressHash, cached }
render: ->
{ name, address, addressHash, cached } = @fromAddress()
<div className="message#{if @state.minimized then ' minimized' else ''}" style={height: if @props.message.draft then 'auto' else 80} onMouseOver={=> @mouseOver()} onMouseOut={=> @mouseOut()} ref="message-#{@props.message.id}">
{
if @props.message.draft
<Compose inline={true} />
else
<div className="message-details" onClick={@toggleMinimize}>
{
<div className="avatar #{if not cached then @props.tag else ''}" style={background:if cached then "url('#{AVATAR_PATH + addressHash}') no-repeat" else ''}>
{ if not cached then (name[0] or address[0]).toUpperCase() else '' }
</div>
}
<div className="sender">{ name }</div>
{
###
if @props.message.cc.length > 0
<div className="cc-label">CC</div>
<div className="cc"> & {@props.message.cc.length} Others</div>
###
}
<div className="reply-message">
<paper-icon-button icon="reply"></paper-icon-button>
<paper-icon-button icon="reply-all"></paper-icon-button>
<paper-icon-button icon="forward"></paper-icon-button>
</div>
<div className="timestamp"><div>{new TimeNotation(@props.message.timestamp or 0).state()}</div><div>{new TimeNotation(@props.message.timestamp or 0).replyFormat()}</div></div>
</div>
}
{
if not @props.message.draft
setTimeout(@sizeFrame, 200)
# TODO: break in to seperate iframe component?
<iframe onLoad={=> @sizeFrame()} scrolling="no" className="conversation-body" ref="body-#{@props.message.id}"></iframe>
}
</div>
Messages = React.createClass
displayName: 'Messages'
verifiedUpdate: false
getInitialState: ->
messages: []
lastSelected: 0
componentDidMount: ->
Store.collections.addListener 'messages', @refresh
@refresh()
componentDidUnmount: ->
Store.collections.removeListener('messages', @refresh)
shouldComponentUpdate: ->
@verifiedUpdate or Store.collections.focus?[Store.selections.lastSelected]?.id isnt @state.lastSelected
refresh: ->
window.requestAnimationFrame( =>
messages = []
conversation = Store.collections.focus?[Store.selections.lastSelected]
return unless conversation?.isValid()
###
only call if changed.
if conversation.unread
realm.write =>
realm.create('Outbox', {
account: Store.global.state.accounts[0]
type: 3
target: 1
initialState: '1'
targetState: '0'
timestamp: new Date()
conversations: [conversation]
})
###
messages = conversation.messages.sorted('timestamp', true).snapshot()
hashtable = {}
for i in [0...messages.length]
continue unless messages[i].isValid()
hashtable[messages[i]['serverId']] = messages[i]
messages = []
for key, message of hashtable
if message.body
messages.push({
timestamp: message.timestamp
id: message.id
from: message.from.map(({ address, name, addressHash, cached }) -> { address, name, addressHash, cached })
body: message.body
tag: message.tag
serverId: message.serverId
draft: message.folder?.type is 3
})
else
backend.getBody(conversation.account?.address, message.folder?.path, message.id)
null
hashtable = null
@verifiedUpdate = true
@setState({ messages, lastSelected: conversation.id })
)
render: ->
@verifiedUpdate = false
conversation = Store.collections.focus?[Store.selections.lastSelected]
if conversation?.isValid() and conversation.id isnt @state.lastSelected
@refresh()
<div className="messages-container">
{
for message, i in @state.messages
# TODO: event bubbling should only be on elements in view
<Message message={message} wheel={@props.wheel} quickReply={(state) => @props.quickReply(state)} tag={conversation?.tag} key={message.serverId} />
}
</div>
ConversationView = React.createClass
displayName: "ConversationView"
global: Store.global
renderTimeout: null
getInitialState: ->
show: true
hidden: false
quickReply: true
showFewParticipants: true
scrolling: false
snoozing: false
componentDidMount: ->
Store.selections.addListener =>
@prerender()
Store.global.addListener (state, prop) =>
folderType = Store.global.state.folder?.type or -1
if folderType is 6
@prerender()
Store.actions.addListener('popover', @setPopoverState)
prerender: ->
clearTimeout(@renderTimeout)
@renderTimeout = setTimeout =>
window.requestAnimationFrame( =>
@forceUpdate()
)
, 100
componentWillUnmount: ->
Store.actions.removeListener('popover', @setPopoverState)
setPopoverState: (type, orientation, boundingBox, callback) ->
@setState(snoozing: boundingBox?)
quickReply: (quickReply) ->
@setState({ quickReply })
toggleMoreParticipants: ->
@setState({ showFewParticipants: not @state.showFewParticipants })
scroll: ->
@setState(scrolling: true) if not @state.scrolling
clearTimeout(@scrolltimeout)
@scrolltimeout = setTimeout =>
@setState(scrolling:false)
, 150
snooze: ->
SwipeController.setPosition(250)
Store.actions.dispatch('popover', ['snooze', 'bottom', ReactDOM.findDOMNode(@refs['snooze']).getBoundingClientRect(), ->
SwipeController.setPosition(0, 'RESET')
])
render: ->
hide = @global.state.folder?.type is 6
selectionCount = Store.selections.count()
conversation = Store.collections.focus?[Store.selections.lastSelected]
conversation = null if not conversation?.isValid()
me = null
me = conversation.account?.address.toLowerCase() if conversation?
###
<paper-icon-button icon="list" title="snooze"></paper-icon-button>
<paper-icon-button icon="alarm" title="snooze"></paper-icon-button>
<paper-icon-button icon="visibility" title="snooze"></paper-icon-button>
<paper-icon-button icon="block" title="snooze"></paper-icon-button>
<paper-icon-button icon="print" title="snooze"></paper-icon-button>
<paper-icon-button icon="delete" title="trash"></paper-icon-button>
###
<div className="conversation-view#{if not @state.show then ' hidden' else ''}" style={display: if hide then "none"}>
{
if selectionCount is 1
styles = {
snooze: {}
}
styles.snooze = { zIndex: 2000 } if @state.snoozing
<div className="toolbar">
<paper-icon-button icon="list" title="snooze" ref="snooze"></paper-icon-button>
<paper-icon-button icon="alarm" title="snooze" style={styles.snooze} onClick={@snooze} ref="snooze"></paper-icon-button>
<paper-icon-button icon="delete" title="trash" onClick={@delete}></paper-icon-button>
<paper-icon-button icon="more-vert" title="trash"></paper-icon-button>
</div>
}
<RubberBand class="conversation-wrapper#{if @state.scrolling then ' no-events' else ''}" onScroll={@scroll}>
{
# TODO complete the selections UI
if selectionCount > 1
<div className="state-wrapper">
<div className="selectedCount">{selectionCount}</div>
<div className="state">Conversations Selected</div>
<div className="options">
<paper-icon-button icon="list" title="snooze" ref="snooze"></paper-icon-button>
<paper-icon-button icon="alarm" title="snooze" onClick={@snooze}></paper-icon-button>
<paper-icon-button icon="delete" title="trash"></paper-icon-button>
</div>
</div>
else if selectionCount is 0
<div className="state-wrapper">
<div className="alldone"></div>
<div className="state">{"You're all done"}</div>
</div>
}
{
if selectionCount is 1
<div className="conversation-details">
<div className="conversation-subject">{conversation?.subject}</div>
<div className="conversation-participants">
<div>
{
if conversation?
tag = ['social', 'personal', 'service', 'newsletter'][conversation.tag] or 0
# TODO: Remove replyTo
#ignore = conversation.messages.map((message) -> message.replyTo.snapshot()).map(({ hash }) -> hash)
count = 0
for participant in conversation.participants.snapshot()
{ address, name, hash, addressHash, cached } = participant
if address isnt me
if @state.showFewParticipants
break if ++count is 4
<Participant contact={{ address, name, addressHash, cached }} tag={tag} key={hash}></Participant>
}
{
if conversation?.participants.length > 3
if @state.showFewParticipants
<div className="more" onClick={=> @toggleMoreParticipants()}>{"#{conversation.participants.length - 3} others"}</div>
else
<div className="more" onClick={=> @toggleMoreParticipants()}>{"Show #{conversation.participants.length - 3} less"}</div>
}
</div>
</div>
</div>
}
{
if selectionCount is 1
<Messages wheel={@scroll} quickReply={@quickReply} />
}
{
if selectionCount is 1
<div className="quickreply #{if not @state.quickReply then 'hidden' else ''}">
<iron-icon icon="create"></iron-icon>
<div className="mini" ><iron-icon icon="reply"></iron-icon><paper-ripple className="circle recenteringTouch" fit></paper-ripple></div>
<div className="mini"><iron-icon icon="reply-all"></iron-icon><paper-ripple className="circle recenteringTouch" fit></paper-ripple></div>
<div className="mini"><iron-icon icon="forward"></iron-icon><paper-ripple className="circle recenteringTouch" fit></paper-ripple></div>
</div>
}
</RubberBand>
</div>
module.exports = ConversationView
|
[
{
"context": "search form with hidden swd input field\n * @author Robert Kolatzek\n * @copyright Robert Kolatzek\n * @version 1.0 \n##",
"end": 130,
"score": 0.9998878240585327,
"start": 115,
"tag": "NAME",
"value": "Robert Kolatzek"
},
{
"context": "put field\n * @author Robert Kolatzek\n * @copyright Robert Kolatzek\n * @version 1.0 \n### \n",
"end": 160,
"score": 0.9998830556869507,
"start": 145,
"tag": "NAME",
"value": "Robert Kolatzek"
}
] | src/header.coffee | SULB/GNDcoffeine | 0 | ###
* Convert swd input text field with sorrounding div into a search form with hidden swd input field
* @author Robert Kolatzek
* @copyright Robert Kolatzek
* @version 1.0
###
| 191643 | ###
* Convert swd input text field with sorrounding div into a search form with hidden swd input field
* @author <NAME>
* @copyright <NAME>
* @version 1.0
###
| true | ###
* Convert swd input text field with sorrounding div into a search form with hidden swd input field
* @author PI:NAME:<NAME>END_PI
* @copyright PI:NAME:<NAME>END_PI
* @version 1.0
###
|
[
{
"context": "api_key = \"fCXo05bxAfCoY31I5vtcmPr8AEY3uQTr\"\n\nfetch_sm = (url, callback) ->\n $.ajax\n url:",
"end": 43,
"score": 0.9996048808097839,
"start": 11,
"tag": "KEY",
"value": "fCXo05bxAfCoY31I5vtcmPr8AEY3uQTr"
},
{
"context": "bumImage\"])\n\n # Show assets\n if key == \"C87GJX\" or key == \"j3PdMh\"\n fetch_usage_list \"/fe",
"end": 2181,
"score": 0.9985311627388,
"start": 2175,
"tag": "KEY",
"value": "C87GJX"
},
{
"context": "# Show assets\n if key == \"C87GJX\" or key == \"j3PdMh\"\n fetch_usage_list \"/feeds/smug_images.jso",
"end": 2200,
"score": 0.999173641204834,
"start": 2194,
"tag": "KEY",
"value": "j3PdMh"
},
{
"context": ".tablesorter()\n # Headshots\n if key == \"hZh8Jt\"\n fetch_usage_list \"/feeds/smug_headshots.",
"end": 2378,
"score": 0.9967339038848877,
"start": 2372,
"tag": "KEY",
"value": "hZh8Jt"
},
{
"context": "s\").tablesorter()\n # Venues\n if key == \"BdFr84\"\n fetch_usage_list \"/feeds/smug_venues.jso",
"end": 2556,
"score": 0.999025821685791,
"start": 2550,
"tag": "KEY",
"value": "BdFr84"
}
] | _coffee/scripts/utility.coffee | johnathan99j/history-project | 17 | api_key = "fCXo05bxAfCoY31I5vtcmPr8AEY3uQTr"
fetch_sm = (url, callback) ->
$.ajax
url: "https://www.smugmug.com/api/v2/#{ url }?APIKey=#{ api_key }&count=5000"
method: "GET"
contentType: "application/json; charset=utf-8",
dataType: "json",
success: callback
error: (err) ->
alert "Error: #{err}"
fill_album_list = (albums) ->
ret = ""
$(albums).each (i, album) ->
ret += "<tr class=\"album-row\" data-key=\"#{ album["AlbumKey"] }\"><td><a href=\"#{ album['WebUri'] }\" class=\"usage-link\">#{ album["Name"] }</a></td><td>#{ album["AlbumKey"] }</td><td>#{ album["ImageCount"] }</td><td class=\"usage\">?</td></tr>\n"
$("#smug-albums tbody").html(ret)
fill_image_list = (images) ->
ret = ""
$(images).each (i, image) ->
ret += "<tr class=\"image-row\" data-key=\"#{ image["ImageKey"] }\"><td><a href=\"#{ image['WebUri'] }\"><img src=\"#{ image["ThumbnailUrl"] }\" alt=\"Thumb\"/></a><td>#{ image["Title"] }</td><td>#{ image["FileName"] }</td><td>#{ image["ImageKey"] }</td><td class=\"usage\">?</td></tr>\n"
$("#smug-images tbody").html(ret)
fetch_usage_list = (url, callback) ->
$.ajax
url: url
method: "GET"
contentType: "application/json; charset=utf-8",
dataType: "json",
success: callback
error: (err) ->
alert "Error: #{err}"
add_usage_data = (albums) ->
$.each albums, (albumKey, show) ->
$("[data-key=#{albumKey}] .usage").html("<a href=\"#{ show['link'] }\" title=\"#{ show['title'] }\"
class=\"usage-link\">Y</a>").addClass("yes")
document.addEventListener 'DOMContentLoaded', ->
if $('body').hasClass 'util-smug-albums'
fetch_sm "user/newtheatre!albums", (data) ->
window.d = data
fill_album_list(data["Response"]["Album"])
fetch_usage_list "/feeds/smug_albums.json", (data) ->
add_usage_data(data)
$("#smug-albums").tablesorter()
if $('body').hasClass 'util-smug-album'
key = $('#smug-images').data("album")
fetch_sm "album/#{ key }!images", (data) ->
window.d = data
fill_image_list(data["Response"]["AlbumImage"])
# Show assets
if key == "C87GJX" or key == "j3PdMh"
fetch_usage_list "/feeds/smug_images.json", (data) ->
add_usage_data(data)
$("#smug-images").tablesorter()
# Headshots
if key == "hZh8Jt"
fetch_usage_list "/feeds/smug_headshots.json", (data) ->
add_usage_data(data)
$("#smug-images").tablesorter()
# Venues
if key == "BdFr84"
fetch_usage_list "/feeds/smug_venues.json", (data) ->
add_usage_data(data)
$("#smug-images").tablesorter()
| 10257 | api_key = "<KEY>"
fetch_sm = (url, callback) ->
$.ajax
url: "https://www.smugmug.com/api/v2/#{ url }?APIKey=#{ api_key }&count=5000"
method: "GET"
contentType: "application/json; charset=utf-8",
dataType: "json",
success: callback
error: (err) ->
alert "Error: #{err}"
fill_album_list = (albums) ->
ret = ""
$(albums).each (i, album) ->
ret += "<tr class=\"album-row\" data-key=\"#{ album["AlbumKey"] }\"><td><a href=\"#{ album['WebUri'] }\" class=\"usage-link\">#{ album["Name"] }</a></td><td>#{ album["AlbumKey"] }</td><td>#{ album["ImageCount"] }</td><td class=\"usage\">?</td></tr>\n"
$("#smug-albums tbody").html(ret)
fill_image_list = (images) ->
ret = ""
$(images).each (i, image) ->
ret += "<tr class=\"image-row\" data-key=\"#{ image["ImageKey"] }\"><td><a href=\"#{ image['WebUri'] }\"><img src=\"#{ image["ThumbnailUrl"] }\" alt=\"Thumb\"/></a><td>#{ image["Title"] }</td><td>#{ image["FileName"] }</td><td>#{ image["ImageKey"] }</td><td class=\"usage\">?</td></tr>\n"
$("#smug-images tbody").html(ret)
fetch_usage_list = (url, callback) ->
$.ajax
url: url
method: "GET"
contentType: "application/json; charset=utf-8",
dataType: "json",
success: callback
error: (err) ->
alert "Error: #{err}"
add_usage_data = (albums) ->
$.each albums, (albumKey, show) ->
$("[data-key=#{albumKey}] .usage").html("<a href=\"#{ show['link'] }\" title=\"#{ show['title'] }\"
class=\"usage-link\">Y</a>").addClass("yes")
document.addEventListener 'DOMContentLoaded', ->
if $('body').hasClass 'util-smug-albums'
fetch_sm "user/newtheatre!albums", (data) ->
window.d = data
fill_album_list(data["Response"]["Album"])
fetch_usage_list "/feeds/smug_albums.json", (data) ->
add_usage_data(data)
$("#smug-albums").tablesorter()
if $('body').hasClass 'util-smug-album'
key = $('#smug-images').data("album")
fetch_sm "album/#{ key }!images", (data) ->
window.d = data
fill_image_list(data["Response"]["AlbumImage"])
# Show assets
if key == "<KEY>" or key == "<KEY>"
fetch_usage_list "/feeds/smug_images.json", (data) ->
add_usage_data(data)
$("#smug-images").tablesorter()
# Headshots
if key == "<KEY>"
fetch_usage_list "/feeds/smug_headshots.json", (data) ->
add_usage_data(data)
$("#smug-images").tablesorter()
# Venues
if key == "<KEY>"
fetch_usage_list "/feeds/smug_venues.json", (data) ->
add_usage_data(data)
$("#smug-images").tablesorter()
| true | api_key = "PI:KEY:<KEY>END_PI"
fetch_sm = (url, callback) ->
$.ajax
url: "https://www.smugmug.com/api/v2/#{ url }?APIKey=#{ api_key }&count=5000"
method: "GET"
contentType: "application/json; charset=utf-8",
dataType: "json",
success: callback
error: (err) ->
alert "Error: #{err}"
fill_album_list = (albums) ->
ret = ""
$(albums).each (i, album) ->
ret += "<tr class=\"album-row\" data-key=\"#{ album["AlbumKey"] }\"><td><a href=\"#{ album['WebUri'] }\" class=\"usage-link\">#{ album["Name"] }</a></td><td>#{ album["AlbumKey"] }</td><td>#{ album["ImageCount"] }</td><td class=\"usage\">?</td></tr>\n"
$("#smug-albums tbody").html(ret)
fill_image_list = (images) ->
ret = ""
$(images).each (i, image) ->
ret += "<tr class=\"image-row\" data-key=\"#{ image["ImageKey"] }\"><td><a href=\"#{ image['WebUri'] }\"><img src=\"#{ image["ThumbnailUrl"] }\" alt=\"Thumb\"/></a><td>#{ image["Title"] }</td><td>#{ image["FileName"] }</td><td>#{ image["ImageKey"] }</td><td class=\"usage\">?</td></tr>\n"
$("#smug-images tbody").html(ret)
fetch_usage_list = (url, callback) ->
$.ajax
url: url
method: "GET"
contentType: "application/json; charset=utf-8",
dataType: "json",
success: callback
error: (err) ->
alert "Error: #{err}"
add_usage_data = (albums) ->
$.each albums, (albumKey, show) ->
$("[data-key=#{albumKey}] .usage").html("<a href=\"#{ show['link'] }\" title=\"#{ show['title'] }\"
class=\"usage-link\">Y</a>").addClass("yes")
document.addEventListener 'DOMContentLoaded', ->
if $('body').hasClass 'util-smug-albums'
fetch_sm "user/newtheatre!albums", (data) ->
window.d = data
fill_album_list(data["Response"]["Album"])
fetch_usage_list "/feeds/smug_albums.json", (data) ->
add_usage_data(data)
$("#smug-albums").tablesorter()
if $('body').hasClass 'util-smug-album'
key = $('#smug-images').data("album")
fetch_sm "album/#{ key }!images", (data) ->
window.d = data
fill_image_list(data["Response"]["AlbumImage"])
# Show assets
if key == "PI:KEY:<KEY>END_PI" or key == "PI:KEY:<KEY>END_PI"
fetch_usage_list "/feeds/smug_images.json", (data) ->
add_usage_data(data)
$("#smug-images").tablesorter()
# Headshots
if key == "PI:KEY:<KEY>END_PI"
fetch_usage_list "/feeds/smug_headshots.json", (data) ->
add_usage_data(data)
$("#smug-images").tablesorter()
# Venues
if key == "PI:KEY:<KEY>END_PI"
fetch_usage_list "/feeds/smug_venues.json", (data) ->
add_usage_data(data)
$("#smug-images").tablesorter()
|
[
{
"context": "otypal ones.\nclass Cat\n constructor: -> @name = 'Whiskers'\n breed: 'tabby'\n hair: 'cream'\n\nwhiskers = ne",
"end": 4109,
"score": 0.9993265271186829,
"start": 4101,
"tag": "NAME",
"value": "Whiskers"
}
] | test/comprehensions.coffee | jeremyBanks-archive/coffeescript | 1 | # Comprehensions
# --------------
# * Array Comprehensions
# * Range Comprehensions
# * Object Comprehensions
# * Implicit Destructuring Assignment
# * Comprehensions with Nonstandard Step
# TODO: refactor comprehension tests
# Basic array comprehensions.
nums = (n * n for n in [1, 2, 3] when n & 1)
results = (n * 2 for n in nums)
ok results.join(',') is '2,18'
# Basic object comprehensions.
obj = {one: 1, two: 2, three: 3}
names = (prop + '!' for prop of obj)
odds = (prop + '!' for prop, value of obj when value & 1)
ok names.join(' ') is "one! two! three!"
ok odds.join(' ') is "one! three!"
# Basic range comprehensions.
nums = (i * 3 for i in [1..3])
negs = (x for x in [-20..-5*2])
negs = negs[0..2]
result = nums.concat(negs).join(', ')
ok result is '3, 6, 9, -20, -19, -18'
# With range comprehensions, you can loop in steps.
results = (x for x in [0...15] by 5)
ok results.join(' ') is '0 5 10'
results = (x for x in [0..100] by 10)
ok results.join(' ') is '0 10 20 30 40 50 60 70 80 90 100'
# And can loop downwards, with a negative step.
results = (x for x in [5..1])
ok results.join(' ') is '5 4 3 2 1'
ok results.join(' ') is [(10-5)..(-2+3)].join(' ')
results = (x for x in [10..1])
ok results.join(' ') is [10..1].join(' ')
results = (x for x in [10...0] by -2)
ok results.join(' ') is [10, 8, 6, 4, 2].join(' ')
# Range comprehension gymnastics.
eq "#{i for i in [5..1]}", '5,4,3,2,1'
eq "#{i for i in [5..-5] by -5}", '5,0,-5'
a = 6
b = 0
c = -2
eq "#{i for i in [a..b]}", '6,5,4,3,2,1,0'
eq "#{i for i in [a..b] by c}", '6,4,2,0'
# Multiline array comprehension with filter.
evens = for num in [1, 2, 3, 4, 5, 6] when not (num & 1)
num *= -1
num -= 2
num * -1
eq evens + '', '4,6,8'
# The in operator still works, standalone.
ok 2 of evens
# all isn't reserved.
all = 1
# Ensure that the closure wrapper preserves local variables.
obj = {}
for method in ['one', 'two', 'three'] then do (method) ->
obj[method] = ->
"I'm " + method
ok obj.one() is "I'm one"
ok obj.two() is "I'm two"
ok obj.three() is "I'm three"
# Index values at the end of a loop.
i = 0
for i in [1..3]
-> 'func'
break if false
ok i is 4
# Ensure that local variables are closed over for range comprehensions.
funcs = for i in [1..3]
do (i) ->
-> -i
eq (func() for func in funcs).join(' '), '-1 -2 -3'
ok i is 4
# Even when referenced in the filter.
list = ['one', 'two', 'three']
methods = for num, i in list when num isnt 'two' and i isnt 1
do (num, i) ->
-> num + ' ' + i
ok methods.length is 2
ok methods[0]() is 'one 0'
ok methods[1]() is 'three 2'
# Even a convoluted one.
funcs = []
for i in [1..3]
do (i) ->
x = i * 2
((z)->
funcs.push -> z + ' ' + i
)(x)
ok (func() for func in funcs).join(', ') is '2 1, 4 2, 6 3'
funcs = []
results = for i in [1..3]
do (i) ->
z = (x * 3 for x in [1..i])
((a, b, c) -> [a, b, c].join(' ')).apply this, z
ok results.join(', ') is '3 , 3 6 , 3 6 9'
# Naked ranges are expanded into arrays.
array = [0..10]
ok(num % 2 is 0 for num in array by 2)
# Nested shared scopes.
foo = ->
for i in [0..7]
do (i) ->
for j in [0..7]
do (j) ->
-> i + j
eq foo()[3][4](), 7
# Scoped loop pattern matching.
a = [[0], [1]]
funcs = []
for [v] in a
do (v) ->
funcs.push -> v
eq funcs[0](), 0
eq funcs[1](), 1
# Nested comprehensions.
multiLiner =
for x in [3..5]
for y in [3..5]
[x, y]
singleLiner =
(([x, y] for y in [3..5]) for x in [3..5])
ok multiLiner.length is singleLiner.length
ok 5 is multiLiner[2][2][1]
ok 5 is singleLiner[2][2][1]
# Comprehensions within parentheses.
result = null
store = (obj) -> result = obj
store (x * 2 for x in [3, 2, 1])
ok result.join(' ') is '6 4 2'
# Closure-wrapped comprehensions that refer to the "arguments" object.
expr = ->
result = (item * item for item in arguments)
ok expr(2, 4, 8).join(' ') is '4 16 64'
# Fast object comprehensions over all properties, including prototypal ones.
class Cat
constructor: -> @name = 'Whiskers'
breed: 'tabby'
hair: 'cream'
whiskers = new Cat
own = (value for own key, value of whiskers)
all = (value for key, value of whiskers)
ok own.join(' ') is 'Whiskers'
ok all.sort().join(' ') is 'Whiskers cream tabby'
# Optimized range comprehensions.
exxes = ('x' for [0...10])
ok exxes.join(' ') is 'x x x x x x x x x x'
# Comprehensions safely redeclare parameters if they're not present in closest
# scope.
rule = (x) -> x
learn = ->
rule for rule in [1, 2, 3]
ok learn().join(' ') is '1 2 3'
ok rule(101) is 101
f = -> [-> ok no, 'should cache source']
ok yes for k of [f] = f()
# Lenient on pure statements not trying to reach out of the closure
val = for i in [1]
for j in [] then break
i
ok val[0] is i
# Comprehensions only wrap their last line in a closure, allowing other lines
# to have pure expressions in them.
func = -> for i in [1]
break if i is 2
j for j in [1]
ok func()[0][0] is 1
i = 6
odds = while i--
continue unless i & 1
i
ok odds.join(', ') is '5, 3, 1'
# Issue #897: Ensure that plucked function variables aren't leaked.
facets = {}
list = ['one', 'two']
(->
for entity in list
facets[entity] = -> entity
)()
eq typeof entity, 'undefined'
eq facets['two'](), 'two'
# Issue #905. Soaks as the for loop subject.
a = {b: {c: [1, 2, 3]}}
for d in a.b?.c
e = d
eq e, 3
# Issue #948. Capturing loop variables.
funcs = []
list = ->
[1, 2, 3]
for y in list()
do (y) ->
z = y
funcs.push -> "y is #{y} and z is #{z}"
eq funcs[1](), "y is 2 and z is 2"
# Cancel the comprehension if there's a jump inside the loop.
result = try
for i in [0...10]
continue if i < 5
i
eq result, 10
# Comprehensions over break.
arrayEq (break for [1..10]), []
# Comprehensions over continue.
arrayEq (break for [1..10]), []
# Comprehensions over function literals.
a = 0
for f in [-> a = 1]
do (f) ->
do f
eq a, 1
# Comprehensions that mention arguments.
list = [arguments: 10]
args = for f in list
do (f) ->
f.arguments
eq args[0], 10
test "expression conversion under explicit returns", ->
nonce = {}
fn = ->
return (nonce for x in [1,2,3])
arrayEq [nonce,nonce,nonce], fn()
fn = ->
return [nonce for x in [1,2,3]][0]
arrayEq [nonce,nonce,nonce], fn()
fn = ->
return [(nonce for x in [1..3])][0]
arrayEq [nonce,nonce,nonce], fn()
#### Implicit Destructuring Assignment
test "implicit destructuring assignment in object of objects", ->
a={}; b={}; c={}
obj = {
a: { d: a },
b: { d: b }
c: { d: c }
}
result = ([y,z] for y, { d: z } of obj)
arrayEq [['a',a],['b',b],['c',c]], result
test "implicit destructuring assignment in array of objects", ->
a={}; b={}; c={}; d={}; e={}; f={}
arr = [
{ a: a, b: { c: b } },
{ a: c, b: { c: d } },
{ a: e, b: { c: f } }
]
result = ([y,z] for { a: y, b: { c: z } } in arr)
arrayEq [[a,b],[c,d],[e,f]], result
test "implicit destructuring assignment in array of arrays", ->
a={}; b={}; c={}; d={}; e={}; f={}
arr = [[a, [b]], [c, [d]], [e, [f]]]
result = ([y,z] for [y, [z]] in arr)
arrayEq [[a,b],[c,d],[e,f]], result
| 206238 | # Comprehensions
# --------------
# * Array Comprehensions
# * Range Comprehensions
# * Object Comprehensions
# * Implicit Destructuring Assignment
# * Comprehensions with Nonstandard Step
# TODO: refactor comprehension tests
# Basic array comprehensions.
nums = (n * n for n in [1, 2, 3] when n & 1)
results = (n * 2 for n in nums)
ok results.join(',') is '2,18'
# Basic object comprehensions.
obj = {one: 1, two: 2, three: 3}
names = (prop + '!' for prop of obj)
odds = (prop + '!' for prop, value of obj when value & 1)
ok names.join(' ') is "one! two! three!"
ok odds.join(' ') is "one! three!"
# Basic range comprehensions.
nums = (i * 3 for i in [1..3])
negs = (x for x in [-20..-5*2])
negs = negs[0..2]
result = nums.concat(negs).join(', ')
ok result is '3, 6, 9, -20, -19, -18'
# With range comprehensions, you can loop in steps.
results = (x for x in [0...15] by 5)
ok results.join(' ') is '0 5 10'
results = (x for x in [0..100] by 10)
ok results.join(' ') is '0 10 20 30 40 50 60 70 80 90 100'
# And can loop downwards, with a negative step.
results = (x for x in [5..1])
ok results.join(' ') is '5 4 3 2 1'
ok results.join(' ') is [(10-5)..(-2+3)].join(' ')
results = (x for x in [10..1])
ok results.join(' ') is [10..1].join(' ')
results = (x for x in [10...0] by -2)
ok results.join(' ') is [10, 8, 6, 4, 2].join(' ')
# Range comprehension gymnastics.
eq "#{i for i in [5..1]}", '5,4,3,2,1'
eq "#{i for i in [5..-5] by -5}", '5,0,-5'
a = 6
b = 0
c = -2
eq "#{i for i in [a..b]}", '6,5,4,3,2,1,0'
eq "#{i for i in [a..b] by c}", '6,4,2,0'
# Multiline array comprehension with filter.
evens = for num in [1, 2, 3, 4, 5, 6] when not (num & 1)
num *= -1
num -= 2
num * -1
eq evens + '', '4,6,8'
# The in operator still works, standalone.
ok 2 of evens
# all isn't reserved.
all = 1
# Ensure that the closure wrapper preserves local variables.
obj = {}
for method in ['one', 'two', 'three'] then do (method) ->
obj[method] = ->
"I'm " + method
ok obj.one() is "I'm one"
ok obj.two() is "I'm two"
ok obj.three() is "I'm three"
# Index values at the end of a loop.
i = 0
for i in [1..3]
-> 'func'
break if false
ok i is 4
# Ensure that local variables are closed over for range comprehensions.
funcs = for i in [1..3]
do (i) ->
-> -i
eq (func() for func in funcs).join(' '), '-1 -2 -3'
ok i is 4
# Even when referenced in the filter.
list = ['one', 'two', 'three']
methods = for num, i in list when num isnt 'two' and i isnt 1
do (num, i) ->
-> num + ' ' + i
ok methods.length is 2
ok methods[0]() is 'one 0'
ok methods[1]() is 'three 2'
# Even a convoluted one.
funcs = []
for i in [1..3]
do (i) ->
x = i * 2
((z)->
funcs.push -> z + ' ' + i
)(x)
ok (func() for func in funcs).join(', ') is '2 1, 4 2, 6 3'
funcs = []
results = for i in [1..3]
do (i) ->
z = (x * 3 for x in [1..i])
((a, b, c) -> [a, b, c].join(' ')).apply this, z
ok results.join(', ') is '3 , 3 6 , 3 6 9'
# Naked ranges are expanded into arrays.
array = [0..10]
ok(num % 2 is 0 for num in array by 2)
# Nested shared scopes.
foo = ->
for i in [0..7]
do (i) ->
for j in [0..7]
do (j) ->
-> i + j
eq foo()[3][4](), 7
# Scoped loop pattern matching.
a = [[0], [1]]
funcs = []
for [v] in a
do (v) ->
funcs.push -> v
eq funcs[0](), 0
eq funcs[1](), 1
# Nested comprehensions.
multiLiner =
for x in [3..5]
for y in [3..5]
[x, y]
singleLiner =
(([x, y] for y in [3..5]) for x in [3..5])
ok multiLiner.length is singleLiner.length
ok 5 is multiLiner[2][2][1]
ok 5 is singleLiner[2][2][1]
# Comprehensions within parentheses.
result = null
store = (obj) -> result = obj
store (x * 2 for x in [3, 2, 1])
ok result.join(' ') is '6 4 2'
# Closure-wrapped comprehensions that refer to the "arguments" object.
expr = ->
result = (item * item for item in arguments)
ok expr(2, 4, 8).join(' ') is '4 16 64'
# Fast object comprehensions over all properties, including prototypal ones.
class Cat
constructor: -> @name = '<NAME>'
breed: 'tabby'
hair: 'cream'
whiskers = new Cat
own = (value for own key, value of whiskers)
all = (value for key, value of whiskers)
ok own.join(' ') is 'Whiskers'
ok all.sort().join(' ') is 'Whiskers cream tabby'
# Optimized range comprehensions.
exxes = ('x' for [0...10])
ok exxes.join(' ') is 'x x x x x x x x x x'
# Comprehensions safely redeclare parameters if they're not present in closest
# scope.
rule = (x) -> x
learn = ->
rule for rule in [1, 2, 3]
ok learn().join(' ') is '1 2 3'
ok rule(101) is 101
f = -> [-> ok no, 'should cache source']
ok yes for k of [f] = f()
# Lenient on pure statements not trying to reach out of the closure
val = for i in [1]
for j in [] then break
i
ok val[0] is i
# Comprehensions only wrap their last line in a closure, allowing other lines
# to have pure expressions in them.
func = -> for i in [1]
break if i is 2
j for j in [1]
ok func()[0][0] is 1
i = 6
odds = while i--
continue unless i & 1
i
ok odds.join(', ') is '5, 3, 1'
# Issue #897: Ensure that plucked function variables aren't leaked.
facets = {}
list = ['one', 'two']
(->
for entity in list
facets[entity] = -> entity
)()
eq typeof entity, 'undefined'
eq facets['two'](), 'two'
# Issue #905. Soaks as the for loop subject.
a = {b: {c: [1, 2, 3]}}
for d in a.b?.c
e = d
eq e, 3
# Issue #948. Capturing loop variables.
funcs = []
list = ->
[1, 2, 3]
for y in list()
do (y) ->
z = y
funcs.push -> "y is #{y} and z is #{z}"
eq funcs[1](), "y is 2 and z is 2"
# Cancel the comprehension if there's a jump inside the loop.
result = try
for i in [0...10]
continue if i < 5
i
eq result, 10
# Comprehensions over break.
arrayEq (break for [1..10]), []
# Comprehensions over continue.
arrayEq (break for [1..10]), []
# Comprehensions over function literals.
a = 0
for f in [-> a = 1]
do (f) ->
do f
eq a, 1
# Comprehensions that mention arguments.
list = [arguments: 10]
args = for f in list
do (f) ->
f.arguments
eq args[0], 10
test "expression conversion under explicit returns", ->
nonce = {}
fn = ->
return (nonce for x in [1,2,3])
arrayEq [nonce,nonce,nonce], fn()
fn = ->
return [nonce for x in [1,2,3]][0]
arrayEq [nonce,nonce,nonce], fn()
fn = ->
return [(nonce for x in [1..3])][0]
arrayEq [nonce,nonce,nonce], fn()
#### Implicit Destructuring Assignment
test "implicit destructuring assignment in object of objects", ->
a={}; b={}; c={}
obj = {
a: { d: a },
b: { d: b }
c: { d: c }
}
result = ([y,z] for y, { d: z } of obj)
arrayEq [['a',a],['b',b],['c',c]], result
test "implicit destructuring assignment in array of objects", ->
a={}; b={}; c={}; d={}; e={}; f={}
arr = [
{ a: a, b: { c: b } },
{ a: c, b: { c: d } },
{ a: e, b: { c: f } }
]
result = ([y,z] for { a: y, b: { c: z } } in arr)
arrayEq [[a,b],[c,d],[e,f]], result
test "implicit destructuring assignment in array of arrays", ->
a={}; b={}; c={}; d={}; e={}; f={}
arr = [[a, [b]], [c, [d]], [e, [f]]]
result = ([y,z] for [y, [z]] in arr)
arrayEq [[a,b],[c,d],[e,f]], result
| true | # Comprehensions
# --------------
# * Array Comprehensions
# * Range Comprehensions
# * Object Comprehensions
# * Implicit Destructuring Assignment
# * Comprehensions with Nonstandard Step
# TODO: refactor comprehension tests
# Basic array comprehensions.
nums = (n * n for n in [1, 2, 3] when n & 1)
results = (n * 2 for n in nums)
ok results.join(',') is '2,18'
# Basic object comprehensions.
obj = {one: 1, two: 2, three: 3}
names = (prop + '!' for prop of obj)
odds = (prop + '!' for prop, value of obj when value & 1)
ok names.join(' ') is "one! two! three!"
ok odds.join(' ') is "one! three!"
# Basic range comprehensions.
nums = (i * 3 for i in [1..3])
negs = (x for x in [-20..-5*2])
negs = negs[0..2]
result = nums.concat(negs).join(', ')
ok result is '3, 6, 9, -20, -19, -18'
# With range comprehensions, you can loop in steps.
results = (x for x in [0...15] by 5)
ok results.join(' ') is '0 5 10'
results = (x for x in [0..100] by 10)
ok results.join(' ') is '0 10 20 30 40 50 60 70 80 90 100'
# And can loop downwards, with a negative step.
results = (x for x in [5..1])
ok results.join(' ') is '5 4 3 2 1'
ok results.join(' ') is [(10-5)..(-2+3)].join(' ')
results = (x for x in [10..1])
ok results.join(' ') is [10..1].join(' ')
results = (x for x in [10...0] by -2)
ok results.join(' ') is [10, 8, 6, 4, 2].join(' ')
# Range comprehension gymnastics.
eq "#{i for i in [5..1]}", '5,4,3,2,1'
eq "#{i for i in [5..-5] by -5}", '5,0,-5'
a = 6
b = 0
c = -2
eq "#{i for i in [a..b]}", '6,5,4,3,2,1,0'
eq "#{i for i in [a..b] by c}", '6,4,2,0'
# Multiline array comprehension with filter.
evens = for num in [1, 2, 3, 4, 5, 6] when not (num & 1)
num *= -1
num -= 2
num * -1
eq evens + '', '4,6,8'
# The in operator still works, standalone.
ok 2 of evens
# all isn't reserved.
all = 1
# Ensure that the closure wrapper preserves local variables.
obj = {}
for method in ['one', 'two', 'three'] then do (method) ->
obj[method] = ->
"I'm " + method
ok obj.one() is "I'm one"
ok obj.two() is "I'm two"
ok obj.three() is "I'm three"
# Index values at the end of a loop.
i = 0
for i in [1..3]
-> 'func'
break if false
ok i is 4
# Ensure that local variables are closed over for range comprehensions.
funcs = for i in [1..3]
do (i) ->
-> -i
eq (func() for func in funcs).join(' '), '-1 -2 -3'
ok i is 4
# Even when referenced in the filter.
list = ['one', 'two', 'three']
methods = for num, i in list when num isnt 'two' and i isnt 1
do (num, i) ->
-> num + ' ' + i
ok methods.length is 2
ok methods[0]() is 'one 0'
ok methods[1]() is 'three 2'
# Even a convoluted one.
funcs = []
for i in [1..3]
do (i) ->
x = i * 2
((z)->
funcs.push -> z + ' ' + i
)(x)
ok (func() for func in funcs).join(', ') is '2 1, 4 2, 6 3'
funcs = []
results = for i in [1..3]
do (i) ->
z = (x * 3 for x in [1..i])
((a, b, c) -> [a, b, c].join(' ')).apply this, z
ok results.join(', ') is '3 , 3 6 , 3 6 9'
# Naked ranges are expanded into arrays.
array = [0..10]
ok(num % 2 is 0 for num in array by 2)
# Nested shared scopes.
foo = ->
for i in [0..7]
do (i) ->
for j in [0..7]
do (j) ->
-> i + j
eq foo()[3][4](), 7
# Scoped loop pattern matching.
a = [[0], [1]]
funcs = []
for [v] in a
do (v) ->
funcs.push -> v
eq funcs[0](), 0
eq funcs[1](), 1
# Nested comprehensions.
multiLiner =
for x in [3..5]
for y in [3..5]
[x, y]
singleLiner =
(([x, y] for y in [3..5]) for x in [3..5])
ok multiLiner.length is singleLiner.length
ok 5 is multiLiner[2][2][1]
ok 5 is singleLiner[2][2][1]
# Comprehensions within parentheses.
result = null
store = (obj) -> result = obj
store (x * 2 for x in [3, 2, 1])
ok result.join(' ') is '6 4 2'
# Closure-wrapped comprehensions that refer to the "arguments" object.
expr = ->
result = (item * item for item in arguments)
ok expr(2, 4, 8).join(' ') is '4 16 64'
# Fast object comprehensions over all properties, including prototypal ones.
class Cat
constructor: -> @name = 'PI:NAME:<NAME>END_PI'
breed: 'tabby'
hair: 'cream'
whiskers = new Cat
own = (value for own key, value of whiskers)
all = (value for key, value of whiskers)
ok own.join(' ') is 'Whiskers'
ok all.sort().join(' ') is 'Whiskers cream tabby'
# Optimized range comprehensions.
exxes = ('x' for [0...10])
ok exxes.join(' ') is 'x x x x x x x x x x'
# Comprehensions safely redeclare parameters if they're not present in closest
# scope.
rule = (x) -> x
learn = ->
rule for rule in [1, 2, 3]
ok learn().join(' ') is '1 2 3'
ok rule(101) is 101
f = -> [-> ok no, 'should cache source']
ok yes for k of [f] = f()
# Lenient on pure statements not trying to reach out of the closure
val = for i in [1]
for j in [] then break
i
ok val[0] is i
# Comprehensions only wrap their last line in a closure, allowing other lines
# to have pure expressions in them.
func = -> for i in [1]
break if i is 2
j for j in [1]
ok func()[0][0] is 1
i = 6
odds = while i--
continue unless i & 1
i
ok odds.join(', ') is '5, 3, 1'
# Issue #897: Ensure that plucked function variables aren't leaked.
facets = {}
list = ['one', 'two']
(->
for entity in list
facets[entity] = -> entity
)()
eq typeof entity, 'undefined'
eq facets['two'](), 'two'
# Issue #905. Soaks as the for loop subject.
a = {b: {c: [1, 2, 3]}}
for d in a.b?.c
e = d
eq e, 3
# Issue #948. Capturing loop variables.
funcs = []
list = ->
[1, 2, 3]
for y in list()
do (y) ->
z = y
funcs.push -> "y is #{y} and z is #{z}"
eq funcs[1](), "y is 2 and z is 2"
# Cancel the comprehension if there's a jump inside the loop.
result = try
for i in [0...10]
continue if i < 5
i
eq result, 10
# Comprehensions over break.
arrayEq (break for [1..10]), []
# Comprehensions over continue.
arrayEq (break for [1..10]), []
# Comprehensions over function literals.
a = 0
for f in [-> a = 1]
do (f) ->
do f
eq a, 1
# Comprehensions that mention arguments.
list = [arguments: 10]
args = for f in list
do (f) ->
f.arguments
eq args[0], 10
test "expression conversion under explicit returns", ->
nonce = {}
fn = ->
return (nonce for x in [1,2,3])
arrayEq [nonce,nonce,nonce], fn()
fn = ->
return [nonce for x in [1,2,3]][0]
arrayEq [nonce,nonce,nonce], fn()
fn = ->
return [(nonce for x in [1..3])][0]
arrayEq [nonce,nonce,nonce], fn()
#### Implicit Destructuring Assignment
test "implicit destructuring assignment in object of objects", ->
a={}; b={}; c={}
obj = {
a: { d: a },
b: { d: b }
c: { d: c }
}
result = ([y,z] for y, { d: z } of obj)
arrayEq [['a',a],['b',b],['c',c]], result
test "implicit destructuring assignment in array of objects", ->
a={}; b={}; c={}; d={}; e={}; f={}
arr = [
{ a: a, b: { c: b } },
{ a: c, b: { c: d } },
{ a: e, b: { c: f } }
]
result = ([y,z] for { a: y, b: { c: z } } in arr)
arrayEq [[a,b],[c,d],[e,f]], result
test "implicit destructuring assignment in array of arrays", ->
a={}; b={}; c={}; d={}; e={}; f={}
arr = [[a, [b]], [c, [d]], [e, [f]]]
result = ([y,z] for [y, [z]] in arr)
arrayEq [[a,b],[c,d],[e,f]], result
|
[
{
"context": "###\n turing-main.coffee\n Fionan Haralddottir\n Spring 2015\n This program is published under t",
"end": 46,
"score": 0.9998844265937805,
"start": 27,
"tag": "NAME",
"value": "Fionan Haralddottir"
}
] | src/turing-main.coffee | Lokidottir/coffeescript-turing-machine | 0 | ###
turing-main.coffee
Fionan Haralddottir
Spring 2015
This program is published under the MIT licence
###
{TuringUI} = require("./turing-ui")
main = () ->
a = new TuringUI("editor-target-div")
console.log "Making stuff :)"
main()
| 80325 | ###
turing-main.coffee
<NAME>
Spring 2015
This program is published under the MIT licence
###
{TuringUI} = require("./turing-ui")
main = () ->
a = new TuringUI("editor-target-div")
console.log "Making stuff :)"
main()
| true | ###
turing-main.coffee
PI:NAME:<NAME>END_PI
Spring 2015
This program is published under the MIT licence
###
{TuringUI} = require("./turing-ui")
main = () ->
a = new TuringUI("editor-target-div")
console.log "Making stuff :)"
main()
|
[
{
"context": "riterion('crypt(?, gen_salt(?, ?))', 'password', 'bf', 4)}\n\n test.equal c.sql(), 'x = crypt",
"end": 3423,
"score": 0.9970340132713318,
"start": 3421,
"tag": "PASSWORD",
"value": "bf"
},
{
"context": " c = criterion {\n username: \"user\"\n password: \"hash\"\n ",
"end": 5699,
"score": 0.9354581832885742,
"start": 5695,
"tag": "USERNAME",
"value": "user"
},
{
"context": " username: \"user\"\n password: \"hash\"\n $or: [{active: 1}, active: {$nul",
"end": 5732,
"score": 0.9995105266571045,
"start": 5728,
"tag": "PASSWORD",
"value": "hash"
}
] | test/criterion.coffee | clariture/criterion | 0 | criterion = require '../src/factory'
module.exports =
'create from string and parameters': (test) ->
c = criterion 'x = ? AND y = ?', 6, 'bar'
test.equal c.sql(), 'x = ? AND y = ?'
test.deepEqual c.params(), [6, 'bar']
test.done()
'create from object': (test) ->
c = criterion {x: 7}
test.equal c.sql(), 'x = ?'
test.deepEqual c.params(), [7]
test.done()
'and': (test) ->
fst = criterion {x: 7, y: 'foo'}
snd = criterion 'z = ?', true
fstAndSnd = fst.and snd
test.equal fstAndSnd.sql(), '((x = ?) AND (y = ?)) AND (z = ?)'
test.deepEqual fstAndSnd.params(), [7, 'foo', true]
test.done()
'or': (test) ->
fst = criterion {x: 7, y: 'foo'}
snd = criterion 'z = ?', true
sndOrFst = snd.or fst
test.equal sndOrFst.sql(), '(z = ?) OR ((x = ?) AND (y = ?))'
test.deepEqual sndOrFst.params(), [true, 7, 'foo']
test.done()
'not': (test) ->
c = criterion {x: 7, y: 'foo'}
test.equal c.not().sql(), 'NOT ((x = ?) AND (y = ?))'
test.deepEqual c.not().params(), [7, 'foo']
test.done()
'double negation is removed': (test) ->
c = criterion {x: 7, y: 'foo'}
test.equal c.not().not().sql(), '(x = ?) AND (y = ?)'
test.deepEqual c.not().not().params(), [7, 'foo']
test.equal c.not().not().not().sql(), 'NOT ((x = ?) AND (y = ?))'
test.deepEqual c.not().not().not().params(), [7, 'foo']
test.done()
'throw on':
'not string or object': (test) ->
test.throws -> criterion 6
test.done()
'empty object': (test) ->
test.throws -> criterion {}
test.done()
'null value with modifier': (test) ->
test.throws -> criterion {x: {$lt: null}}
test.done()
'null value without modifier': (test) ->
test.throws -> criterion {x: null}
test.done()
'in with empty array': (test) ->
test.throws -> criterion {x: []}
test.done()
'$nin with empty array': (test) ->
test.throws -> criterion {x: {$nin: []}}
test.done()
'queries':
'and with object': (test) ->
c = criterion {x: 7, y: 'foo'}
test.equal c.sql(), '(x = ?) AND (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'and with array': (test) ->
c = criterion [{x: 7}, {y: 'foo'}]
test.equal c.sql(), '(x = ?) AND (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'in': (test) ->
c = criterion {x: [1, 2, 3]}
test.equal c.sql(), 'x IN (?, ?, ?)'
test.deepEqual c.params(), [1, 2, 3]
test.done()
'$nin': (test) ->
c = criterion {x: {$nin: [1, 2, 3]}}
test.equal c.sql(), 'x NOT IN (?, ?, ?)'
test.deepEqual c.params(), [1, 2, 3]
test.done()
'$ne': (test) ->
c = criterion {x: {$ne: 3}}
test.equal c.sql(), 'x != ?'
test.deepEqual c.params(), [3]
test.done()
'equality with criterion argument': (test) ->
c = criterion {x: criterion('crypt(?, gen_salt(?, ?))', 'password', 'bf', 4)}
test.equal c.sql(), 'x = crypt(?, gen_salt(?, ?))'
test.deepEqual c.params(), ['password', 'bf', 4]
test.done()
'$ne with criterion argument': (test) ->
c = criterion {x: {$ne: criterion('crypt(?, gen_salt(?, ?))', 'password', 'bf', 4)}}
test.equal c.sql(), 'x != crypt(?, gen_salt(?, ?))'
test.deepEqual c.params(), ['password', 'bf', 4]
test.done()
'$lt and $lte': (test) ->
c = criterion {x: {$lt: 3}, y: {$lte: 4}}
test.equal c.sql(), '(x < ?) AND (y <= ?)'
test.deepEqual c.params(), [3, 4]
test.done()
'$lt with criterion argument': (test) ->
c = criterion {x: {$lt: criterion('NOW()')}}
test.equal c.sql(), 'x < NOW()'
test.deepEqual c.params(), []
test.done()
'$gt and $gte': (test) ->
c = criterion {x: {$gt: 3}, y: {$gte: 4}}
test.equal c.sql(), '(x > ?) AND (y >= ?)'
test.deepEqual c.params(), [3, 4]
test.done()
'$not': (test) ->
c = criterion {$not: {x: {$gt: 3}, y: {$gte: 4}}}
test.equal c.sql(), 'NOT ((x > ?) AND (y >= ?))'
test.deepEqual c.params(), [3, 4]
test.done()
'$or with object': (test) ->
c = criterion {$or: {x: 7, y: 'foo'}}
test.equal c.sql(), '(x = ?) OR (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'$or with array': (test) ->
c = criterion {$or: [{x: 7}, {y: 'foo'}]}
test.equal c.sql(), '(x = ?) OR (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'$null: true': (test) ->
c = criterion {x: {$null: true}}
test.equal c.sql(), 'x IS NULL'
test.deepEqual c.params(), []
test.done()
'$null: false': (test) ->
c = criterion {x: {$null: false}}
test.equal c.sql(), 'x IS NOT NULL'
test.deepEqual c.params(), []
test.done()
'$or inside $and is wrapped in parentheses': (test) ->
c = criterion {
username: "user"
password: "hash"
$or: [{active: 1}, active: {$null: true}]
}
test.equal c.sql(), '(username = ?) AND (password = ?) AND ((active = ?) OR (active IS NULL))'
test.deepEqual c.params(), ["user", "hash", 1]
test.done()
| 97871 | criterion = require '../src/factory'
module.exports =
'create from string and parameters': (test) ->
c = criterion 'x = ? AND y = ?', 6, 'bar'
test.equal c.sql(), 'x = ? AND y = ?'
test.deepEqual c.params(), [6, 'bar']
test.done()
'create from object': (test) ->
c = criterion {x: 7}
test.equal c.sql(), 'x = ?'
test.deepEqual c.params(), [7]
test.done()
'and': (test) ->
fst = criterion {x: 7, y: 'foo'}
snd = criterion 'z = ?', true
fstAndSnd = fst.and snd
test.equal fstAndSnd.sql(), '((x = ?) AND (y = ?)) AND (z = ?)'
test.deepEqual fstAndSnd.params(), [7, 'foo', true]
test.done()
'or': (test) ->
fst = criterion {x: 7, y: 'foo'}
snd = criterion 'z = ?', true
sndOrFst = snd.or fst
test.equal sndOrFst.sql(), '(z = ?) OR ((x = ?) AND (y = ?))'
test.deepEqual sndOrFst.params(), [true, 7, 'foo']
test.done()
'not': (test) ->
c = criterion {x: 7, y: 'foo'}
test.equal c.not().sql(), 'NOT ((x = ?) AND (y = ?))'
test.deepEqual c.not().params(), [7, 'foo']
test.done()
'double negation is removed': (test) ->
c = criterion {x: 7, y: 'foo'}
test.equal c.not().not().sql(), '(x = ?) AND (y = ?)'
test.deepEqual c.not().not().params(), [7, 'foo']
test.equal c.not().not().not().sql(), 'NOT ((x = ?) AND (y = ?))'
test.deepEqual c.not().not().not().params(), [7, 'foo']
test.done()
'throw on':
'not string or object': (test) ->
test.throws -> criterion 6
test.done()
'empty object': (test) ->
test.throws -> criterion {}
test.done()
'null value with modifier': (test) ->
test.throws -> criterion {x: {$lt: null}}
test.done()
'null value without modifier': (test) ->
test.throws -> criterion {x: null}
test.done()
'in with empty array': (test) ->
test.throws -> criterion {x: []}
test.done()
'$nin with empty array': (test) ->
test.throws -> criterion {x: {$nin: []}}
test.done()
'queries':
'and with object': (test) ->
c = criterion {x: 7, y: 'foo'}
test.equal c.sql(), '(x = ?) AND (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'and with array': (test) ->
c = criterion [{x: 7}, {y: 'foo'}]
test.equal c.sql(), '(x = ?) AND (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'in': (test) ->
c = criterion {x: [1, 2, 3]}
test.equal c.sql(), 'x IN (?, ?, ?)'
test.deepEqual c.params(), [1, 2, 3]
test.done()
'$nin': (test) ->
c = criterion {x: {$nin: [1, 2, 3]}}
test.equal c.sql(), 'x NOT IN (?, ?, ?)'
test.deepEqual c.params(), [1, 2, 3]
test.done()
'$ne': (test) ->
c = criterion {x: {$ne: 3}}
test.equal c.sql(), 'x != ?'
test.deepEqual c.params(), [3]
test.done()
'equality with criterion argument': (test) ->
c = criterion {x: criterion('crypt(?, gen_salt(?, ?))', 'password', '<PASSWORD>', 4)}
test.equal c.sql(), 'x = crypt(?, gen_salt(?, ?))'
test.deepEqual c.params(), ['password', 'bf', 4]
test.done()
'$ne with criterion argument': (test) ->
c = criterion {x: {$ne: criterion('crypt(?, gen_salt(?, ?))', 'password', 'bf', 4)}}
test.equal c.sql(), 'x != crypt(?, gen_salt(?, ?))'
test.deepEqual c.params(), ['password', 'bf', 4]
test.done()
'$lt and $lte': (test) ->
c = criterion {x: {$lt: 3}, y: {$lte: 4}}
test.equal c.sql(), '(x < ?) AND (y <= ?)'
test.deepEqual c.params(), [3, 4]
test.done()
'$lt with criterion argument': (test) ->
c = criterion {x: {$lt: criterion('NOW()')}}
test.equal c.sql(), 'x < NOW()'
test.deepEqual c.params(), []
test.done()
'$gt and $gte': (test) ->
c = criterion {x: {$gt: 3}, y: {$gte: 4}}
test.equal c.sql(), '(x > ?) AND (y >= ?)'
test.deepEqual c.params(), [3, 4]
test.done()
'$not': (test) ->
c = criterion {$not: {x: {$gt: 3}, y: {$gte: 4}}}
test.equal c.sql(), 'NOT ((x > ?) AND (y >= ?))'
test.deepEqual c.params(), [3, 4]
test.done()
'$or with object': (test) ->
c = criterion {$or: {x: 7, y: 'foo'}}
test.equal c.sql(), '(x = ?) OR (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'$or with array': (test) ->
c = criterion {$or: [{x: 7}, {y: 'foo'}]}
test.equal c.sql(), '(x = ?) OR (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'$null: true': (test) ->
c = criterion {x: {$null: true}}
test.equal c.sql(), 'x IS NULL'
test.deepEqual c.params(), []
test.done()
'$null: false': (test) ->
c = criterion {x: {$null: false}}
test.equal c.sql(), 'x IS NOT NULL'
test.deepEqual c.params(), []
test.done()
'$or inside $and is wrapped in parentheses': (test) ->
c = criterion {
username: "user"
password: "<PASSWORD>"
$or: [{active: 1}, active: {$null: true}]
}
test.equal c.sql(), '(username = ?) AND (password = ?) AND ((active = ?) OR (active IS NULL))'
test.deepEqual c.params(), ["user", "hash", 1]
test.done()
| true | criterion = require '../src/factory'
module.exports =
'create from string and parameters': (test) ->
c = criterion 'x = ? AND y = ?', 6, 'bar'
test.equal c.sql(), 'x = ? AND y = ?'
test.deepEqual c.params(), [6, 'bar']
test.done()
'create from object': (test) ->
c = criterion {x: 7}
test.equal c.sql(), 'x = ?'
test.deepEqual c.params(), [7]
test.done()
'and': (test) ->
fst = criterion {x: 7, y: 'foo'}
snd = criterion 'z = ?', true
fstAndSnd = fst.and snd
test.equal fstAndSnd.sql(), '((x = ?) AND (y = ?)) AND (z = ?)'
test.deepEqual fstAndSnd.params(), [7, 'foo', true]
test.done()
'or': (test) ->
fst = criterion {x: 7, y: 'foo'}
snd = criterion 'z = ?', true
sndOrFst = snd.or fst
test.equal sndOrFst.sql(), '(z = ?) OR ((x = ?) AND (y = ?))'
test.deepEqual sndOrFst.params(), [true, 7, 'foo']
test.done()
'not': (test) ->
c = criterion {x: 7, y: 'foo'}
test.equal c.not().sql(), 'NOT ((x = ?) AND (y = ?))'
test.deepEqual c.not().params(), [7, 'foo']
test.done()
'double negation is removed': (test) ->
c = criterion {x: 7, y: 'foo'}
test.equal c.not().not().sql(), '(x = ?) AND (y = ?)'
test.deepEqual c.not().not().params(), [7, 'foo']
test.equal c.not().not().not().sql(), 'NOT ((x = ?) AND (y = ?))'
test.deepEqual c.not().not().not().params(), [7, 'foo']
test.done()
'throw on':
'not string or object': (test) ->
test.throws -> criterion 6
test.done()
'empty object': (test) ->
test.throws -> criterion {}
test.done()
'null value with modifier': (test) ->
test.throws -> criterion {x: {$lt: null}}
test.done()
'null value without modifier': (test) ->
test.throws -> criterion {x: null}
test.done()
'in with empty array': (test) ->
test.throws -> criterion {x: []}
test.done()
'$nin with empty array': (test) ->
test.throws -> criterion {x: {$nin: []}}
test.done()
'queries':
'and with object': (test) ->
c = criterion {x: 7, y: 'foo'}
test.equal c.sql(), '(x = ?) AND (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'and with array': (test) ->
c = criterion [{x: 7}, {y: 'foo'}]
test.equal c.sql(), '(x = ?) AND (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'in': (test) ->
c = criterion {x: [1, 2, 3]}
test.equal c.sql(), 'x IN (?, ?, ?)'
test.deepEqual c.params(), [1, 2, 3]
test.done()
'$nin': (test) ->
c = criterion {x: {$nin: [1, 2, 3]}}
test.equal c.sql(), 'x NOT IN (?, ?, ?)'
test.deepEqual c.params(), [1, 2, 3]
test.done()
'$ne': (test) ->
c = criterion {x: {$ne: 3}}
test.equal c.sql(), 'x != ?'
test.deepEqual c.params(), [3]
test.done()
'equality with criterion argument': (test) ->
c = criterion {x: criterion('crypt(?, gen_salt(?, ?))', 'password', 'PI:PASSWORD:<PASSWORD>END_PI', 4)}
test.equal c.sql(), 'x = crypt(?, gen_salt(?, ?))'
test.deepEqual c.params(), ['password', 'bf', 4]
test.done()
'$ne with criterion argument': (test) ->
c = criterion {x: {$ne: criterion('crypt(?, gen_salt(?, ?))', 'password', 'bf', 4)}}
test.equal c.sql(), 'x != crypt(?, gen_salt(?, ?))'
test.deepEqual c.params(), ['password', 'bf', 4]
test.done()
'$lt and $lte': (test) ->
c = criterion {x: {$lt: 3}, y: {$lte: 4}}
test.equal c.sql(), '(x < ?) AND (y <= ?)'
test.deepEqual c.params(), [3, 4]
test.done()
'$lt with criterion argument': (test) ->
c = criterion {x: {$lt: criterion('NOW()')}}
test.equal c.sql(), 'x < NOW()'
test.deepEqual c.params(), []
test.done()
'$gt and $gte': (test) ->
c = criterion {x: {$gt: 3}, y: {$gte: 4}}
test.equal c.sql(), '(x > ?) AND (y >= ?)'
test.deepEqual c.params(), [3, 4]
test.done()
'$not': (test) ->
c = criterion {$not: {x: {$gt: 3}, y: {$gte: 4}}}
test.equal c.sql(), 'NOT ((x > ?) AND (y >= ?))'
test.deepEqual c.params(), [3, 4]
test.done()
'$or with object': (test) ->
c = criterion {$or: {x: 7, y: 'foo'}}
test.equal c.sql(), '(x = ?) OR (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'$or with array': (test) ->
c = criterion {$or: [{x: 7}, {y: 'foo'}]}
test.equal c.sql(), '(x = ?) OR (y = ?)'
test.deepEqual c.params(), [7, 'foo']
test.done()
'$null: true': (test) ->
c = criterion {x: {$null: true}}
test.equal c.sql(), 'x IS NULL'
test.deepEqual c.params(), []
test.done()
'$null: false': (test) ->
c = criterion {x: {$null: false}}
test.equal c.sql(), 'x IS NOT NULL'
test.deepEqual c.params(), []
test.done()
'$or inside $and is wrapped in parentheses': (test) ->
c = criterion {
username: "user"
password: "PI:PASSWORD:<PASSWORD>END_PI"
$or: [{active: 1}, active: {$null: true}]
}
test.equal c.sql(), '(username = ?) AND (password = ?) AND ((active = ?) OR (active IS NULL))'
test.deepEqual c.params(), ["user", "hash", 1]
test.done()
|
[
{
"context": "d.Player) ->\n @name = data.name\n @password = data.password\n @set_pos()\n super(@scene,@x,@y,@group)\n ",
"end": 546,
"score": 0.996289074420929,
"start": 533,
"tag": "PASSWORD",
"value": "data.password"
}
] | server/Player.coffee | mizchi/Wanderer | 3 | {ObjectId} = require('./ObjectId')
{Character} = require './Character'
{Status} = require './Status'
{Equipment} = require './Equipment'
{ItemBox} = require './ItemBox'
Skills = require './skills'
{SkillBox} = require './skills'
racial_data = require('./shared/data/Race').RacialData
class_data = require('./shared/data/Class').ClassData
{random,sqrt,min,max,sin,cos} = Math
class Player extends Character
# Controller Implement
constructor: (@scene, data = {},@group=ObjectId.Player) ->
@name = data.name
@password = data.password
@set_pos()
super(@scene,@x,@y,@group)
@status = new Status data.status
@equipment = new Equipment data.equipment
@skills = new SkillBox @, data.skills.learned, data.skills.preset
@selected_skill = @skills.sets[1]
@status.active_range = 4
@status.trace_range = 4
select_skill :()->
for k,v of @keys
if v and parseInt(k) in [1..5]
if @skills.sets[k]
return @selected_skill = @skills.sets[k]
update:(objs)->
enemies = @find_obj(ObjectId.get_enemy(@),objs,@status.active_range)
if @keys.space is 1 and @_last_space_ is 0
@shift_target(enemies)
@_last_space_ = @keys.space
range = @selected_skill.range
@status.active_range = range
@status.trace_range = range
super objs,@scene
set_destination:(x,y)->
@target = x:x,y:y,is_dead:(->false),status:{get_param:->}
wander : ->
move: ->
keys = @keys
sum = 0
for i in [keys.right , keys.left , keys.up , keys.down]
sum++ if i
if sum is 0
if ++@_wait > 120
return
else
super()
return
else if sum > 1
move = @status.speed * 0.7
else
move = @status.speed
@_on_going_destination = false
@to = null
@_wait = 0
if keys.right
if @scene.collide( @x+move , @y )
@x = ~~(@x)+1-0.1
else
@x += move
if keys.left
if @scene.collide( @x-move , @y )
@x = ~~(@x)+0.1
else
@x -= move
if keys.down
if @scene.collide( @x , @y-move )
@y = ~~(@y)+0.1
else
@y -= move
if keys.up
if @scene.collide( @x , @y+move )
@y = ~~(@y)+1-0.1
else
@y += move
exports.Player = Player
exports.create_new = (name,racial_name,cls_name)->
#mock
cls_data = class_data[cls_name]
r = racial_data[racial_name]
_status =
str : cls_data.status.str + r.str
int : cls_data.status.int + r.int
dex : cls_data.status.dex + r.dex
status = new Status _status
status.race = racial_name
# status.class = cls_name
status.gold = 0
status.exp = 0
status.lv = 1
status.sp = 3
status.bp = 2
equipment = new Equipment
main_hand : 'dagger'
items = new ItemBox {}
skills = new SkillBox p , cls_data.learned, cls_data.preset
data =
name : name
status : status.toData()
equipment : equipment.toData()
items : items.toData()
skills: skills.toData()
p = new Player null , data
p.toData()
| 130379 | {ObjectId} = require('./ObjectId')
{Character} = require './Character'
{Status} = require './Status'
{Equipment} = require './Equipment'
{ItemBox} = require './ItemBox'
Skills = require './skills'
{SkillBox} = require './skills'
racial_data = require('./shared/data/Race').RacialData
class_data = require('./shared/data/Class').ClassData
{random,sqrt,min,max,sin,cos} = Math
class Player extends Character
# Controller Implement
constructor: (@scene, data = {},@group=ObjectId.Player) ->
@name = data.name
@password = <PASSWORD>
@set_pos()
super(@scene,@x,@y,@group)
@status = new Status data.status
@equipment = new Equipment data.equipment
@skills = new SkillBox @, data.skills.learned, data.skills.preset
@selected_skill = @skills.sets[1]
@status.active_range = 4
@status.trace_range = 4
select_skill :()->
for k,v of @keys
if v and parseInt(k) in [1..5]
if @skills.sets[k]
return @selected_skill = @skills.sets[k]
update:(objs)->
enemies = @find_obj(ObjectId.get_enemy(@),objs,@status.active_range)
if @keys.space is 1 and @_last_space_ is 0
@shift_target(enemies)
@_last_space_ = @keys.space
range = @selected_skill.range
@status.active_range = range
@status.trace_range = range
super objs,@scene
set_destination:(x,y)->
@target = x:x,y:y,is_dead:(->false),status:{get_param:->}
wander : ->
move: ->
keys = @keys
sum = 0
for i in [keys.right , keys.left , keys.up , keys.down]
sum++ if i
if sum is 0
if ++@_wait > 120
return
else
super()
return
else if sum > 1
move = @status.speed * 0.7
else
move = @status.speed
@_on_going_destination = false
@to = null
@_wait = 0
if keys.right
if @scene.collide( @x+move , @y )
@x = ~~(@x)+1-0.1
else
@x += move
if keys.left
if @scene.collide( @x-move , @y )
@x = ~~(@x)+0.1
else
@x -= move
if keys.down
if @scene.collide( @x , @y-move )
@y = ~~(@y)+0.1
else
@y -= move
if keys.up
if @scene.collide( @x , @y+move )
@y = ~~(@y)+1-0.1
else
@y += move
exports.Player = Player
exports.create_new = (name,racial_name,cls_name)->
#mock
cls_data = class_data[cls_name]
r = racial_data[racial_name]
_status =
str : cls_data.status.str + r.str
int : cls_data.status.int + r.int
dex : cls_data.status.dex + r.dex
status = new Status _status
status.race = racial_name
# status.class = cls_name
status.gold = 0
status.exp = 0
status.lv = 1
status.sp = 3
status.bp = 2
equipment = new Equipment
main_hand : 'dagger'
items = new ItemBox {}
skills = new SkillBox p , cls_data.learned, cls_data.preset
data =
name : name
status : status.toData()
equipment : equipment.toData()
items : items.toData()
skills: skills.toData()
p = new Player null , data
p.toData()
| true | {ObjectId} = require('./ObjectId')
{Character} = require './Character'
{Status} = require './Status'
{Equipment} = require './Equipment'
{ItemBox} = require './ItemBox'
Skills = require './skills'
{SkillBox} = require './skills'
racial_data = require('./shared/data/Race').RacialData
class_data = require('./shared/data/Class').ClassData
{random,sqrt,min,max,sin,cos} = Math
class Player extends Character
# Controller Implement
constructor: (@scene, data = {},@group=ObjectId.Player) ->
@name = data.name
@password = PI:PASSWORD:<PASSWORD>END_PI
@set_pos()
super(@scene,@x,@y,@group)
@status = new Status data.status
@equipment = new Equipment data.equipment
@skills = new SkillBox @, data.skills.learned, data.skills.preset
@selected_skill = @skills.sets[1]
@status.active_range = 4
@status.trace_range = 4
select_skill :()->
for k,v of @keys
if v and parseInt(k) in [1..5]
if @skills.sets[k]
return @selected_skill = @skills.sets[k]
update:(objs)->
enemies = @find_obj(ObjectId.get_enemy(@),objs,@status.active_range)
if @keys.space is 1 and @_last_space_ is 0
@shift_target(enemies)
@_last_space_ = @keys.space
range = @selected_skill.range
@status.active_range = range
@status.trace_range = range
super objs,@scene
set_destination:(x,y)->
@target = x:x,y:y,is_dead:(->false),status:{get_param:->}
wander : ->
move: ->
keys = @keys
sum = 0
for i in [keys.right , keys.left , keys.up , keys.down]
sum++ if i
if sum is 0
if ++@_wait > 120
return
else
super()
return
else if sum > 1
move = @status.speed * 0.7
else
move = @status.speed
@_on_going_destination = false
@to = null
@_wait = 0
if keys.right
if @scene.collide( @x+move , @y )
@x = ~~(@x)+1-0.1
else
@x += move
if keys.left
if @scene.collide( @x-move , @y )
@x = ~~(@x)+0.1
else
@x -= move
if keys.down
if @scene.collide( @x , @y-move )
@y = ~~(@y)+0.1
else
@y -= move
if keys.up
if @scene.collide( @x , @y+move )
@y = ~~(@y)+1-0.1
else
@y += move
exports.Player = Player
exports.create_new = (name,racial_name,cls_name)->
#mock
cls_data = class_data[cls_name]
r = racial_data[racial_name]
_status =
str : cls_data.status.str + r.str
int : cls_data.status.int + r.int
dex : cls_data.status.dex + r.dex
status = new Status _status
status.race = racial_name
# status.class = cls_name
status.gold = 0
status.exp = 0
status.lv = 1
status.sp = 3
status.bp = 2
equipment = new Equipment
main_hand : 'dagger'
items = new ItemBox {}
skills = new SkillBox p , cls_data.learned, cls_data.preset
data =
name : name
status : status.toData()
equipment : equipment.toData()
items : items.toData()
skills: skills.toData()
p = new Player null , data
p.toData()
|
[
{
"context": " 'text'\n value: @state.name, placeholder: '用户名'\n onChange: @onNameChange\n $.input\n ",
"end": 571,
"score": 0.8388612866401672,
"start": 568,
"tag": "NAME",
"value": "用户名"
}
] | source/app/signup.coffee | Cumulo/sync-chat | 1 |
React = require 'react'
report = require '../report'
$ = React.DOM
module.exports = React.createFactory React.createClass
displayName: 'app-signup'
getInitialState: ->
name: ''
password: ''
onNameChange: (event) ->
@setState name: event.target.value
onPasswordChange: (event) ->
@setState password: event.target.value
onSubmit: ->
report.signup @state.name, @state.password
render: ->
$.div className: 'app-signup paragraph',
$.input
className: 'name', type: 'text'
value: @state.name, placeholder: '用户名'
onChange: @onNameChange
$.input
className: 'password', type: 'text'
onChange: @onPasswordChange
value: @state.password, placeholder: '密码'
$.div className: 'actions',
$.div className: 'button', onClick: @onSubmit, '注册新用户' | 144528 |
React = require 'react'
report = require '../report'
$ = React.DOM
module.exports = React.createFactory React.createClass
displayName: 'app-signup'
getInitialState: ->
name: ''
password: ''
onNameChange: (event) ->
@setState name: event.target.value
onPasswordChange: (event) ->
@setState password: event.target.value
onSubmit: ->
report.signup @state.name, @state.password
render: ->
$.div className: 'app-signup paragraph',
$.input
className: 'name', type: 'text'
value: @state.name, placeholder: '<NAME>'
onChange: @onNameChange
$.input
className: 'password', type: 'text'
onChange: @onPasswordChange
value: @state.password, placeholder: '密码'
$.div className: 'actions',
$.div className: 'button', onClick: @onSubmit, '注册新用户' | true |
React = require 'react'
report = require '../report'
$ = React.DOM
module.exports = React.createFactory React.createClass
displayName: 'app-signup'
getInitialState: ->
name: ''
password: ''
onNameChange: (event) ->
@setState name: event.target.value
onPasswordChange: (event) ->
@setState password: event.target.value
onSubmit: ->
report.signup @state.name, @state.password
render: ->
$.div className: 'app-signup paragraph',
$.input
className: 'name', type: 'text'
value: @state.name, placeholder: 'PI:NAME:<NAME>END_PI'
onChange: @onNameChange
$.input
className: 'password', type: 'text'
onChange: @onPasswordChange
value: @state.password, placeholder: '密码'
$.div className: 'actions',
$.div className: 'button', onClick: @onSubmit, '注册新用户' |
[
{
"context": "# Copyright Joyent, Inc. and other Node contributors.\n#\n# Permission",
"end": 18,
"score": 0.9992403984069824,
"start": 12,
"tag": "NAME",
"value": "Joyent"
}
] | test/simple/test-string-decoder-end.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.
# verify that the string decoder works getting 1 byte at a time,
# the whole buffer at once, and that both match the .toString(enc)
# result of the entire buffer.
# also test just arbitrary bytes from 0-15.
testEncoding = (encoding) ->
bufs.forEach (buf) ->
testBuf encoding, buf
return
return
testBuf = (encoding, buf) ->
console.error "# %s", encoding, buf
# write one byte at a time.
s = new SD(encoding)
res1 = ""
i = 0
while i < buf.length
res1 += s.write(buf.slice(i, i + 1))
i++
res1 += s.end()
# write the whole buffer at once.
res2 = ""
s = new SD(encoding)
res2 += s.write(buf)
res2 += s.end()
# .toString() on the buffer
res3 = buf.toString(encoding)
console.log "expect=%j", res3
assert.equal res1, res3, "one byte at a time should match toString"
assert.equal res2, res3, "all bytes at once should match toString"
return
assert = require("assert")
SD = require("string_decoder").StringDecoder
encodings = [
"base64"
"hex"
"utf8"
"utf16le"
"ucs2"
]
bufs = [
"☃💩"
"asdf"
].map((b) ->
new Buffer(b)
)
i = 1
while i <= 16
bytes = new Array(i).join(".").split(".").map((_, j) ->
j + 0x78
)
bufs.push new Buffer(bytes)
i++
encodings.forEach testEncoding
console.log "ok"
| 154330 | # 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.
# verify that the string decoder works getting 1 byte at a time,
# the whole buffer at once, and that both match the .toString(enc)
# result of the entire buffer.
# also test just arbitrary bytes from 0-15.
testEncoding = (encoding) ->
bufs.forEach (buf) ->
testBuf encoding, buf
return
return
testBuf = (encoding, buf) ->
console.error "# %s", encoding, buf
# write one byte at a time.
s = new SD(encoding)
res1 = ""
i = 0
while i < buf.length
res1 += s.write(buf.slice(i, i + 1))
i++
res1 += s.end()
# write the whole buffer at once.
res2 = ""
s = new SD(encoding)
res2 += s.write(buf)
res2 += s.end()
# .toString() on the buffer
res3 = buf.toString(encoding)
console.log "expect=%j", res3
assert.equal res1, res3, "one byte at a time should match toString"
assert.equal res2, res3, "all bytes at once should match toString"
return
assert = require("assert")
SD = require("string_decoder").StringDecoder
encodings = [
"base64"
"hex"
"utf8"
"utf16le"
"ucs2"
]
bufs = [
"☃💩"
"asdf"
].map((b) ->
new Buffer(b)
)
i = 1
while i <= 16
bytes = new Array(i).join(".").split(".").map((_, j) ->
j + 0x78
)
bufs.push new Buffer(bytes)
i++
encodings.forEach testEncoding
console.log "ok"
| 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.
# verify that the string decoder works getting 1 byte at a time,
# the whole buffer at once, and that both match the .toString(enc)
# result of the entire buffer.
# also test just arbitrary bytes from 0-15.
testEncoding = (encoding) ->
bufs.forEach (buf) ->
testBuf encoding, buf
return
return
testBuf = (encoding, buf) ->
console.error "# %s", encoding, buf
# write one byte at a time.
s = new SD(encoding)
res1 = ""
i = 0
while i < buf.length
res1 += s.write(buf.slice(i, i + 1))
i++
res1 += s.end()
# write the whole buffer at once.
res2 = ""
s = new SD(encoding)
res2 += s.write(buf)
res2 += s.end()
# .toString() on the buffer
res3 = buf.toString(encoding)
console.log "expect=%j", res3
assert.equal res1, res3, "one byte at a time should match toString"
assert.equal res2, res3, "all bytes at once should match toString"
return
assert = require("assert")
SD = require("string_decoder").StringDecoder
encodings = [
"base64"
"hex"
"utf8"
"utf16le"
"ucs2"
]
bufs = [
"☃💩"
"asdf"
].map((b) ->
new Buffer(b)
)
i = 1
while i <= 16
bytes = new Array(i).join(".").split(".").map((_, j) ->
j + 0x78
)
bufs.push new Buffer(bytes)
i++
encodings.forEach testEncoding
console.log "ok"
|
[
{
"context": "pes a double quote', ->\n expect(HAML.escape('Michael \"netzpirat\" Kessler')).toEqual 'Michael "net",
"end": 439,
"score": 0.9985222220420837,
"start": 432,
"tag": "NAME",
"value": "Michael"
},
{
"context": "ble quote', ->\n expect(HAML.escape('Michael \"netzpirat\" Kessler')).toEqual 'Michael "netzpirat"",
"end": 450,
"score": 0.9993310570716858,
"start": 441,
"tag": "NAME",
"value": "netzpirat"
},
{
"context": ", ->\n expect(HAML.escape('Michael \"netzpirat\" Kessler')).toEqual 'Michael "netzpirat" Kessler",
"end": 459,
"score": 0.99920654296875,
"start": 452,
"tag": "NAME",
"value": "Kessler"
},
{
"context": "L.escape('Michael \"netzpirat\" Kessler')).toEqual 'Michael "netzpirat" Kessler'\n\n it 'escapes a",
"end": 479,
"score": 0.9995461702346802,
"start": 472,
"tag": "NAME",
"value": "Michael"
},
{
"context": " \"netzpirat\" Kessler')).toEqual 'Michael "netzpirat" Kessler'\n\n it 'escapes a single quote', ",
"end": 495,
"score": 0.9950628280639648,
"start": 489,
"tag": "NAME",
"value": "zpirat"
},
{
"context": " Kessler')).toEqual 'Michael "netzpirat" Kessler'\n\n it 'escapes a single quote', ->\n expec",
"end": 509,
"score": 0.9384716153144836,
"start": 502,
"tag": "NAME",
"value": "Kessler"
},
{
"context": "pes a single quote', ->\n expect(HAML.escape(\"Michael 'netzpirat' Kessler\")).toEqual 'Michael 'netz",
"end": 581,
"score": 0.9996294975280762,
"start": 574,
"tag": "NAME",
"value": "Michael"
},
{
"context": "gle quote', ->\n expect(HAML.escape(\"Michael 'netzpirat' Kessler\")).toEqual 'Michael 'netzpirat' ",
"end": 592,
"score": 0.9995092153549194,
"start": 583,
"tag": "NAME",
"value": "netzpirat"
},
{
"context": ", ->\n expect(HAML.escape(\"Michael 'netzpirat' Kessler\")).toEqual 'Michael 'netzpirat' Kessler'\n",
"end": 601,
"score": 0.9966439604759216,
"start": 594,
"tag": "NAME",
"value": "Kessler"
},
{
"context": "L.escape(\"Michael 'netzpirat' Kessler\")).toEqual 'Michael 'netzpirat' Kessler'\n\n describe '.cleanV",
"end": 621,
"score": 0.9994725584983826,
"start": 614,
"tag": "NAME",
"value": "Michael"
},
{
"context": "l 'netzpirat' Kessler\")).toEqual 'Michael 'netzpirat' Kessler'\n\n describe '.cleanValue', ->\n i",
"end": 636,
"score": 0.9929510951042175,
"start": 630,
"tag": "NAME",
"value": "zpirat"
},
{
"context": "t' Kessler\")).toEqual 'Michael 'netzpirat' Kessler'\n\n describe '.cleanValue', ->\n it 'returns an",
"end": 649,
"score": 0.9280735850334167,
"start": 642,
"tag": "NAME",
"value": "Kessler"
}
] | spec/javascripts/hamlcoffee_spec.coffee | tenforwardconsulting/haml_coffee_assets | 24 | describe 'HAML', ->
describe '.escape', ->
it 'escapes an ampersand', ->
expect(HAML.escape('house & garden')).toEqual 'house & garden'
it 'escapes the less than sign', ->
expect(HAML.escape('money < fun')).toEqual 'money < fun'
it 'escapes the greater than sign', ->
expect(HAML.escape('love > hate')).toEqual 'love > hate'
it 'escapes a double quote', ->
expect(HAML.escape('Michael "netzpirat" Kessler')).toEqual 'Michael "netzpirat" Kessler'
it 'escapes a single quote', ->
expect(HAML.escape("Michael 'netzpirat' Kessler")).toEqual 'Michael 'netzpirat' Kessler'
describe '.cleanValue', ->
it 'returns an empty string for null', ->
expect(HAML.cleanValue(null)).toEqual ''
it 'returns an empty string for undefined', ->
expect(HAML.cleanValue(undefined)).toEqual ''
it 'marks a boolean true with unicode character u0093', ->
expect(HAML.cleanValue(true)).toEqual '\u0093true'
it 'marks a boolean true with unicode character u0093', ->
expect(HAML.cleanValue(false)).toEqual '\u0093false'
it 'passes everything else unchanged', ->
expect(HAML.cleanValue('Still the same')).toEqual 'Still the same'
describe '.extend', ->
it 'extends the given object from a source object', ->
object = HAML.extend {}, { a: 1, b: 2 }
expect(object.a).toEqual 1
expect(object.b).toEqual 2
it 'extends the given object from multipe source objects', ->
object = HAML.extend {}, { a: 1 }, { b: 2 }, { c: 3, d: 4 }
expect(object.a).toEqual 1
expect(object.b).toEqual 2
expect(object.c).toEqual 3
expect(object.d).toEqual 4
it 'overwrites existing properties', ->
object = HAML.extend {}, { a: 1 }, { b: 2 }, { a: 2, b: 4 }
expect(object.a).toEqual 2
expect(object.b).toEqual 4
describe '.globals', ->
it 'retuns the global object', ->
expect(HAML.globals).toEqual Object(HAML.globals)
it 'returns an empty object', ->
expect(Object.keys(HAML.globals).length).toEqual 0
describe '.context', ->
it 'merges the locals into the globals', ->
spyOn(HAML, 'globals').and.callFake -> { b: 2, d: 4 }
context = HAML.context({ a: 1, c: 3 })
expect(context.a).toEqual 1
expect(context.b).toEqual 2
expect(context.c).toEqual 3
expect(context.d).toEqual 4
describe '.preserve', ->
it 'preserves all newlines', ->
expect(HAML.preserve("Newlines\nall\nthe\nway\n")).toEqual "Newlines
all
the
way
"
describe '.findAndPreserve', ->
it 'replaces newlines within the preserved tags', ->
expect(HAML.findAndPreserve("""
<pre>
This will
be preserved
</pre>
<p>
This will not
be preserved
</p>
<textarea>
This will
be preserved
</textarea>
""")).toEqual """
<pre>
 This will
 be preserved
</pre>
<p>
This will not
be preserved
</p>
<textarea>
 This will
 be preserved
</textarea>
"""
describe '.surround', ->
it 'surrounds the text to the function result', ->
expect(HAML.surround('Prefix', 'Suffix', -> '<p>text</p>')).toEqual 'Prefix<p>text</p>Suffix'
describe '.succeed', ->
it 'appends the text to the function result', ->
expect(HAML.succeed('Suffix', -> '<p>text</p>')).toEqual '<p>text</p>Suffix'
describe '.precede', ->
it 'prepends the text to the function result', ->
expect(HAML.precede('Prefix', -> '<p>text</p>')).toEqual 'Prefix<p>text</p>'
describe '.reference', ->
describe 'class generation', ->
it 'uses the constructor name as name', ->
class MyUser
id: 42
expect(HAML.reference(new MyUser())).toEqual "class='my_user' id='my_user_42'"
it 'uses the custom name from #hamlObjectRef', ->
class MyUser
id: 23
hamlObjectRef: -> 'custom_name'
expect(HAML.reference(new MyUser())).toEqual "class='custom_name' id='custom_name_23'"
it 'defaults to `object` without consturctor name', ->
expect(HAML.reference({ id: 666 })).toEqual "class='object' id='object_666'"
it 'prepends a given prefix', ->
class MyUser
id: 42
expect(HAML.reference(new MyUser(), 'prefix')).toEqual "class='prefix_my_user' id='prefix_my_user_42'"
describe 'id generation', ->
it 'uses the object #id property', ->
class FromIdProp
id: 42
expect(HAML.reference(new FromIdProp())).toEqual "class='from_id_prop' id='from_id_prop_42'"
it 'uses the object #to_key function', ->
class FromToKeyFunc
to_key: -> 23
expect(HAML.reference(new FromToKeyFunc())).toEqual "class='from_to_key_func' id='from_to_key_func_23'"
it 'uses the object #id function', ->
class FromIdFunc
id: -> 123
expect(HAML.reference(new FromIdFunc())).toEqual "class='from_id_func' id='from_id_func_123'"
it 'uses the object itself', ->
expect(HAML.reference(123)).toEqual "class='number' id='number_123'"
| 81342 | describe 'HAML', ->
describe '.escape', ->
it 'escapes an ampersand', ->
expect(HAML.escape('house & garden')).toEqual 'house & garden'
it 'escapes the less than sign', ->
expect(HAML.escape('money < fun')).toEqual 'money < fun'
it 'escapes the greater than sign', ->
expect(HAML.escape('love > hate')).toEqual 'love > hate'
it 'escapes a double quote', ->
expect(HAML.escape('<NAME> "<NAME>" <NAME>')).toEqual '<NAME> "net<NAME>" <NAME>'
it 'escapes a single quote', ->
expect(HAML.escape("<NAME> '<NAME>' <NAME>")).toEqual '<NAME> 'net<NAME>' <NAME>'
describe '.cleanValue', ->
it 'returns an empty string for null', ->
expect(HAML.cleanValue(null)).toEqual ''
it 'returns an empty string for undefined', ->
expect(HAML.cleanValue(undefined)).toEqual ''
it 'marks a boolean true with unicode character u0093', ->
expect(HAML.cleanValue(true)).toEqual '\u0093true'
it 'marks a boolean true with unicode character u0093', ->
expect(HAML.cleanValue(false)).toEqual '\u0093false'
it 'passes everything else unchanged', ->
expect(HAML.cleanValue('Still the same')).toEqual 'Still the same'
describe '.extend', ->
it 'extends the given object from a source object', ->
object = HAML.extend {}, { a: 1, b: 2 }
expect(object.a).toEqual 1
expect(object.b).toEqual 2
it 'extends the given object from multipe source objects', ->
object = HAML.extend {}, { a: 1 }, { b: 2 }, { c: 3, d: 4 }
expect(object.a).toEqual 1
expect(object.b).toEqual 2
expect(object.c).toEqual 3
expect(object.d).toEqual 4
it 'overwrites existing properties', ->
object = HAML.extend {}, { a: 1 }, { b: 2 }, { a: 2, b: 4 }
expect(object.a).toEqual 2
expect(object.b).toEqual 4
describe '.globals', ->
it 'retuns the global object', ->
expect(HAML.globals).toEqual Object(HAML.globals)
it 'returns an empty object', ->
expect(Object.keys(HAML.globals).length).toEqual 0
describe '.context', ->
it 'merges the locals into the globals', ->
spyOn(HAML, 'globals').and.callFake -> { b: 2, d: 4 }
context = HAML.context({ a: 1, c: 3 })
expect(context.a).toEqual 1
expect(context.b).toEqual 2
expect(context.c).toEqual 3
expect(context.d).toEqual 4
describe '.preserve', ->
it 'preserves all newlines', ->
expect(HAML.preserve("Newlines\nall\nthe\nway\n")).toEqual "Newlines
all
the
way
"
describe '.findAndPreserve', ->
it 'replaces newlines within the preserved tags', ->
expect(HAML.findAndPreserve("""
<pre>
This will
be preserved
</pre>
<p>
This will not
be preserved
</p>
<textarea>
This will
be preserved
</textarea>
""")).toEqual """
<pre>
 This will
 be preserved
</pre>
<p>
This will not
be preserved
</p>
<textarea>
 This will
 be preserved
</textarea>
"""
describe '.surround', ->
it 'surrounds the text to the function result', ->
expect(HAML.surround('Prefix', 'Suffix', -> '<p>text</p>')).toEqual 'Prefix<p>text</p>Suffix'
describe '.succeed', ->
it 'appends the text to the function result', ->
expect(HAML.succeed('Suffix', -> '<p>text</p>')).toEqual '<p>text</p>Suffix'
describe '.precede', ->
it 'prepends the text to the function result', ->
expect(HAML.precede('Prefix', -> '<p>text</p>')).toEqual 'Prefix<p>text</p>'
describe '.reference', ->
describe 'class generation', ->
it 'uses the constructor name as name', ->
class MyUser
id: 42
expect(HAML.reference(new MyUser())).toEqual "class='my_user' id='my_user_42'"
it 'uses the custom name from #hamlObjectRef', ->
class MyUser
id: 23
hamlObjectRef: -> 'custom_name'
expect(HAML.reference(new MyUser())).toEqual "class='custom_name' id='custom_name_23'"
it 'defaults to `object` without consturctor name', ->
expect(HAML.reference({ id: 666 })).toEqual "class='object' id='object_666'"
it 'prepends a given prefix', ->
class MyUser
id: 42
expect(HAML.reference(new MyUser(), 'prefix')).toEqual "class='prefix_my_user' id='prefix_my_user_42'"
describe 'id generation', ->
it 'uses the object #id property', ->
class FromIdProp
id: 42
expect(HAML.reference(new FromIdProp())).toEqual "class='from_id_prop' id='from_id_prop_42'"
it 'uses the object #to_key function', ->
class FromToKeyFunc
to_key: -> 23
expect(HAML.reference(new FromToKeyFunc())).toEqual "class='from_to_key_func' id='from_to_key_func_23'"
it 'uses the object #id function', ->
class FromIdFunc
id: -> 123
expect(HAML.reference(new FromIdFunc())).toEqual "class='from_id_func' id='from_id_func_123'"
it 'uses the object itself', ->
expect(HAML.reference(123)).toEqual "class='number' id='number_123'"
| true | describe 'HAML', ->
describe '.escape', ->
it 'escapes an ampersand', ->
expect(HAML.escape('house & garden')).toEqual 'house & garden'
it 'escapes the less than sign', ->
expect(HAML.escape('money < fun')).toEqual 'money < fun'
it 'escapes the greater than sign', ->
expect(HAML.escape('love > hate')).toEqual 'love > hate'
it 'escapes a double quote', ->
expect(HAML.escape('PI:NAME:<NAME>END_PI "PI:NAME:<NAME>END_PI" PI:NAME:<NAME>END_PI')).toEqual 'PI:NAME:<NAME>END_PI "netPI:NAME:<NAME>END_PI" PI:NAME:<NAME>END_PI'
it 'escapes a single quote', ->
expect(HAML.escape("PI:NAME:<NAME>END_PI 'PI:NAME:<NAME>END_PI' PI:NAME:<NAME>END_PI")).toEqual 'PI:NAME:<NAME>END_PI 'netPI:NAME:<NAME>END_PI' PI:NAME:<NAME>END_PI'
describe '.cleanValue', ->
it 'returns an empty string for null', ->
expect(HAML.cleanValue(null)).toEqual ''
it 'returns an empty string for undefined', ->
expect(HAML.cleanValue(undefined)).toEqual ''
it 'marks a boolean true with unicode character u0093', ->
expect(HAML.cleanValue(true)).toEqual '\u0093true'
it 'marks a boolean true with unicode character u0093', ->
expect(HAML.cleanValue(false)).toEqual '\u0093false'
it 'passes everything else unchanged', ->
expect(HAML.cleanValue('Still the same')).toEqual 'Still the same'
describe '.extend', ->
it 'extends the given object from a source object', ->
object = HAML.extend {}, { a: 1, b: 2 }
expect(object.a).toEqual 1
expect(object.b).toEqual 2
it 'extends the given object from multipe source objects', ->
object = HAML.extend {}, { a: 1 }, { b: 2 }, { c: 3, d: 4 }
expect(object.a).toEqual 1
expect(object.b).toEqual 2
expect(object.c).toEqual 3
expect(object.d).toEqual 4
it 'overwrites existing properties', ->
object = HAML.extend {}, { a: 1 }, { b: 2 }, { a: 2, b: 4 }
expect(object.a).toEqual 2
expect(object.b).toEqual 4
describe '.globals', ->
it 'retuns the global object', ->
expect(HAML.globals).toEqual Object(HAML.globals)
it 'returns an empty object', ->
expect(Object.keys(HAML.globals).length).toEqual 0
describe '.context', ->
it 'merges the locals into the globals', ->
spyOn(HAML, 'globals').and.callFake -> { b: 2, d: 4 }
context = HAML.context({ a: 1, c: 3 })
expect(context.a).toEqual 1
expect(context.b).toEqual 2
expect(context.c).toEqual 3
expect(context.d).toEqual 4
describe '.preserve', ->
it 'preserves all newlines', ->
expect(HAML.preserve("Newlines\nall\nthe\nway\n")).toEqual "Newlines
all
the
way
"
describe '.findAndPreserve', ->
it 'replaces newlines within the preserved tags', ->
expect(HAML.findAndPreserve("""
<pre>
This will
be preserved
</pre>
<p>
This will not
be preserved
</p>
<textarea>
This will
be preserved
</textarea>
""")).toEqual """
<pre>
 This will
 be preserved
</pre>
<p>
This will not
be preserved
</p>
<textarea>
 This will
 be preserved
</textarea>
"""
describe '.surround', ->
it 'surrounds the text to the function result', ->
expect(HAML.surround('Prefix', 'Suffix', -> '<p>text</p>')).toEqual 'Prefix<p>text</p>Suffix'
describe '.succeed', ->
it 'appends the text to the function result', ->
expect(HAML.succeed('Suffix', -> '<p>text</p>')).toEqual '<p>text</p>Suffix'
describe '.precede', ->
it 'prepends the text to the function result', ->
expect(HAML.precede('Prefix', -> '<p>text</p>')).toEqual 'Prefix<p>text</p>'
describe '.reference', ->
describe 'class generation', ->
it 'uses the constructor name as name', ->
class MyUser
id: 42
expect(HAML.reference(new MyUser())).toEqual "class='my_user' id='my_user_42'"
it 'uses the custom name from #hamlObjectRef', ->
class MyUser
id: 23
hamlObjectRef: -> 'custom_name'
expect(HAML.reference(new MyUser())).toEqual "class='custom_name' id='custom_name_23'"
it 'defaults to `object` without consturctor name', ->
expect(HAML.reference({ id: 666 })).toEqual "class='object' id='object_666'"
it 'prepends a given prefix', ->
class MyUser
id: 42
expect(HAML.reference(new MyUser(), 'prefix')).toEqual "class='prefix_my_user' id='prefix_my_user_42'"
describe 'id generation', ->
it 'uses the object #id property', ->
class FromIdProp
id: 42
expect(HAML.reference(new FromIdProp())).toEqual "class='from_id_prop' id='from_id_prop_42'"
it 'uses the object #to_key function', ->
class FromToKeyFunc
to_key: -> 23
expect(HAML.reference(new FromToKeyFunc())).toEqual "class='from_to_key_func' id='from_to_key_func_23'"
it 'uses the object #id function', ->
class FromIdFunc
id: -> 123
expect(HAML.reference(new FromIdFunc())).toEqual "class='from_id_func' id='from_id_func_123'"
it 'uses the object itself', ->
expect(HAML.reference(123)).toEqual "class='number' id='number_123'"
|
[
{
"context": "t Buffer type', (done) ->\n User.create {name: 'John', icon: new Buffer('1a2')}, (err, u) ->\n Us",
"end": 8676,
"score": 0.9985608458518982,
"start": 8672,
"tag": "NAME",
"value": "John"
},
{
"context": "(done) ->\n User.create [\n {age: 3, name: 'user0'},\n {age: 2, name: 'user1'},\n {age: 4, ",
"end": 10654,
"score": 0.9984468221664429,
"start": 10649,
"tag": "USERNAME",
"value": "user0"
},
{
"context": " {age: 3, name: 'user0'},\n {age: 2, name: 'user1'},\n {age: 4, name: 'user3'}],\n (err, us",
"end": 10685,
"score": 0.9972217082977295,
"start": 10680,
"tag": "USERNAME",
"value": "user1"
},
{
"context": " {age: 2, name: 'user1'},\n {age: 4, name: 'user3'}],\n (err, users) ->\n should.not.exis",
"end": 10716,
"score": 0.9955242276191711,
"start": 10711,
"tag": "USERNAME",
"value": "user3"
},
{
"context": " {age: {inq: [3]}},\n {name: {inq: ['user3']}}\n ]\n }}, (err, founds) ->\n ",
"end": 10943,
"score": 0.993373692035675,
"start": 10938,
"tag": "USERNAME",
"value": "user3"
},
{
"context": "ific instance', (done) ->\n User.create {name: 'Al', age: 31, email:'al@'}, (err, createdusers) ->\n ",
"end": 14303,
"score": 0.9984793066978455,
"start": 14301,
"tag": "NAME",
"value": "Al"
},
{
"context": " createdusers.updateAttributes {age: 32, email:'al@strongloop'}, (err, updated) ->\n should.not.exist(err",
"end": 14418,
"score": 0.9579726457595825,
"start": 14405,
"tag": "EMAIL",
"value": "al@strongloop"
},
{
"context": ".equal(32)\n updated.email.should.be.equal('al@strongloop')\n done()\n\n # MEMO: Import data present i",
"end": 14562,
"score": 0.8991466164588928,
"start": 14549,
"tag": "EMAIL",
"value": "al@strongloop"
},
{
"context": "ng criteria', (done) ->\n User.create {name: 'Al', age: 31, email:'al@strongloop'}, (err, createdu",
"end": 15404,
"score": 0.9997764229774475,
"start": 15402,
"tag": "NAME",
"value": "Al"
},
{
"context": "->\n User.create {name: 'Al', age: 31, email:'al@strongloop'}, (err, createdusers) ->\n User.create {na",
"end": 15436,
"score": 0.9993759989738464,
"start": 15423,
"tag": "EMAIL",
"value": "al@strongloop"
},
{
"context": "err, createdusers) ->\n User.create {name: 'Simon', age: 32, email:'simon@strongloop'}, (err, crea",
"end": 15496,
"score": 0.999751091003418,
"start": 15491,
"tag": "NAME",
"value": "Simon"
},
{
"context": " User.create {name: 'Simon', age: 32, email:'simon@strongloop'}, (err, createdusers) ->\n User.create {",
"end": 15532,
"score": 0.9997063875198364,
"start": 15516,
"tag": "EMAIL",
"value": "simon@strongloop"
},
{
"context": "r, createdusers) ->\n User.create {name: 'Ray', age: 31, email:'ray@strongloop'}, (err, create",
"end": 15592,
"score": 0.9998173713684082,
"start": 15589,
"tag": "NAME",
"value": "Ray"
},
{
"context": " User.create {name: 'Ray', age: 31, email:'ray@strongloop'}, (err, createdusers) ->\n User.update",
"end": 15626,
"score": 0.9996460676193237,
"start": 15612,
"tag": "EMAIL",
"value": "ray@strongloop"
}
] | test/crud/document.test.coffee | mrbatista/loopback-connector-arangodb | 15 | # This test written in mocha+should.js
should = require('./../init');
describe 'document', () ->
db = null
User = null
Post = null
Product = null
PostWithNumberId = null
PostWithStringId = null
PostWithStringKey = null
PostWithNumberUnderscoreId = null
Name = null
before (done) ->
db = getDataSource()
User = db.define('User', {
name: {type: String, index: true},
email: {type: String, index: true, unique: true},
age: Number,
icon: Buffer
}, {
indexes: {
name_age_index: {
keys: {name: 1, age: -1}
}, # The value contains keys and optinally options
age_index: {age: -1} # The value itself is for keys
}
});
Post = db.define('Post', {
title: {type: String, length: 255, index: true},
content: {type: String},
comments: [String]
},
{forceId: false});
Product = db.define('Product', {
name: {type: String, length: 255, index: true},
description: {type: String},
price: {type: Number},
pricehistory: {type: Object}
});
PostWithStringId = db.define('PostWithStringId', {
id: {type: String, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
PostWithStringKey = db.define('PostWithStringKey', {
_key: {type: String, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
PostWithNumberUnderscoreId = db.define('PostWithNumberUnderscoreId', {
_id: {type: Number, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
PostWithNumberId = db.define('PostWithNumberId', {
id: {type: Number, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
Name = db.define('Name', {}, {});
User.hasMany(Post);
Post.belongsTo(User);
db.automigrate(['User', 'Post', 'Product', 'PostWithStringId', 'PostWithStringKey',
'PostWithNumberUnderscoreId','PostWithNumberId'], done)
beforeEach (done) ->
User.settings.arangodb = {};
User.destroyAll ->
Post.destroyAll ->
PostWithNumberId.destroyAll ->
PostWithNumberUnderscoreId.destroyAll ->
PostWithStringId.destroyAll ->
PostWithStringKey.destroyAll(done)
it 'should handle correctly type Number for id field _id', (done) ->
PostWithNumberUnderscoreId.create {_id: 3, content: 'test'}, (err, person) ->
should.not.exist(err)
person._id.should.be.equal(3)
PostWithNumberUnderscoreId.findById person._id, (err, p) ->
should.not.exist(err)
p.content.should.be.equal('test')
done()
it 'should handle correctly type Number for id field _id using String', (done) ->
PostWithNumberUnderscoreId.create {_id: 4, content: 'test'}, (err, person) ->
should.not.exist(err)
person._id.should.be.equal(4);
PostWithNumberUnderscoreId.findById '4', (err, p) ->
should.not.exist(err)
p.content.should.be.equal('test');
done()
it 'should allow to find post by id string if `_id` is defined id', (done) ->
PostWithNumberUnderscoreId.create (err, post) ->
PostWithNumberUnderscoreId.find {where: {_id: post._id.toString()}}, (err, p) ->
should.not.exist(err)
post = p[0]
should.exist(post)
post._id.should.be.an.instanceOf(Number);
done()
it 'find with `_id` as defined id should return an object with _id instanceof String', (done) ->
PostWithNumberUnderscoreId.create (err, post) ->
PostWithNumberUnderscoreId.findById post._id, (err, post) ->
should.not.exist(err)
post._id.should.be.an.instanceOf(Number)
done()
it 'should update the instance with `_id` as defined id', (done) ->
PostWithNumberUnderscoreId.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b'
PostWithNumberUnderscoreId.updateOrCreate post, (err, p) ->
should.not.exist(err)
p._id.should.be.equal(post._id)
PostWithNumberUnderscoreId.findById post._id, (err, p) ->
should.not.exist(err)
p._id.should.be.eql(post._id)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
PostWithNumberUnderscoreId.find {where: {title: 'b'}}, (err, posts) ->
should.not.exist(err)
p = posts[0]
p._id.should.be.eql(post._id)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
posts.should.have.lengthOf(1)
done()
it 'all should return object (with `_id` as defined id) with an _id instanceof String', (done) ->
post = new PostWithNumberUnderscoreId({title: 'a', content: 'AAA'})
post.save (err, post) ->
PostWithNumberUnderscoreId.all {where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', 'AAA')
post._id.should.be.an.instanceOf(Number)
done()
it 'all return should honor filter.fields, with `_id` as defined id', (done) ->
post = new PostWithNumberUnderscoreId {title: 'a', content: 'AAA'}
post.save (err, post) ->
PostWithNumberUnderscoreId.all {fields: ['title'], where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', undefined)
should.not.exist(post._id)
done()
it 'should allow to find post by id string if `_key` is defined id', (done) ->
PostWithStringKey.create (err, post) ->
PostWithStringKey.find {where: {_key: post._key.toString()}}, (err, p) ->
should.not.exist(err)
post = p[0]
should.exist(post)
post._key.should.be.an.instanceOf(String);
done()
it 'find with `_key` as defined id should return an object with _key instanceof String', (done) ->
PostWithStringKey.create (err, post) ->
PostWithStringKey.findById post._key, (err, post) ->
should.not.exist(err)
post._key.should.be.an.instanceOf(String)
done()
it 'should update the instance with `_key` as defined id', (done) ->
PostWithStringKey.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b'
PostWithStringKey.updateOrCreate post, (err, p) ->
should.not.exist(err)
p._key.should.be.equal(post._key)
PostWithStringKey.findById post._key, (err, p) ->
should.not.exist(err)
p._key.should.be.eql(post._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
PostWithStringKey.find {where: {title: 'b'}}, (err, posts) ->
should.not.exist(err)
p = posts[0]
p._key.should.be.eql(post._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
posts.should.have.lengthOf(1)
done()
it 'all should return object (with `_key` as defined id) with an _key instanceof String', (done) ->
post = new PostWithStringKey({title: 'a', content: 'AAA'})
post.save (err, post) ->
PostWithStringKey.all {where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', 'AAA')
post._key.should.be.an.instanceOf(String)
done()
it 'all return should honor filter.fields, with `_key` as defined id', (done) ->
post = new PostWithStringKey {title: 'a', content: 'AAA'}
post.save (err, post) ->
PostWithStringKey.all {fields: ['title'], where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', undefined)
should.not.exist(post._key)
done()
it 'should have created simple User models', (done) ->
User.create {age: 3, content: 'test'}, (err, user) ->
should.not.exist(err)
user.age.should.be.equal(3)
user.content.should.be.equal('test')
user.id.should.not.be.null
should.not.exists user._key
done()
it 'should support Buffer type', (done) ->
User.create {name: 'John', icon: new Buffer('1a2')}, (err, u) ->
User.findById u.id, (err, user) ->
should.not.exist(err)
user.icon.should.be.an.instanceOf(Buffer)
done()
it 'hasMany should support additional conditions', (done) ->
User.create {}, (e, u) ->
u.posts.create (e, p) ->
u.posts {where: {id: p.id}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
done()
it 'create should return id field but not arangodb _key', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
should.not.exist(err)
should.exist(post.id)
should.not.exist(post._key)
should.not.exist(post._id)
done()
it 'should allow to find by id string', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
Post.findById post.id.toString(), (err, p) ->
should.not.exist(err)
should.exist(p)
done()
it 'should allow to find by id using where', (done) ->
Post.create {title: 'Post1', content: 'Post1 content'}, (err, p1) ->
Post.create {title: 'Post2', content: 'Post2 content'}, (err, p2) ->
Post.find {where: {id: p1.id}}, (err, p) ->
should.not.exist(err)
should.exist(p && p[0])
p.length.should.be.equal(1)
#Not strict equal
p[0].id.should.be.eql(p1.id)
done()
it 'should allow to find by id using where inq', (done) ->
Post.create {title: 'Post1', content: 'Post1 content'}, (err, p1) ->
Post.create {title: 'Post2', content: 'Post2 content'}, (err, p2) ->
Post.find {where: {id: {inq: [p1.id]}}}, (err, p) ->
should.not.exist(err)
should.exist(p && p[0])
p.length.should.be.equal(1)
#Not strict equal
p[0].id.should.be.eql(p1.id)
done()
it 'inq operator respect type of field', (done) ->
User.create [
{age: 3, name: 'user0'},
{age: 2, name: 'user1'},
{age: 4, name: 'user3'}],
(err, users) ->
should.not.exist(err)
users.should.be.instanceof(Array).and.have.lengthOf(3);
User.find {where: {or:
[
{age: {inq: [3]}},
{name: {inq: ['user3']}}
]
}}, (err, founds) ->
should.not.exist(err)
should.exist(founds)
founds.should.be.instanceof(Array).and.have.lengthOf(2);
founds.should.containDeep({id: users[0], id: users[3]})
done()
it 'should invoke hooks', (done) ->
events = []
connector = Post.getDataSource().connector
connector.observe 'before execute', (ctx, next) ->
ctx.req.command.should.be.string;
ctx.req.params.should.be.array;
events.push('before execute ' + ctx.req.command);
next()
connector.observe 'after execute', (ctx, next) ->
ctx.res.should.be.object;
events.push('after execute ' + ctx.req.command);
next()
Post.create {title: 'Post1', content: 'Post1 content'}, (err, p1) ->
Post.find (err, results) ->
events.should.eql(['before execute save', 'after execute save',
'before execute document', 'after execute document'])
connector.clearObservers 'before execute'
connector.clearObservers 'after execute'
done(err, results)
it 'should allow to find by number id using where', (done) ->
PostWithNumberId.create {id: 1, title: 'Post1', content: 'Post1 content'}, (err, p1) ->
PostWithNumberId.create {id: 2, title: 'Post2', content: 'Post2 content'}, (err, p2) ->
PostWithNumberId.find {where: {id: p1.id}}, (err, p) ->
should.not.exist(err)
should.exist(p && p[0])
p.length.should.be.equal(1)
p[0].id.should.be.eql(p1.id)
done()
it 'should allow to find by number id using where inq', (done) ->
PostWithNumberId.create {id: 1, title: 'Post1', content: 'Post1 content'}, (err, p1) ->
return done err if err
PostWithNumberId.create {id: 2, title: 'Post2', content: 'Post2 content'}, (err, p2) ->
return done err if err
filter = {where: {id: {inq: [1]}}}
PostWithNumberId.find filter, (err, p) ->
return done err if err
p.length.should.be.equal(1)
p[0].id.should.be.eql(p1.id)
PostWithNumberId.find {where: {id: {inq: [1, 2]}}}, (err, p) ->
return done err if err
p.length.should.be.equal(2)
p[0].id.should.be.eql(p1.id)
p[1].id.should.be.eql(p2.id)
PostWithNumberId.find {where: {id: {inq: [0]}}}, (err, p) ->
return done err if err
p.length.should.be.equal(0)
done()
it 'save should not return arangodb _key and _rev', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
post.content = 'AAA'
post.save (err, p) ->
should.not.exist(err)
should.not.exist(p._key)
should.not.exist(p._rev)
p.id.should.be.equal(post.id)
p.content.should.be.equal('AAA')
done()
it 'find should return an object with an id, which is instanceof String, but not arangodb _key', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
Post.findById post.id, (err, post) ->
should.not.exist(err)
post.id.should.be.an.instanceOf(String)
should.not.exist(post._key)
done()
it 'should update attribute of the specific instance', (done) ->
User.create {name: 'Al', age: 31, email:'al@'}, (err, createdusers) ->
createdusers.updateAttributes {age: 32, email:'al@strongloop'}, (err, updated) ->
should.not.exist(err)
updated.age.should.be.equal(32)
updated.email.should.be.equal('al@strongloop')
done()
# MEMO: Import data present into data/users/names_100000.json before running this test.
it.skip 'cursor should returns all documents more then max single default size (1000) ', (done) ->
# Increase timeout only for this test
this.timeout(20000);
Name.find (err, names) ->
should.not.exist(err)
names.length.should.be.equal(100000)
done()
it.skip 'cursor should returns all documents more then max single default cursor size (1000) and respect limit filter ', (done) ->
# Increase timeout only for this test
this.timeout(20000);
Name.find {limit: 1002}, (err, names) ->
should.not.exist(err)
names.length.should.be.equal(1002)
done()
describe 'updateAll', () ->
it 'should update the instance matching criteria', (done) ->
User.create {name: 'Al', age: 31, email:'al@strongloop'}, (err, createdusers) ->
User.create {name: 'Simon', age: 32, email:'simon@strongloop'}, (err, createdusers) ->
User.create {name: 'Ray', age: 31, email:'ray@strongloop'}, (err, createdusers) ->
User.updateAll {age:31},{company:'strongloop.com'}, (err, updatedusers) ->
should.not.exist(err)
updatedusers.should.have.property('count', 2);
User.find {where:{age:31}}, (err2, foundusers) ->
should.not.exist(err2)
foundusers[0].company.should.be.equal('strongloop.com')
foundusers[1].company.should.be.equal('strongloop.com')
done()
it 'updateOrCreate should update the instance', (done) ->
Post.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b'
Post.updateOrCreate post, (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
done()
it 'updateOrCreate should update the instance without removing existing properties', (done) ->
Post.create {title: 'a', content: 'AAA', comments: ['Comment1']}, (err, post) ->
post = post.toObject()
delete post.title
delete post.comments;
Post.updateOrCreate post, (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('a')
p.comments[0].should.be.equal('Comment1')
done()
it 'updateOrCreate should create a new instance if it does not exist', (done) ->
post = {id: '123', title: 'a', content: 'AAA'};
Post.updateOrCreate post, (err, p) ->
should.not.exist(err)
p.title.should.be.equal(post.title)
p.content.should.be.equal(post.content)
p.id.should.be.eql(post.id)
Post.findById p.id, (err, p) ->
p.id.should.be.equal(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal(post.title)
p.id.should.be.equal(post.id)
done()
it 'save should update the instance with the same id', (done) ->
Post.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b';
post.save (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
done()
it 'save should update the instance without removing existing properties', (done) ->
Post.create {title: 'a', content: 'AAA'}, (err, post) ->
delete post.title
post.save (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('a')
done()
it 'save should create a new instance if it does not exist', (done) ->
post = new Post {title: 'a', content: 'AAA'}
post.save post, (err, p) ->
should.not.exist(err)
p.title.should.be.equal(post.title);
p.content.should.be.equal(post.content);
p.id.should.be.equal(post.id)
Post.findById p.id, (err, p) ->
p.id.should.be.equal(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal(post.title)
p.id.should.be.equal(post.id)
done()
it 'all should return object with an id, which is instanceof String, but not arangodb _key', (done) ->
post = new Post {title: 'a', content: 'AAA'}
post.save (err, post) ->
Post.all {where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', 'AAA')
post.id.should.be.an.instanceOf(String)
should.not.exist(post._key)
done()
it 'all return should honor filter.fields', (done) ->
post = new Post {title: 'b', content: 'BBB'}
post.save (err, post) ->
Post.all {fields: ['title'], where: {content: 'BBB'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'b')
post.should.have.property('content', undefined)
should.not.exist(post._key)
should.not.exist(post.id)
done()
it 'find should order by id if the order is not set for the query filter', (done) ->
PostWithStringId.create {id: '2', title: 'c', content: 'CCC'}, (err, post) ->
PostWithStringId.create {id: '1', title: 'd', content: 'DDD'}, (err, post) ->
PostWithStringId.find (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(2)
posts[0].id.should.be.equal('1')
PostWithStringId.find {limit: 1, offset: 0}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('1')
PostWithStringId.find {limit: 1, offset: 1}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('2')
done()
it 'order by specific query filter', (done) ->
PostWithStringId.create {id: '2', title: 'c', content: 'CCC'}, (err, post) ->
PostWithStringId.create {id: '1', title: 'd', content: 'DDD'}, (err, post) ->
PostWithStringId.create {id: '3', title: 'd', content: 'AAA'}, (err, post) ->
PostWithStringId.find {order: ['title DESC', 'content ASC']}, (err, posts) ->
posts.length.should.be.equal(3)
posts[0].id.should.be.equal('3')
PostWithStringId.find {order: ['title DESC', 'content ASC'], limit: 1, offset: 0}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('3')
PostWithStringId.find {order: ['title DESC', 'content ASC'], limit: 1, offset: 1}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('2')
PostWithStringId.find {order: ['title DESC', 'content ASC'], limit: 1, offset: 2}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('1')
done()
it 'should report error on duplicate keys', (done) ->
Post.create {title: 'd', content: 'DDD'}, (err, post) ->
Post.create {id: post.id, title: 'd', content: 'DDD'}, (err, post) ->
should.exist(err)
done()
it 'should allow to find using like', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {like: 'M%st'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should allow to find using case insensitive like', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {like: 'm%st', options: 'i'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should allow to find using case insensitive like', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {content: {like: 'HELLO', options: 'i'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support like for no match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {like: 'M%XY'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should allow to find using nlike', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {nlike: 'M%st'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should allow to find using case insensitive nlike', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {nlike: 'm%st', options: 'i'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should support nlike for no match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {nlike: 'M%XY'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support "and" operator that is satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {and: [{title: 'My Post'}, {content: 'Hello'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support "and" operator that is not satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {and: [{title: 'My Post'}, {content: 'Hello1'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should support "or" that is satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {or: [{title: 'My Post'}, {content: 'Hello1'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support "or" operator that is not satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {or: [{title: 'My Post1'}, {content: 'Hello1'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
# TODO: Add support to "nor"
# it 'should support "nor" operator that is satisfied', (done) ->
#
# Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
# Post.find {where: {nor: [{title: 'My Post1'}, {content: 'Hello1'}]}}, (err, posts) ->
# should.not.exist(err)
# posts.should.have.property('length', 1)
#
# done()
#
# it 'should support "nor" operator that is not satisfied', (done) ->
#
# Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
# Post.find {where: {nor: [{title: 'My Post'}, {content: 'Hello1'}]}}, (err, posts) ->
# should.not.exist(err)
# posts.should.have.property('length', 0)
#
# done()
it 'should support neq for match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {neq: 'XY'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support neq for no match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {neq: 'My Post'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
# The where object should be parsed by the connector
it 'should support where for count', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.count {and: [{title: 'My Post'}, {content: 'Hello'}]}, (err, count) ->
should.not.exist(err)
count.should.be.equal(1)
Post.count {and: [{title: 'My Post1'}, {content: 'Hello'}]}, (err, count) ->
should.not.exist(err)
count.should.be.equal(0)
done()
# The where object should be parsed by the connector
it 'should support where for destroyAll', (done) ->
Post.create {title: 'My Post1', content: 'Hello'}, (err, post) ->
Post.create {title: 'My Post2', content: 'Hello'}, (err, post) ->
Post.destroyAll {and: [
{title: 'My Post1'},
{content: 'Hello'}
]}, (err) ->
should.not.exist(err)
Post.count (err, count) ->
should.not.exist(err)
count.should.be.equal(1)
done()
# context 'regexp operator', () ->
# before () ->
# deleteExistingTestFixtures (done) ->
# Post.destroyAll(done)
#
# beforeEach () ->
# createTestFixtures (done) ->
# Post.create [
# {title: 'a', content: 'AAA'},
# {title: 'b', content: 'BBB'}
# ], done
#
# after () ->
# deleteTestFixtures (done) ->
# Post.destroyAll(done);
#
# context 'with regex strings', () ->
# context 'using no flags', () ->
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: '^A'}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# context 'using flags', () ->
# beforeEach () ->
# addSpy () ->
# sinon.stub(console, 'warn');
#
# afterEach () ->
# removeSpy ->
# console.warn.restore();
#
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: '^a/i'}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# it 'should print a warning when the global flag is set', (done) ->
# Post.find {where: {content: {regexp: '^a/g'}}}, (err, posts) ->
# console.warn.calledOnce.should.be.ok
# done()
#
# context 'with regex literals', () ->
# context 'using no flags', () ->
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: /^A/}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
#
# context 'using flags', () ->
# beforeEach () ->
# addSpy () ->
# sinon.stub(console, 'warn')
#
# afterEach () ->
# removeSpy () ->
# console.warn.restore()
#
#
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: /^a/i}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# it 'should print a warning when the global flag is set', (done) ->
# Post.find {where: {content: {regexp: /^a/g}}}, (err, posts) ->
# console.warn.calledOnce.should.be.ok
# done()
#
# context 'with regex object', () ->
# context 'using no flags', () ->
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: new RegExp(/^A/)}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
#
# context 'using flags', () ->
# beforeEach () ->
# addSpy () ->
# sinon.stub(console, 'warn')
#
# afterEach () ->
# removeSpy () ->
# console.warn.restore()
#
#
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: new RegExp(/^a/i)}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# it 'should print a warning when the global flag is set', (done) ->
# Post.find {where: {content: {regexp: new RegExp(/^a/g)}}}, (err, posts) ->
# should.not.exist(err)
# console.warn.calledOnce.should.be.ok;
# done()
after (done) ->
User.destroyAll ->
Post.destroyAll ->
PostWithNumberId.destroyAll ->
PostWithStringId.destroyAll ->
PostWithStringKey.destroyAll ->
PostWithNumberUnderscoreId.destroyAll(done)
| 372 | # This test written in mocha+should.js
should = require('./../init');
describe 'document', () ->
db = null
User = null
Post = null
Product = null
PostWithNumberId = null
PostWithStringId = null
PostWithStringKey = null
PostWithNumberUnderscoreId = null
Name = null
before (done) ->
db = getDataSource()
User = db.define('User', {
name: {type: String, index: true},
email: {type: String, index: true, unique: true},
age: Number,
icon: Buffer
}, {
indexes: {
name_age_index: {
keys: {name: 1, age: -1}
}, # The value contains keys and optinally options
age_index: {age: -1} # The value itself is for keys
}
});
Post = db.define('Post', {
title: {type: String, length: 255, index: true},
content: {type: String},
comments: [String]
},
{forceId: false});
Product = db.define('Product', {
name: {type: String, length: 255, index: true},
description: {type: String},
price: {type: Number},
pricehistory: {type: Object}
});
PostWithStringId = db.define('PostWithStringId', {
id: {type: String, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
PostWithStringKey = db.define('PostWithStringKey', {
_key: {type: String, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
PostWithNumberUnderscoreId = db.define('PostWithNumberUnderscoreId', {
_id: {type: Number, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
PostWithNumberId = db.define('PostWithNumberId', {
id: {type: Number, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
Name = db.define('Name', {}, {});
User.hasMany(Post);
Post.belongsTo(User);
db.automigrate(['User', 'Post', 'Product', 'PostWithStringId', 'PostWithStringKey',
'PostWithNumberUnderscoreId','PostWithNumberId'], done)
beforeEach (done) ->
User.settings.arangodb = {};
User.destroyAll ->
Post.destroyAll ->
PostWithNumberId.destroyAll ->
PostWithNumberUnderscoreId.destroyAll ->
PostWithStringId.destroyAll ->
PostWithStringKey.destroyAll(done)
it 'should handle correctly type Number for id field _id', (done) ->
PostWithNumberUnderscoreId.create {_id: 3, content: 'test'}, (err, person) ->
should.not.exist(err)
person._id.should.be.equal(3)
PostWithNumberUnderscoreId.findById person._id, (err, p) ->
should.not.exist(err)
p.content.should.be.equal('test')
done()
it 'should handle correctly type Number for id field _id using String', (done) ->
PostWithNumberUnderscoreId.create {_id: 4, content: 'test'}, (err, person) ->
should.not.exist(err)
person._id.should.be.equal(4);
PostWithNumberUnderscoreId.findById '4', (err, p) ->
should.not.exist(err)
p.content.should.be.equal('test');
done()
it 'should allow to find post by id string if `_id` is defined id', (done) ->
PostWithNumberUnderscoreId.create (err, post) ->
PostWithNumberUnderscoreId.find {where: {_id: post._id.toString()}}, (err, p) ->
should.not.exist(err)
post = p[0]
should.exist(post)
post._id.should.be.an.instanceOf(Number);
done()
it 'find with `_id` as defined id should return an object with _id instanceof String', (done) ->
PostWithNumberUnderscoreId.create (err, post) ->
PostWithNumberUnderscoreId.findById post._id, (err, post) ->
should.not.exist(err)
post._id.should.be.an.instanceOf(Number)
done()
it 'should update the instance with `_id` as defined id', (done) ->
PostWithNumberUnderscoreId.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b'
PostWithNumberUnderscoreId.updateOrCreate post, (err, p) ->
should.not.exist(err)
p._id.should.be.equal(post._id)
PostWithNumberUnderscoreId.findById post._id, (err, p) ->
should.not.exist(err)
p._id.should.be.eql(post._id)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
PostWithNumberUnderscoreId.find {where: {title: 'b'}}, (err, posts) ->
should.not.exist(err)
p = posts[0]
p._id.should.be.eql(post._id)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
posts.should.have.lengthOf(1)
done()
it 'all should return object (with `_id` as defined id) with an _id instanceof String', (done) ->
post = new PostWithNumberUnderscoreId({title: 'a', content: 'AAA'})
post.save (err, post) ->
PostWithNumberUnderscoreId.all {where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', 'AAA')
post._id.should.be.an.instanceOf(Number)
done()
it 'all return should honor filter.fields, with `_id` as defined id', (done) ->
post = new PostWithNumberUnderscoreId {title: 'a', content: 'AAA'}
post.save (err, post) ->
PostWithNumberUnderscoreId.all {fields: ['title'], where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', undefined)
should.not.exist(post._id)
done()
it 'should allow to find post by id string if `_key` is defined id', (done) ->
PostWithStringKey.create (err, post) ->
PostWithStringKey.find {where: {_key: post._key.toString()}}, (err, p) ->
should.not.exist(err)
post = p[0]
should.exist(post)
post._key.should.be.an.instanceOf(String);
done()
it 'find with `_key` as defined id should return an object with _key instanceof String', (done) ->
PostWithStringKey.create (err, post) ->
PostWithStringKey.findById post._key, (err, post) ->
should.not.exist(err)
post._key.should.be.an.instanceOf(String)
done()
it 'should update the instance with `_key` as defined id', (done) ->
PostWithStringKey.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b'
PostWithStringKey.updateOrCreate post, (err, p) ->
should.not.exist(err)
p._key.should.be.equal(post._key)
PostWithStringKey.findById post._key, (err, p) ->
should.not.exist(err)
p._key.should.be.eql(post._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
PostWithStringKey.find {where: {title: 'b'}}, (err, posts) ->
should.not.exist(err)
p = posts[0]
p._key.should.be.eql(post._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
posts.should.have.lengthOf(1)
done()
it 'all should return object (with `_key` as defined id) with an _key instanceof String', (done) ->
post = new PostWithStringKey({title: 'a', content: 'AAA'})
post.save (err, post) ->
PostWithStringKey.all {where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', 'AAA')
post._key.should.be.an.instanceOf(String)
done()
it 'all return should honor filter.fields, with `_key` as defined id', (done) ->
post = new PostWithStringKey {title: 'a', content: 'AAA'}
post.save (err, post) ->
PostWithStringKey.all {fields: ['title'], where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', undefined)
should.not.exist(post._key)
done()
it 'should have created simple User models', (done) ->
User.create {age: 3, content: 'test'}, (err, user) ->
should.not.exist(err)
user.age.should.be.equal(3)
user.content.should.be.equal('test')
user.id.should.not.be.null
should.not.exists user._key
done()
it 'should support Buffer type', (done) ->
User.create {name: '<NAME>', icon: new Buffer('1a2')}, (err, u) ->
User.findById u.id, (err, user) ->
should.not.exist(err)
user.icon.should.be.an.instanceOf(Buffer)
done()
it 'hasMany should support additional conditions', (done) ->
User.create {}, (e, u) ->
u.posts.create (e, p) ->
u.posts {where: {id: p.id}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
done()
it 'create should return id field but not arangodb _key', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
should.not.exist(err)
should.exist(post.id)
should.not.exist(post._key)
should.not.exist(post._id)
done()
it 'should allow to find by id string', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
Post.findById post.id.toString(), (err, p) ->
should.not.exist(err)
should.exist(p)
done()
it 'should allow to find by id using where', (done) ->
Post.create {title: 'Post1', content: 'Post1 content'}, (err, p1) ->
Post.create {title: 'Post2', content: 'Post2 content'}, (err, p2) ->
Post.find {where: {id: p1.id}}, (err, p) ->
should.not.exist(err)
should.exist(p && p[0])
p.length.should.be.equal(1)
#Not strict equal
p[0].id.should.be.eql(p1.id)
done()
it 'should allow to find by id using where inq', (done) ->
Post.create {title: 'Post1', content: 'Post1 content'}, (err, p1) ->
Post.create {title: 'Post2', content: 'Post2 content'}, (err, p2) ->
Post.find {where: {id: {inq: [p1.id]}}}, (err, p) ->
should.not.exist(err)
should.exist(p && p[0])
p.length.should.be.equal(1)
#Not strict equal
p[0].id.should.be.eql(p1.id)
done()
it 'inq operator respect type of field', (done) ->
User.create [
{age: 3, name: 'user0'},
{age: 2, name: 'user1'},
{age: 4, name: 'user3'}],
(err, users) ->
should.not.exist(err)
users.should.be.instanceof(Array).and.have.lengthOf(3);
User.find {where: {or:
[
{age: {inq: [3]}},
{name: {inq: ['user3']}}
]
}}, (err, founds) ->
should.not.exist(err)
should.exist(founds)
founds.should.be.instanceof(Array).and.have.lengthOf(2);
founds.should.containDeep({id: users[0], id: users[3]})
done()
it 'should invoke hooks', (done) ->
events = []
connector = Post.getDataSource().connector
connector.observe 'before execute', (ctx, next) ->
ctx.req.command.should.be.string;
ctx.req.params.should.be.array;
events.push('before execute ' + ctx.req.command);
next()
connector.observe 'after execute', (ctx, next) ->
ctx.res.should.be.object;
events.push('after execute ' + ctx.req.command);
next()
Post.create {title: 'Post1', content: 'Post1 content'}, (err, p1) ->
Post.find (err, results) ->
events.should.eql(['before execute save', 'after execute save',
'before execute document', 'after execute document'])
connector.clearObservers 'before execute'
connector.clearObservers 'after execute'
done(err, results)
it 'should allow to find by number id using where', (done) ->
PostWithNumberId.create {id: 1, title: 'Post1', content: 'Post1 content'}, (err, p1) ->
PostWithNumberId.create {id: 2, title: 'Post2', content: 'Post2 content'}, (err, p2) ->
PostWithNumberId.find {where: {id: p1.id}}, (err, p) ->
should.not.exist(err)
should.exist(p && p[0])
p.length.should.be.equal(1)
p[0].id.should.be.eql(p1.id)
done()
it 'should allow to find by number id using where inq', (done) ->
PostWithNumberId.create {id: 1, title: 'Post1', content: 'Post1 content'}, (err, p1) ->
return done err if err
PostWithNumberId.create {id: 2, title: 'Post2', content: 'Post2 content'}, (err, p2) ->
return done err if err
filter = {where: {id: {inq: [1]}}}
PostWithNumberId.find filter, (err, p) ->
return done err if err
p.length.should.be.equal(1)
p[0].id.should.be.eql(p1.id)
PostWithNumberId.find {where: {id: {inq: [1, 2]}}}, (err, p) ->
return done err if err
p.length.should.be.equal(2)
p[0].id.should.be.eql(p1.id)
p[1].id.should.be.eql(p2.id)
PostWithNumberId.find {where: {id: {inq: [0]}}}, (err, p) ->
return done err if err
p.length.should.be.equal(0)
done()
it 'save should not return arangodb _key and _rev', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
post.content = 'AAA'
post.save (err, p) ->
should.not.exist(err)
should.not.exist(p._key)
should.not.exist(p._rev)
p.id.should.be.equal(post.id)
p.content.should.be.equal('AAA')
done()
it 'find should return an object with an id, which is instanceof String, but not arangodb _key', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
Post.findById post.id, (err, post) ->
should.not.exist(err)
post.id.should.be.an.instanceOf(String)
should.not.exist(post._key)
done()
it 'should update attribute of the specific instance', (done) ->
User.create {name: '<NAME>', age: 31, email:'al@'}, (err, createdusers) ->
createdusers.updateAttributes {age: 32, email:'<EMAIL>'}, (err, updated) ->
should.not.exist(err)
updated.age.should.be.equal(32)
updated.email.should.be.equal('<EMAIL>')
done()
# MEMO: Import data present into data/users/names_100000.json before running this test.
it.skip 'cursor should returns all documents more then max single default size (1000) ', (done) ->
# Increase timeout only for this test
this.timeout(20000);
Name.find (err, names) ->
should.not.exist(err)
names.length.should.be.equal(100000)
done()
it.skip 'cursor should returns all documents more then max single default cursor size (1000) and respect limit filter ', (done) ->
# Increase timeout only for this test
this.timeout(20000);
Name.find {limit: 1002}, (err, names) ->
should.not.exist(err)
names.length.should.be.equal(1002)
done()
describe 'updateAll', () ->
it 'should update the instance matching criteria', (done) ->
User.create {name: '<NAME>', age: 31, email:'<EMAIL>'}, (err, createdusers) ->
User.create {name: '<NAME>', age: 32, email:'<EMAIL>'}, (err, createdusers) ->
User.create {name: '<NAME>', age: 31, email:'<EMAIL>'}, (err, createdusers) ->
User.updateAll {age:31},{company:'strongloop.com'}, (err, updatedusers) ->
should.not.exist(err)
updatedusers.should.have.property('count', 2);
User.find {where:{age:31}}, (err2, foundusers) ->
should.not.exist(err2)
foundusers[0].company.should.be.equal('strongloop.com')
foundusers[1].company.should.be.equal('strongloop.com')
done()
it 'updateOrCreate should update the instance', (done) ->
Post.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b'
Post.updateOrCreate post, (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
done()
it 'updateOrCreate should update the instance without removing existing properties', (done) ->
Post.create {title: 'a', content: 'AAA', comments: ['Comment1']}, (err, post) ->
post = post.toObject()
delete post.title
delete post.comments;
Post.updateOrCreate post, (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('a')
p.comments[0].should.be.equal('Comment1')
done()
it 'updateOrCreate should create a new instance if it does not exist', (done) ->
post = {id: '123', title: 'a', content: 'AAA'};
Post.updateOrCreate post, (err, p) ->
should.not.exist(err)
p.title.should.be.equal(post.title)
p.content.should.be.equal(post.content)
p.id.should.be.eql(post.id)
Post.findById p.id, (err, p) ->
p.id.should.be.equal(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal(post.title)
p.id.should.be.equal(post.id)
done()
it 'save should update the instance with the same id', (done) ->
Post.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b';
post.save (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
done()
it 'save should update the instance without removing existing properties', (done) ->
Post.create {title: 'a', content: 'AAA'}, (err, post) ->
delete post.title
post.save (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('a')
done()
it 'save should create a new instance if it does not exist', (done) ->
post = new Post {title: 'a', content: 'AAA'}
post.save post, (err, p) ->
should.not.exist(err)
p.title.should.be.equal(post.title);
p.content.should.be.equal(post.content);
p.id.should.be.equal(post.id)
Post.findById p.id, (err, p) ->
p.id.should.be.equal(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal(post.title)
p.id.should.be.equal(post.id)
done()
it 'all should return object with an id, which is instanceof String, but not arangodb _key', (done) ->
post = new Post {title: 'a', content: 'AAA'}
post.save (err, post) ->
Post.all {where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', 'AAA')
post.id.should.be.an.instanceOf(String)
should.not.exist(post._key)
done()
it 'all return should honor filter.fields', (done) ->
post = new Post {title: 'b', content: 'BBB'}
post.save (err, post) ->
Post.all {fields: ['title'], where: {content: 'BBB'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'b')
post.should.have.property('content', undefined)
should.not.exist(post._key)
should.not.exist(post.id)
done()
it 'find should order by id if the order is not set for the query filter', (done) ->
PostWithStringId.create {id: '2', title: 'c', content: 'CCC'}, (err, post) ->
PostWithStringId.create {id: '1', title: 'd', content: 'DDD'}, (err, post) ->
PostWithStringId.find (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(2)
posts[0].id.should.be.equal('1')
PostWithStringId.find {limit: 1, offset: 0}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('1')
PostWithStringId.find {limit: 1, offset: 1}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('2')
done()
it 'order by specific query filter', (done) ->
PostWithStringId.create {id: '2', title: 'c', content: 'CCC'}, (err, post) ->
PostWithStringId.create {id: '1', title: 'd', content: 'DDD'}, (err, post) ->
PostWithStringId.create {id: '3', title: 'd', content: 'AAA'}, (err, post) ->
PostWithStringId.find {order: ['title DESC', 'content ASC']}, (err, posts) ->
posts.length.should.be.equal(3)
posts[0].id.should.be.equal('3')
PostWithStringId.find {order: ['title DESC', 'content ASC'], limit: 1, offset: 0}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('3')
PostWithStringId.find {order: ['title DESC', 'content ASC'], limit: 1, offset: 1}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('2')
PostWithStringId.find {order: ['title DESC', 'content ASC'], limit: 1, offset: 2}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('1')
done()
it 'should report error on duplicate keys', (done) ->
Post.create {title: 'd', content: 'DDD'}, (err, post) ->
Post.create {id: post.id, title: 'd', content: 'DDD'}, (err, post) ->
should.exist(err)
done()
it 'should allow to find using like', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {like: 'M%st'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should allow to find using case insensitive like', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {like: 'm%st', options: 'i'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should allow to find using case insensitive like', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {content: {like: 'HELLO', options: 'i'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support like for no match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {like: 'M%XY'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should allow to find using nlike', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {nlike: 'M%st'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should allow to find using case insensitive nlike', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {nlike: 'm%st', options: 'i'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should support nlike for no match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {nlike: 'M%XY'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support "and" operator that is satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {and: [{title: 'My Post'}, {content: 'Hello'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support "and" operator that is not satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {and: [{title: 'My Post'}, {content: 'Hello1'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should support "or" that is satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {or: [{title: 'My Post'}, {content: 'Hello1'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support "or" operator that is not satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {or: [{title: 'My Post1'}, {content: 'Hello1'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
# TODO: Add support to "nor"
# it 'should support "nor" operator that is satisfied', (done) ->
#
# Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
# Post.find {where: {nor: [{title: 'My Post1'}, {content: 'Hello1'}]}}, (err, posts) ->
# should.not.exist(err)
# posts.should.have.property('length', 1)
#
# done()
#
# it 'should support "nor" operator that is not satisfied', (done) ->
#
# Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
# Post.find {where: {nor: [{title: 'My Post'}, {content: 'Hello1'}]}}, (err, posts) ->
# should.not.exist(err)
# posts.should.have.property('length', 0)
#
# done()
it 'should support neq for match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {neq: 'XY'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support neq for no match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {neq: 'My Post'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
# The where object should be parsed by the connector
it 'should support where for count', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.count {and: [{title: 'My Post'}, {content: 'Hello'}]}, (err, count) ->
should.not.exist(err)
count.should.be.equal(1)
Post.count {and: [{title: 'My Post1'}, {content: 'Hello'}]}, (err, count) ->
should.not.exist(err)
count.should.be.equal(0)
done()
# The where object should be parsed by the connector
it 'should support where for destroyAll', (done) ->
Post.create {title: 'My Post1', content: 'Hello'}, (err, post) ->
Post.create {title: 'My Post2', content: 'Hello'}, (err, post) ->
Post.destroyAll {and: [
{title: 'My Post1'},
{content: 'Hello'}
]}, (err) ->
should.not.exist(err)
Post.count (err, count) ->
should.not.exist(err)
count.should.be.equal(1)
done()
# context 'regexp operator', () ->
# before () ->
# deleteExistingTestFixtures (done) ->
# Post.destroyAll(done)
#
# beforeEach () ->
# createTestFixtures (done) ->
# Post.create [
# {title: 'a', content: 'AAA'},
# {title: 'b', content: 'BBB'}
# ], done
#
# after () ->
# deleteTestFixtures (done) ->
# Post.destroyAll(done);
#
# context 'with regex strings', () ->
# context 'using no flags', () ->
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: '^A'}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# context 'using flags', () ->
# beforeEach () ->
# addSpy () ->
# sinon.stub(console, 'warn');
#
# afterEach () ->
# removeSpy ->
# console.warn.restore();
#
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: '^a/i'}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# it 'should print a warning when the global flag is set', (done) ->
# Post.find {where: {content: {regexp: '^a/g'}}}, (err, posts) ->
# console.warn.calledOnce.should.be.ok
# done()
#
# context 'with regex literals', () ->
# context 'using no flags', () ->
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: /^A/}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
#
# context 'using flags', () ->
# beforeEach () ->
# addSpy () ->
# sinon.stub(console, 'warn')
#
# afterEach () ->
# removeSpy () ->
# console.warn.restore()
#
#
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: /^a/i}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# it 'should print a warning when the global flag is set', (done) ->
# Post.find {where: {content: {regexp: /^a/g}}}, (err, posts) ->
# console.warn.calledOnce.should.be.ok
# done()
#
# context 'with regex object', () ->
# context 'using no flags', () ->
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: new RegExp(/^A/)}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
#
# context 'using flags', () ->
# beforeEach () ->
# addSpy () ->
# sinon.stub(console, 'warn')
#
# afterEach () ->
# removeSpy () ->
# console.warn.restore()
#
#
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: new RegExp(/^a/i)}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# it 'should print a warning when the global flag is set', (done) ->
# Post.find {where: {content: {regexp: new RegExp(/^a/g)}}}, (err, posts) ->
# should.not.exist(err)
# console.warn.calledOnce.should.be.ok;
# done()
after (done) ->
User.destroyAll ->
Post.destroyAll ->
PostWithNumberId.destroyAll ->
PostWithStringId.destroyAll ->
PostWithStringKey.destroyAll ->
PostWithNumberUnderscoreId.destroyAll(done)
| true | # This test written in mocha+should.js
should = require('./../init');
describe 'document', () ->
db = null
User = null
Post = null
Product = null
PostWithNumberId = null
PostWithStringId = null
PostWithStringKey = null
PostWithNumberUnderscoreId = null
Name = null
before (done) ->
db = getDataSource()
User = db.define('User', {
name: {type: String, index: true},
email: {type: String, index: true, unique: true},
age: Number,
icon: Buffer
}, {
indexes: {
name_age_index: {
keys: {name: 1, age: -1}
}, # The value contains keys and optinally options
age_index: {age: -1} # The value itself is for keys
}
});
Post = db.define('Post', {
title: {type: String, length: 255, index: true},
content: {type: String},
comments: [String]
},
{forceId: false});
Product = db.define('Product', {
name: {type: String, length: 255, index: true},
description: {type: String},
price: {type: Number},
pricehistory: {type: Object}
});
PostWithStringId = db.define('PostWithStringId', {
id: {type: String, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
PostWithStringKey = db.define('PostWithStringKey', {
_key: {type: String, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
PostWithNumberUnderscoreId = db.define('PostWithNumberUnderscoreId', {
_id: {type: Number, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
PostWithNumberId = db.define('PostWithNumberId', {
id: {type: Number, id: true},
title: { type: String, length: 255, index: true },
content: { type: String }
});
Name = db.define('Name', {}, {});
User.hasMany(Post);
Post.belongsTo(User);
db.automigrate(['User', 'Post', 'Product', 'PostWithStringId', 'PostWithStringKey',
'PostWithNumberUnderscoreId','PostWithNumberId'], done)
beforeEach (done) ->
User.settings.arangodb = {};
User.destroyAll ->
Post.destroyAll ->
PostWithNumberId.destroyAll ->
PostWithNumberUnderscoreId.destroyAll ->
PostWithStringId.destroyAll ->
PostWithStringKey.destroyAll(done)
it 'should handle correctly type Number for id field _id', (done) ->
PostWithNumberUnderscoreId.create {_id: 3, content: 'test'}, (err, person) ->
should.not.exist(err)
person._id.should.be.equal(3)
PostWithNumberUnderscoreId.findById person._id, (err, p) ->
should.not.exist(err)
p.content.should.be.equal('test')
done()
it 'should handle correctly type Number for id field _id using String', (done) ->
PostWithNumberUnderscoreId.create {_id: 4, content: 'test'}, (err, person) ->
should.not.exist(err)
person._id.should.be.equal(4);
PostWithNumberUnderscoreId.findById '4', (err, p) ->
should.not.exist(err)
p.content.should.be.equal('test');
done()
it 'should allow to find post by id string if `_id` is defined id', (done) ->
PostWithNumberUnderscoreId.create (err, post) ->
PostWithNumberUnderscoreId.find {where: {_id: post._id.toString()}}, (err, p) ->
should.not.exist(err)
post = p[0]
should.exist(post)
post._id.should.be.an.instanceOf(Number);
done()
it 'find with `_id` as defined id should return an object with _id instanceof String', (done) ->
PostWithNumberUnderscoreId.create (err, post) ->
PostWithNumberUnderscoreId.findById post._id, (err, post) ->
should.not.exist(err)
post._id.should.be.an.instanceOf(Number)
done()
it 'should update the instance with `_id` as defined id', (done) ->
PostWithNumberUnderscoreId.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b'
PostWithNumberUnderscoreId.updateOrCreate post, (err, p) ->
should.not.exist(err)
p._id.should.be.equal(post._id)
PostWithNumberUnderscoreId.findById post._id, (err, p) ->
should.not.exist(err)
p._id.should.be.eql(post._id)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
PostWithNumberUnderscoreId.find {where: {title: 'b'}}, (err, posts) ->
should.not.exist(err)
p = posts[0]
p._id.should.be.eql(post._id)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
posts.should.have.lengthOf(1)
done()
it 'all should return object (with `_id` as defined id) with an _id instanceof String', (done) ->
post = new PostWithNumberUnderscoreId({title: 'a', content: 'AAA'})
post.save (err, post) ->
PostWithNumberUnderscoreId.all {where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', 'AAA')
post._id.should.be.an.instanceOf(Number)
done()
it 'all return should honor filter.fields, with `_id` as defined id', (done) ->
post = new PostWithNumberUnderscoreId {title: 'a', content: 'AAA'}
post.save (err, post) ->
PostWithNumberUnderscoreId.all {fields: ['title'], where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', undefined)
should.not.exist(post._id)
done()
it 'should allow to find post by id string if `_key` is defined id', (done) ->
PostWithStringKey.create (err, post) ->
PostWithStringKey.find {where: {_key: post._key.toString()}}, (err, p) ->
should.not.exist(err)
post = p[0]
should.exist(post)
post._key.should.be.an.instanceOf(String);
done()
it 'find with `_key` as defined id should return an object with _key instanceof String', (done) ->
PostWithStringKey.create (err, post) ->
PostWithStringKey.findById post._key, (err, post) ->
should.not.exist(err)
post._key.should.be.an.instanceOf(String)
done()
it 'should update the instance with `_key` as defined id', (done) ->
PostWithStringKey.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b'
PostWithStringKey.updateOrCreate post, (err, p) ->
should.not.exist(err)
p._key.should.be.equal(post._key)
PostWithStringKey.findById post._key, (err, p) ->
should.not.exist(err)
p._key.should.be.eql(post._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
PostWithStringKey.find {where: {title: 'b'}}, (err, posts) ->
should.not.exist(err)
p = posts[0]
p._key.should.be.eql(post._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
posts.should.have.lengthOf(1)
done()
it 'all should return object (with `_key` as defined id) with an _key instanceof String', (done) ->
post = new PostWithStringKey({title: 'a', content: 'AAA'})
post.save (err, post) ->
PostWithStringKey.all {where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', 'AAA')
post._key.should.be.an.instanceOf(String)
done()
it 'all return should honor filter.fields, with `_key` as defined id', (done) ->
post = new PostWithStringKey {title: 'a', content: 'AAA'}
post.save (err, post) ->
PostWithStringKey.all {fields: ['title'], where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', undefined)
should.not.exist(post._key)
done()
it 'should have created simple User models', (done) ->
User.create {age: 3, content: 'test'}, (err, user) ->
should.not.exist(err)
user.age.should.be.equal(3)
user.content.should.be.equal('test')
user.id.should.not.be.null
should.not.exists user._key
done()
it 'should support Buffer type', (done) ->
User.create {name: 'PI:NAME:<NAME>END_PI', icon: new Buffer('1a2')}, (err, u) ->
User.findById u.id, (err, user) ->
should.not.exist(err)
user.icon.should.be.an.instanceOf(Buffer)
done()
it 'hasMany should support additional conditions', (done) ->
User.create {}, (e, u) ->
u.posts.create (e, p) ->
u.posts {where: {id: p.id}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
done()
it 'create should return id field but not arangodb _key', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
should.not.exist(err)
should.exist(post.id)
should.not.exist(post._key)
should.not.exist(post._id)
done()
it 'should allow to find by id string', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
Post.findById post.id.toString(), (err, p) ->
should.not.exist(err)
should.exist(p)
done()
it 'should allow to find by id using where', (done) ->
Post.create {title: 'Post1', content: 'Post1 content'}, (err, p1) ->
Post.create {title: 'Post2', content: 'Post2 content'}, (err, p2) ->
Post.find {where: {id: p1.id}}, (err, p) ->
should.not.exist(err)
should.exist(p && p[0])
p.length.should.be.equal(1)
#Not strict equal
p[0].id.should.be.eql(p1.id)
done()
it 'should allow to find by id using where inq', (done) ->
Post.create {title: 'Post1', content: 'Post1 content'}, (err, p1) ->
Post.create {title: 'Post2', content: 'Post2 content'}, (err, p2) ->
Post.find {where: {id: {inq: [p1.id]}}}, (err, p) ->
should.not.exist(err)
should.exist(p && p[0])
p.length.should.be.equal(1)
#Not strict equal
p[0].id.should.be.eql(p1.id)
done()
it 'inq operator respect type of field', (done) ->
User.create [
{age: 3, name: 'user0'},
{age: 2, name: 'user1'},
{age: 4, name: 'user3'}],
(err, users) ->
should.not.exist(err)
users.should.be.instanceof(Array).and.have.lengthOf(3);
User.find {where: {or:
[
{age: {inq: [3]}},
{name: {inq: ['user3']}}
]
}}, (err, founds) ->
should.not.exist(err)
should.exist(founds)
founds.should.be.instanceof(Array).and.have.lengthOf(2);
founds.should.containDeep({id: users[0], id: users[3]})
done()
it 'should invoke hooks', (done) ->
events = []
connector = Post.getDataSource().connector
connector.observe 'before execute', (ctx, next) ->
ctx.req.command.should.be.string;
ctx.req.params.should.be.array;
events.push('before execute ' + ctx.req.command);
next()
connector.observe 'after execute', (ctx, next) ->
ctx.res.should.be.object;
events.push('after execute ' + ctx.req.command);
next()
Post.create {title: 'Post1', content: 'Post1 content'}, (err, p1) ->
Post.find (err, results) ->
events.should.eql(['before execute save', 'after execute save',
'before execute document', 'after execute document'])
connector.clearObservers 'before execute'
connector.clearObservers 'after execute'
done(err, results)
it 'should allow to find by number id using where', (done) ->
PostWithNumberId.create {id: 1, title: 'Post1', content: 'Post1 content'}, (err, p1) ->
PostWithNumberId.create {id: 2, title: 'Post2', content: 'Post2 content'}, (err, p2) ->
PostWithNumberId.find {where: {id: p1.id}}, (err, p) ->
should.not.exist(err)
should.exist(p && p[0])
p.length.should.be.equal(1)
p[0].id.should.be.eql(p1.id)
done()
it 'should allow to find by number id using where inq', (done) ->
PostWithNumberId.create {id: 1, title: 'Post1', content: 'Post1 content'}, (err, p1) ->
return done err if err
PostWithNumberId.create {id: 2, title: 'Post2', content: 'Post2 content'}, (err, p2) ->
return done err if err
filter = {where: {id: {inq: [1]}}}
PostWithNumberId.find filter, (err, p) ->
return done err if err
p.length.should.be.equal(1)
p[0].id.should.be.eql(p1.id)
PostWithNumberId.find {where: {id: {inq: [1, 2]}}}, (err, p) ->
return done err if err
p.length.should.be.equal(2)
p[0].id.should.be.eql(p1.id)
p[1].id.should.be.eql(p2.id)
PostWithNumberId.find {where: {id: {inq: [0]}}}, (err, p) ->
return done err if err
p.length.should.be.equal(0)
done()
it 'save should not return arangodb _key and _rev', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
post.content = 'AAA'
post.save (err, p) ->
should.not.exist(err)
should.not.exist(p._key)
should.not.exist(p._rev)
p.id.should.be.equal(post.id)
p.content.should.be.equal('AAA')
done()
it 'find should return an object with an id, which is instanceof String, but not arangodb _key', (done) ->
Post.create {title: 'Post1', content: 'Post content'}, (err, post) ->
Post.findById post.id, (err, post) ->
should.not.exist(err)
post.id.should.be.an.instanceOf(String)
should.not.exist(post._key)
done()
it 'should update attribute of the specific instance', (done) ->
User.create {name: 'PI:NAME:<NAME>END_PI', age: 31, email:'al@'}, (err, createdusers) ->
createdusers.updateAttributes {age: 32, email:'PI:EMAIL:<EMAIL>END_PI'}, (err, updated) ->
should.not.exist(err)
updated.age.should.be.equal(32)
updated.email.should.be.equal('PI:EMAIL:<EMAIL>END_PI')
done()
# MEMO: Import data present into data/users/names_100000.json before running this test.
it.skip 'cursor should returns all documents more then max single default size (1000) ', (done) ->
# Increase timeout only for this test
this.timeout(20000);
Name.find (err, names) ->
should.not.exist(err)
names.length.should.be.equal(100000)
done()
it.skip 'cursor should returns all documents more then max single default cursor size (1000) and respect limit filter ', (done) ->
# Increase timeout only for this test
this.timeout(20000);
Name.find {limit: 1002}, (err, names) ->
should.not.exist(err)
names.length.should.be.equal(1002)
done()
describe 'updateAll', () ->
it 'should update the instance matching criteria', (done) ->
User.create {name: 'PI:NAME:<NAME>END_PI', age: 31, email:'PI:EMAIL:<EMAIL>END_PI'}, (err, createdusers) ->
User.create {name: 'PI:NAME:<NAME>END_PI', age: 32, email:'PI:EMAIL:<EMAIL>END_PI'}, (err, createdusers) ->
User.create {name: 'PI:NAME:<NAME>END_PI', age: 31, email:'PI:EMAIL:<EMAIL>END_PI'}, (err, createdusers) ->
User.updateAll {age:31},{company:'strongloop.com'}, (err, updatedusers) ->
should.not.exist(err)
updatedusers.should.have.property('count', 2);
User.find {where:{age:31}}, (err2, foundusers) ->
should.not.exist(err2)
foundusers[0].company.should.be.equal('strongloop.com')
foundusers[1].company.should.be.equal('strongloop.com')
done()
it 'updateOrCreate should update the instance', (done) ->
Post.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b'
Post.updateOrCreate post, (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
done()
it 'updateOrCreate should update the instance without removing existing properties', (done) ->
Post.create {title: 'a', content: 'AAA', comments: ['Comment1']}, (err, post) ->
post = post.toObject()
delete post.title
delete post.comments;
Post.updateOrCreate post, (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('a')
p.comments[0].should.be.equal('Comment1')
done()
it 'updateOrCreate should create a new instance if it does not exist', (done) ->
post = {id: '123', title: 'a', content: 'AAA'};
Post.updateOrCreate post, (err, p) ->
should.not.exist(err)
p.title.should.be.equal(post.title)
p.content.should.be.equal(post.content)
p.id.should.be.eql(post.id)
Post.findById p.id, (err, p) ->
p.id.should.be.equal(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal(post.title)
p.id.should.be.equal(post.id)
done()
it 'save should update the instance with the same id', (done) ->
Post.create {title: 'a', content: 'AAA'}, (err, post) ->
post.title = 'b';
post.save (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('b')
done()
it 'save should update the instance without removing existing properties', (done) ->
Post.create {title: 'a', content: 'AAA'}, (err, post) ->
delete post.title
post.save (err, p) ->
should.not.exist(err)
p.id.should.be.equal(post.id)
p.content.should.be.equal(post.content)
should.not.exist(p._key)
Post.findById post.id, (err, p) ->
p.id.should.be.eql(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal('a')
done()
it 'save should create a new instance if it does not exist', (done) ->
post = new Post {title: 'a', content: 'AAA'}
post.save post, (err, p) ->
should.not.exist(err)
p.title.should.be.equal(post.title);
p.content.should.be.equal(post.content);
p.id.should.be.equal(post.id)
Post.findById p.id, (err, p) ->
p.id.should.be.equal(post.id)
should.not.exist(p._key)
p.content.should.be.equal(post.content)
p.title.should.be.equal(post.title)
p.id.should.be.equal(post.id)
done()
it 'all should return object with an id, which is instanceof String, but not arangodb _key', (done) ->
post = new Post {title: 'a', content: 'AAA'}
post.save (err, post) ->
Post.all {where: {title: 'a'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'a')
post.should.have.property('content', 'AAA')
post.id.should.be.an.instanceOf(String)
should.not.exist(post._key)
done()
it 'all return should honor filter.fields', (done) ->
post = new Post {title: 'b', content: 'BBB'}
post.save (err, post) ->
Post.all {fields: ['title'], where: {content: 'BBB'}}, (err, posts) ->
should.not.exist(err)
posts.should.have.lengthOf(1)
post = posts[0]
post.should.have.property('title', 'b')
post.should.have.property('content', undefined)
should.not.exist(post._key)
should.not.exist(post.id)
done()
it 'find should order by id if the order is not set for the query filter', (done) ->
PostWithStringId.create {id: '2', title: 'c', content: 'CCC'}, (err, post) ->
PostWithStringId.create {id: '1', title: 'd', content: 'DDD'}, (err, post) ->
PostWithStringId.find (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(2)
posts[0].id.should.be.equal('1')
PostWithStringId.find {limit: 1, offset: 0}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('1')
PostWithStringId.find {limit: 1, offset: 1}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('2')
done()
it 'order by specific query filter', (done) ->
PostWithStringId.create {id: '2', title: 'c', content: 'CCC'}, (err, post) ->
PostWithStringId.create {id: '1', title: 'd', content: 'DDD'}, (err, post) ->
PostWithStringId.create {id: '3', title: 'd', content: 'AAA'}, (err, post) ->
PostWithStringId.find {order: ['title DESC', 'content ASC']}, (err, posts) ->
posts.length.should.be.equal(3)
posts[0].id.should.be.equal('3')
PostWithStringId.find {order: ['title DESC', 'content ASC'], limit: 1, offset: 0}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('3')
PostWithStringId.find {order: ['title DESC', 'content ASC'], limit: 1, offset: 1}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('2')
PostWithStringId.find {order: ['title DESC', 'content ASC'], limit: 1, offset: 2}, (err, posts) ->
should.not.exist(err)
posts.length.should.be.equal(1)
posts[0].id.should.be.equal('1')
done()
it 'should report error on duplicate keys', (done) ->
Post.create {title: 'd', content: 'DDD'}, (err, post) ->
Post.create {id: post.id, title: 'd', content: 'DDD'}, (err, post) ->
should.exist(err)
done()
it 'should allow to find using like', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {like: 'M%st'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should allow to find using case insensitive like', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {like: 'm%st', options: 'i'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should allow to find using case insensitive like', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {content: {like: 'HELLO', options: 'i'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support like for no match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {like: 'M%XY'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should allow to find using nlike', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {nlike: 'M%st'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should allow to find using case insensitive nlike', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {nlike: 'm%st', options: 'i'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should support nlike for no match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {nlike: 'M%XY'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support "and" operator that is satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {and: [{title: 'My Post'}, {content: 'Hello'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support "and" operator that is not satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {and: [{title: 'My Post'}, {content: 'Hello1'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
it 'should support "or" that is satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {or: [{title: 'My Post'}, {content: 'Hello1'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support "or" operator that is not satisfied', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {or: [{title: 'My Post1'}, {content: 'Hello1'}]}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
# TODO: Add support to "nor"
# it 'should support "nor" operator that is satisfied', (done) ->
#
# Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
# Post.find {where: {nor: [{title: 'My Post1'}, {content: 'Hello1'}]}}, (err, posts) ->
# should.not.exist(err)
# posts.should.have.property('length', 1)
#
# done()
#
# it 'should support "nor" operator that is not satisfied', (done) ->
#
# Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
# Post.find {where: {nor: [{title: 'My Post'}, {content: 'Hello1'}]}}, (err, posts) ->
# should.not.exist(err)
# posts.should.have.property('length', 0)
#
# done()
it 'should support neq for match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {neq: 'XY'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 1)
done()
it 'should support neq for no match', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.find {where: {title: {neq: 'My Post'}}}, (err, posts) ->
should.not.exist(err)
posts.should.have.property('length', 0)
done()
# The where object should be parsed by the connector
it 'should support where for count', (done) ->
Post.create {title: 'My Post', content: 'Hello'}, (err, post) ->
Post.count {and: [{title: 'My Post'}, {content: 'Hello'}]}, (err, count) ->
should.not.exist(err)
count.should.be.equal(1)
Post.count {and: [{title: 'My Post1'}, {content: 'Hello'}]}, (err, count) ->
should.not.exist(err)
count.should.be.equal(0)
done()
# The where object should be parsed by the connector
it 'should support where for destroyAll', (done) ->
Post.create {title: 'My Post1', content: 'Hello'}, (err, post) ->
Post.create {title: 'My Post2', content: 'Hello'}, (err, post) ->
Post.destroyAll {and: [
{title: 'My Post1'},
{content: 'Hello'}
]}, (err) ->
should.not.exist(err)
Post.count (err, count) ->
should.not.exist(err)
count.should.be.equal(1)
done()
# context 'regexp operator', () ->
# before () ->
# deleteExistingTestFixtures (done) ->
# Post.destroyAll(done)
#
# beforeEach () ->
# createTestFixtures (done) ->
# Post.create [
# {title: 'a', content: 'AAA'},
# {title: 'b', content: 'BBB'}
# ], done
#
# after () ->
# deleteTestFixtures (done) ->
# Post.destroyAll(done);
#
# context 'with regex strings', () ->
# context 'using no flags', () ->
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: '^A'}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# context 'using flags', () ->
# beforeEach () ->
# addSpy () ->
# sinon.stub(console, 'warn');
#
# afterEach () ->
# removeSpy ->
# console.warn.restore();
#
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: '^a/i'}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# it 'should print a warning when the global flag is set', (done) ->
# Post.find {where: {content: {regexp: '^a/g'}}}, (err, posts) ->
# console.warn.calledOnce.should.be.ok
# done()
#
# context 'with regex literals', () ->
# context 'using no flags', () ->
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: /^A/}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
#
# context 'using flags', () ->
# beforeEach () ->
# addSpy () ->
# sinon.stub(console, 'warn')
#
# afterEach () ->
# removeSpy () ->
# console.warn.restore()
#
#
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: /^a/i}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# it 'should print a warning when the global flag is set', (done) ->
# Post.find {where: {content: {regexp: /^a/g}}}, (err, posts) ->
# console.warn.calledOnce.should.be.ok
# done()
#
# context 'with regex object', () ->
# context 'using no flags', () ->
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: new RegExp(/^A/)}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
#
# context 'using flags', () ->
# beforeEach () ->
# addSpy () ->
# sinon.stub(console, 'warn')
#
# afterEach () ->
# removeSpy () ->
# console.warn.restore()
#
#
# it 'should work', (done) ->
# Post.find {where: {content: {regexp: new RegExp(/^a/i)}}}, (err, posts) ->
# should.not.exist(err)
# posts.length.should.equal(1)
# posts[0].content.should.equal('AAA')
# done()
#
# it 'should print a warning when the global flag is set', (done) ->
# Post.find {where: {content: {regexp: new RegExp(/^a/g)}}}, (err, posts) ->
# should.not.exist(err)
# console.warn.calledOnce.should.be.ok;
# done()
after (done) ->
User.destroyAll ->
Post.destroyAll ->
PostWithNumberId.destroyAll ->
PostWithStringId.destroyAll ->
PostWithStringKey.destroyAll ->
PostWithNumberUnderscoreId.destroyAll(done)
|
[
{
"context": " true\n\n getCookie = (name) ->\n key = namr + '='\n ca = document.cookie.split(';') ;\n\n",
"end": 813,
"score": 0.9388506412506104,
"start": 809,
"tag": "KEY",
"value": "namr"
}
] | app/coffeescript/common.coffee | joeybloggs/koa-testbed | 1 | define "common", [], () ->
initialize = () ->
true
hasClass = (el, className) ->
return new RegExp('(\\s|^)' + className + '(\\s|$)').test(el.className) ;
addClass = (elem, className) ->
elem.className = (elem.className + ' ' + className).trim() if not hasClass elem, className
addClasses = (el, array) ->
addClass el, ael for ael in array
true
removeClass = (elem, className) ->
newClass = ' ' + elem.className.replace(/[\t\r\n]/g, ' ') + ' ';
if hasClass elem, className
while newClass.indexOf(' ' + className + ' ') >= 0
newClass = newClass.replace(' ' + className + ' ', ' ')
elem.className = newClass.replace(/^\s+|\s+$/g, '') ;
true
getCookie = (name) ->
key = namr + '='
ca = document.cookie.split(';') ;
for c in ca
if c.indexOf(key) == 0
res = c.substring(key.length, c.length) ;
return res;
true
createElement = (tag, opt) ->
el = document.createElement(tag)
if( opt )
el.className = opt.cName if opt.cName
el.innerHTML = opt.inner if opt.inner
el.disabled = true if opt.disabled
opt.appendTo.appendChild(el) if opt.appendTo
el;
transitionEndEventName = () ->
el = document.createElement 'div'
transitions = {
'transition':'transitionend',
'WebkitTransition':'webkitTransitionEnd',
'OTransition':'otransitionend',
'MozTransition':'transitionend',
'MsTransition':'mstransitionend'
}
for t of transitions
if transitions.hasOwnProperty(t) && el.style[t] != undefined
return transitions[t]
return null
animationEndEventName = () ->
el = document.createElement 'div'
animations = {
'animation' : 'animationend',
'WebkitAnimation' : 'webkitAnimationEnd',
'MozAnimation':'animationend',
'OAnimation' : 'oAnimationEnd',
'msAnimation' : 'MSAnimationEnd',
}
for a of animations
if animations.hasOwnProperty(a) && el.style[a] != undefined
return animations[a]
return null
evalInnerHtmlJavascript = (elem) ->
# scripts = elem.querySelectorAll('script[type="text/javascript"]')
scripts = elem.querySelectorAll('script')
# don't use getElementsByTagName, it's a live list and if the script is
# removed the length property is updated
# scripts = elem.getElementsByTagName('script')
for script in scripts
code = script.innerHTML
js = document.createElement('script')
if script.src != ''
js.src = script.src
else
js.text = code
script.parentNode.replaceChild js, script
return true
self = {
initialize: initialize,
hasClass: hasClass,
addClass: addClass,
addClasses: addClasses,
removeClass: removeClass,
getCookie: getCookie,
createElement: createElement,
transitionEndEventName: transitionEndEventName,
animationEndEventName: animationEndEventName,
evalInnerHtmlJavascript: evalInnerHtmlJavascript
} ;
| 197445 | define "common", [], () ->
initialize = () ->
true
hasClass = (el, className) ->
return new RegExp('(\\s|^)' + className + '(\\s|$)').test(el.className) ;
addClass = (elem, className) ->
elem.className = (elem.className + ' ' + className).trim() if not hasClass elem, className
addClasses = (el, array) ->
addClass el, ael for ael in array
true
removeClass = (elem, className) ->
newClass = ' ' + elem.className.replace(/[\t\r\n]/g, ' ') + ' ';
if hasClass elem, className
while newClass.indexOf(' ' + className + ' ') >= 0
newClass = newClass.replace(' ' + className + ' ', ' ')
elem.className = newClass.replace(/^\s+|\s+$/g, '') ;
true
getCookie = (name) ->
key = <KEY> + '='
ca = document.cookie.split(';') ;
for c in ca
if c.indexOf(key) == 0
res = c.substring(key.length, c.length) ;
return res;
true
createElement = (tag, opt) ->
el = document.createElement(tag)
if( opt )
el.className = opt.cName if opt.cName
el.innerHTML = opt.inner if opt.inner
el.disabled = true if opt.disabled
opt.appendTo.appendChild(el) if opt.appendTo
el;
transitionEndEventName = () ->
el = document.createElement 'div'
transitions = {
'transition':'transitionend',
'WebkitTransition':'webkitTransitionEnd',
'OTransition':'otransitionend',
'MozTransition':'transitionend',
'MsTransition':'mstransitionend'
}
for t of transitions
if transitions.hasOwnProperty(t) && el.style[t] != undefined
return transitions[t]
return null
animationEndEventName = () ->
el = document.createElement 'div'
animations = {
'animation' : 'animationend',
'WebkitAnimation' : 'webkitAnimationEnd',
'MozAnimation':'animationend',
'OAnimation' : 'oAnimationEnd',
'msAnimation' : 'MSAnimationEnd',
}
for a of animations
if animations.hasOwnProperty(a) && el.style[a] != undefined
return animations[a]
return null
evalInnerHtmlJavascript = (elem) ->
# scripts = elem.querySelectorAll('script[type="text/javascript"]')
scripts = elem.querySelectorAll('script')
# don't use getElementsByTagName, it's a live list and if the script is
# removed the length property is updated
# scripts = elem.getElementsByTagName('script')
for script in scripts
code = script.innerHTML
js = document.createElement('script')
if script.src != ''
js.src = script.src
else
js.text = code
script.parentNode.replaceChild js, script
return true
self = {
initialize: initialize,
hasClass: hasClass,
addClass: addClass,
addClasses: addClasses,
removeClass: removeClass,
getCookie: getCookie,
createElement: createElement,
transitionEndEventName: transitionEndEventName,
animationEndEventName: animationEndEventName,
evalInnerHtmlJavascript: evalInnerHtmlJavascript
} ;
| true | define "common", [], () ->
initialize = () ->
true
hasClass = (el, className) ->
return new RegExp('(\\s|^)' + className + '(\\s|$)').test(el.className) ;
addClass = (elem, className) ->
elem.className = (elem.className + ' ' + className).trim() if not hasClass elem, className
addClasses = (el, array) ->
addClass el, ael for ael in array
true
removeClass = (elem, className) ->
newClass = ' ' + elem.className.replace(/[\t\r\n]/g, ' ') + ' ';
if hasClass elem, className
while newClass.indexOf(' ' + className + ' ') >= 0
newClass = newClass.replace(' ' + className + ' ', ' ')
elem.className = newClass.replace(/^\s+|\s+$/g, '') ;
true
getCookie = (name) ->
key = PI:KEY:<KEY>END_PI + '='
ca = document.cookie.split(';') ;
for c in ca
if c.indexOf(key) == 0
res = c.substring(key.length, c.length) ;
return res;
true
createElement = (tag, opt) ->
el = document.createElement(tag)
if( opt )
el.className = opt.cName if opt.cName
el.innerHTML = opt.inner if opt.inner
el.disabled = true if opt.disabled
opt.appendTo.appendChild(el) if opt.appendTo
el;
transitionEndEventName = () ->
el = document.createElement 'div'
transitions = {
'transition':'transitionend',
'WebkitTransition':'webkitTransitionEnd',
'OTransition':'otransitionend',
'MozTransition':'transitionend',
'MsTransition':'mstransitionend'
}
for t of transitions
if transitions.hasOwnProperty(t) && el.style[t] != undefined
return transitions[t]
return null
animationEndEventName = () ->
el = document.createElement 'div'
animations = {
'animation' : 'animationend',
'WebkitAnimation' : 'webkitAnimationEnd',
'MozAnimation':'animationend',
'OAnimation' : 'oAnimationEnd',
'msAnimation' : 'MSAnimationEnd',
}
for a of animations
if animations.hasOwnProperty(a) && el.style[a] != undefined
return animations[a]
return null
evalInnerHtmlJavascript = (elem) ->
# scripts = elem.querySelectorAll('script[type="text/javascript"]')
scripts = elem.querySelectorAll('script')
# don't use getElementsByTagName, it's a live list and if the script is
# removed the length property is updated
# scripts = elem.getElementsByTagName('script')
for script in scripts
code = script.innerHTML
js = document.createElement('script')
if script.src != ''
js.src = script.src
else
js.text = code
script.parentNode.replaceChild js, script
return true
self = {
initialize: initialize,
hasClass: hasClass,
addClass: addClass,
addClasses: addClasses,
removeClass: removeClass,
getCookie: getCookie,
createElement: createElement,
transitionEndEventName: transitionEndEventName,
animationEndEventName: animationEndEventName,
evalInnerHtmlJavascript: evalInnerHtmlJavascript
} ;
|
[
{
"context": "onal final delimiter*\n #\n # E.g., `smart_join([\"Tom\",\"Dick\",\"Harry\"],\", \",\" and \")` yields `Tom, Dick",
"end": 9696,
"score": 0.9998480677604675,
"start": 9693,
"tag": "NAME",
"value": "Tom"
},
{
"context": "inal delimiter*\n #\n # E.g., `smart_join([\"Tom\",\"Dick\",\"Harry\"],\", \",\" and \")` yields `Tom, Dick and Ha",
"end": 9703,
"score": 0.9997716546058655,
"start": 9699,
"tag": "NAME",
"value": "Dick"
},
{
"context": "limiter*\n #\n # E.g., `smart_join([\"Tom\",\"Dick\",\"Harry\"],\", \",\" and \")` yields `Tom, Dick and Harry`.\n ",
"end": 9711,
"score": 0.9997003078460693,
"start": 9706,
"tag": "NAME",
"value": "Harry"
},
{
"context": "oin([\"Tom\",\"Dick\",\"Harry\"],\", \",\" and \")` yields `Tom, Dick and Harry`.\n #\n # Alternatively, the `del",
"end": 9740,
"score": 0.9997970461845398,
"start": 9737,
"tag": "NAME",
"value": "Tom"
},
{
"context": "[\"Tom\",\"Dick\",\"Harry\"],\", \",\" and \")` yields `Tom, Dick and Harry`.\n #\n # Alternatively, the `delimiter",
"end": 9746,
"score": 0.9973475933074951,
"start": 9742,
"tag": "NAME",
"value": "Dick"
},
{
"context": "ick\",\"Harry\"],\", \",\" and \")` yields `Tom, Dick and Harry`.\n #\n # Alternatively, the `delimiter` paramete",
"end": 9756,
"score": 0.9995921850204468,
"start": 9751,
"tag": "NAME",
"value": "Harry"
},
{
"context": "pepper\n salt = password.salt\n password = password.password\n # set defaults\n hash_type ?= 'sha512'\n ",
"end": 29247,
"score": 0.9989526867866516,
"start": 29230,
"tag": "PASSWORD",
"value": "password.password"
}
] | lib/util.coffee | intellinote/inote-util | 1 | fs = require 'fs'
path = require 'path'
HOMEDIR = path.join(__dirname,'..')
LIB_COV = path.join(HOMEDIR,'lib-cov')
LIB_DIR = if fs.existsSync(LIB_COV) then LIB_COV else path.join(HOMEDIR,'lib')
ObjectUtil = require(path.join(LIB_DIR,'object-util')).ObjectUtil
StringUtil = require(path.join(LIB_DIR,'string-util')).StringUtil
uuid = require 'uuid'
crypto = require 'crypto'
mkdirp = require 'mkdirp'
request = require 'request'
remove = require 'remove'
seedrandom = require 'seedrandom'
semver = require 'semver'
DEBUG = (/(^|,)inote-?util($|,)/i.test process?.env?.NODE_DEBUG) or (/(^|,)Util($|,)/.test process?.env?.NODE_DEBUG)
################################################################################
class DateUtil
@DAY_OF_WEEK = [
"Sunday"
"Monday"
"Tuesday"
"Wednesday"
"Thursday"
"Friday"
"Saturday"
]
@MONTH = [
"January"
"February"
"March"
"April"
"May"
"June"
"July"
"August"
"September"
"October"
"November"
"December"
]
@format_datetime_long:(dt = new Date())=>
if typeof dt is 'string'
try
dt = new Date(dt)
catch e
return null
return "#{@format_date_long(dt)} at #{@format_time_long(dt)}"
@format_time_long:(dt = new Date())=>
hours = dt.getUTCHours() % 12
if hours is 0
hours = 12
minutes = dt.getUTCMinutes()
if minutes < 10
minutes = "0#{minutes}"
if dt.getUTCHours() > 12
ampm = "PM"
else
ampm = "AM"
return "#{hours}:#{minutes} #{ampm} GMT"
@format_date_long:(dt = new Date())=>
if typeof dt is 'string'
try
dt = new Date(dt)
catch e
return null
return "#{@DAY_OF_WEEK[dt.getUTCDay()]} #{dt.getUTCDate()} #{@MONTH[dt.getUTCMonth()]} #{dt.getUTCFullYear()}"
@to_unit:(value,singular,plural)=>
unless plural?
plural = "#{singular}s"
if value is 1 or value is -1
return "#{value} #{singular}"
else
return "#{value} #{plural}"
@start_time: Date.now()
@duration:(now,start)=>
start ?= @start_time
now ?= Date.now()
if start instanceof Date
start = start.getTime()
if now instanceof Date
now = now.getTime()
#
result = {}
result.begin = start
result.end = now
result.delta = now - start
#
duration = result.delta
result.in_millis = {}
result.in_millis.millis = duration % (1000)
result.in_millis.seconds = duration % (1000 * 60)
result.in_millis.minutes = duration % (1000 * 60 * 60)
result.in_millis.hours = duration % (1000 * 60 * 60 * 24)
result.in_millis.days = duration % (1000 * 60 * 60 * 24 * 7)
result.in_millis.weeks = duration % (1000 * 60 * 60 * 24 * 7 * 52)
result.in_millis.years = duration
#
result.raw = {}
result.raw.millis = result.in_millis.millis
result.raw.seconds = result.in_millis.seconds / (1000)
result.raw.minutes = result.in_millis.minutes / (1000 * 60)
result.raw.hours = result.in_millis.hours / (1000 * 60 * 60)
result.raw.days = result.in_millis.days / (1000 * 60 * 60 * 24)
result.raw.weeks = result.in_millis.weeks / (1000 * 60 * 60 * 24 * 7)
result.raw.years = result.in_millis.years / (1000 * 60 * 60 * 24 * 7 * 52)
#
result.whole = {}
result.whole.millis = Math.floor(result.raw.millis)
result.whole.seconds = Math.floor(result.raw.seconds)
result.whole.minutes = Math.floor(result.raw.minutes)
result.whole.hours = Math.floor(result.raw.hours)
result.whole.days = Math.floor(result.raw.days)
result.whole.weeks = Math.floor(result.raw.weeks)
result.whole.years = Math.floor(result.raw.years)
#
result.array = {}
result.array.full = {}
result.array.full.values = [
result.whole.years
result.whole.weeks
result.whole.days
result.whole.hours
result.whole.minutes
result.whole.seconds
result.whole.millis
]
result.array.full.short = [
"#{result.whole.years}y"
"#{result.whole.weeks}w"
"#{result.whole.days}d"
"#{result.whole.hours}h"
"#{result.whole.minutes}m"
"#{result.whole.seconds}s"
"#{result.whole.millis}m"
]
result.array.full.long = [
@to_unit(result.whole.years,"year")
@to_unit(result.whole.weeks,"week")
@to_unit(result.whole.days,"day")
@to_unit(result.whole.hours,"hour")
@to_unit(result.whole.minutes,"minute")
@to_unit(result.whole.seconds,"second")
@to_unit(result.whole.millis,"millisecond")
]
result.array.full.no_millis = {}
result.array.full.no_millis.values = [].concat(result.array.full.values[0...-1])
result.array.full.no_millis.short = [].concat(result.array.full.short[0...-1])
result.array.full.no_millis.long = [].concat(result.array.full.long[0...-1])
#
values = [].concat(result.array.full.values)
values.shift() while values.length > 0 and values[0] is 0
result.array.brief = {}
result.array.brief.values = values
result.array.brief.short = []
result.array.brief.long = []
result.array.brief.no_millis = {}
result.array.brief.no_millis.values = values[0...-1]
result.array.brief.no_millis.short = []
result.array.brief.no_millis.long = []
values = [].concat(values)
for unit in [ 'millisecond','second','minute','hour','day','week','year' ]
v = values.pop()
if v?
result.array.brief.short.unshift "#{v}#{unit.substring(0,1)}"
result.array.brief.long.unshift @to_unit(v,unit)
unless unit is 'millisecond'
result.array.brief.no_millis.short.unshift "#{v}#{unit.substring(0,1)}"
result.array.brief.no_millis.long.unshift @to_unit(v,unit)
else
break
#
result.array.min = {}
result.array.min.units = []
result.array.min.short = []
result.array.min.long = []
result.array.min.no_millis = {}
result.array.min.no_millis.units = []
result.array.min.no_millis.short = []
result.array.min.no_millis.long = []
for unit, i in [ 'year','week','day','hour','minute','second','millisecond']
v = result.array.full.values[i]
unless v is 0
result.array.min.short.push "#{v}#{unit.substring(0,1)}"
result.array.min.long.push @to_unit(v,unit)
result.array.min.units.push unit
unless unit is 'millisecond'
result.array.min.no_millis.short.push "#{v}#{unit.substring(0,1)}"
result.array.min.no_millis.long.push @to_unit(v,unit)
result.array.min.no_millis.units.push unit
#
result.string = {}
result.string.full = {}
result.string.full.micro = result.array.full.short.join('')
result.string.full.short = result.array.full.short.join(' ')
result.string.full.long = result.array.full.long.join(' ')
result.string.full.verbose = ArrayUtil.smart_join(result.array.full.long, ", ", " and ")
result.string.full.no_millis = {}
result.string.full.no_millis.micro = result.array.full.no_millis.short.join('')
result.string.full.no_millis.short = result.array.full.no_millis.short.join(' ')
result.string.full.no_millis.long = result.array.full.no_millis.long.join(' ')
result.string.full.no_millis.verbose = ArrayUtil.smart_join(result.array.full.no_millis.long, ", ", " and ")
result.string.brief = {}
result.string.brief.micro = result.array.brief.short.join('')
result.string.brief.short = result.array.brief.short.join(' ')
result.string.brief.long = result.array.brief.long.join(' ')
result.string.brief.verbose = ArrayUtil.smart_join(result.array.brief.long, ", ", " and ")
result.string.brief.no_millis = {}
result.string.brief.no_millis.micro = result.array.brief.no_millis.short.join('')
result.string.brief.no_millis.short = result.array.brief.no_millis.short.join(' ')
result.string.brief.no_millis.long = result.array.brief.no_millis.long.join(' ')
result.string.brief.no_millis.verbose = ArrayUtil.smart_join(result.array.brief.no_millis.long, ", ", " and ")
result.string.min = {}
result.string.min.micro = result.array.min.short.join('')
result.string.min.short = result.array.min.short.join(' ')
result.string.min.long = result.array.min.long.join(' ')
result.string.min.verbose = ArrayUtil.smart_join(result.array.min.long, ", ", " and ")
result.string.min.no_millis = {}
result.string.min.no_millis.micro = result.array.min.no_millis.short.join('')
result.string.min.no_millis.short = result.array.min.no_millis.short.join(' ')
result.string.min.no_millis.long = result.array.min.no_millis.long.join(' ')
result.string.min.no_millis.verbose = ArrayUtil.smart_join(result.array.min.no_millis.long, ", ", " and ")
return result
# **iso_8601_regexp** - *returns a regular expression that can be used to validate an iso 8601 format date*
# note that currently only the fully-specified datetime format is supported (not dates without times or durations).
@iso_8601_regexp:()=>/^((\d{4})-(\d{2})-(\d{2}))T((\d{2})\:(\d{2})\:((\d{2})(?:\.(\d{3}))?)((?:[A-Za-z]+)|(?:[+-]\d{2}\:\d{2})))$/
################################################################################
################################################################################
class ArrayUtil
@lpad:StringUtil.lpad
@lpad_array:StringUtil.lpad_array
@rpad:StringUtil.rpad
@rpad_array:StringUtil.rpad_array
# ***smart_join*** - *like `Array.prototype.join` but with an optional final delimiter*
#
# E.g., `smart_join(["Tom","Dick","Harry"],", "," and ")` yields `Tom, Dick and Harry`.
#
# Alternatively, the `delimiter` parameter can be a map of options:
#
# * `before` - appears before the list
# * `first` - appears between the first and second element
# * `last` - appears between the next-to-last and last element
# * `delimiter` - appears between other elements (if any)
# * `after` - appears after the list
#
# E.g., given:
#
# var options = {
# before: "B",
# first: "F",
# delimiter: "D",
# last: "L",
# after: "A"
# }
#
# and
#
# var a = [1,2,3,4,5]
#
# then `smart_join(a,options)` yields `"B1F2D3D4L5A"`.
@smart_join:(array,delimiter,last)=>
unless array?
return null
else
if typeof delimiter is 'object'
options = delimiter
before = options.before
first = options.first
delimiter = options.delimiter
last = options.last
after = options.after
if first? and last?
[head,middle...,tail] = array
else if first? and not last?
[head,middle...] = array
else if last? and not first?
[middle...,tail] = array
else
middle = array
if tail? and middle.length is 0
middle = [tail]
tail = undefined
buffer = []
if before?
buffer.push before
if head?
buffer.push head
if middle?.length > 0
buffer.push first
if middle?
buffer.push middle.join(delimiter)
if tail?
if last?
buffer.push last
buffer.push tail
if after?
buffer.push after
return buffer.join("")
# **trim_trailing_null** - *remove trailing `null` values from an array*
#
# Removes any trailing `null` values from the given array.
# Leading or interspersed `null` values are left alone.
# E.g., given `[null,'foo',null,'bar',null,null]` returns `[null,'foo',null,'bar']`.
@trim_trailing_null: (a)=>
a = [].concat(a)
b = []
while a.length > 0
v = a.pop()
if v?
b.unshift v
else if b.length > 0
b.unshift v
return b
# **right_shift_args** - *convert trailing `null` values to leading `null` values*
#
# Given a list of arguments that might contain trailing `null` values, returns an array
# of the same length, but with leading rather than trailing `null`s.
# E.g,.:
#
# right_shift_args('a',null)
#
# returns:
#
# [ null, 'a' ]
#
# and,
#
# right_shift_args(1,null,2,null,null)
#
# returns:
#
# [ null, null, 1, null, 2 ]
#
# This method can be used to allow the leading arguments to a function to
# be the optional ones. For example, consider the function signature:
#
# function foo(a,b,callback)
#
# Using `right_shift_args` we can make `a` and `b` the optional arguments such that
# `foo(callback)` is equivalent to `foo(null,null,callback)` and `foo('x',callback)`
# is equivalent to `foo(null,'x',callback)`.
#
# In CoffeeScript, this can be achieved with the following idiom:
#
# foo:(a,b,c)->
# [a,b,c] = Util.right_shift_args(a,b,c)
#
# In JavaScript, you'll need to unwind the returned array on your own:
#
# function foo(a,b,c,d) {
# var args = Util.right_shift_args(a,b,c,d);
# a = args[0]; b = args[1]; c = args[2]; d = args[3];
# }
#
@right_shift_args: (values...)=>@lpad(@trim_trailing_null(values),values.length,null)
# **paginate_list** - *extract a sub-array based on offset and limit*
#
# Given a list (array), returns the sublist defined by `offset` and `limit`.
@paginate_list:(list,offset=0,limit=20)=>
offset ?= 0
limit ?= 20
list[offset...(offset+limit)]
# **subset_of** - *check whether on array contains another arrays as if they are sets *
#
# Given two arrays `a` and `b`, returns `true` if every element of
# `a` is also found in `b`.
#
# Note that the arrays are treated as true *sets*. The number of times
# a given entry appears in each array is ignored--only the presence or
# absence of a value is significant. (For example, `[1,1]` is considered
# a subset of `[1]`.)
@subset_of:(a,b)=>
unless a? and Array.isArray(a) and b? and Array.isArray(b)
throw new Error("Expected arrays.")
else
for e in a
unless e in b
return false
return true
# **is_subset_of** - *an alias for `subset_of`*
@is_subset_of:(args...)=>@subset_of(args...)
# **strict_subset_of** - *check whether on array strictly contains another arrays as if they are sets *
#
# Given two arrays `a` and `b`, returns `true` if every element of
# `a` is also found in `b` *and* at least one element of `b` does not
# appear in `a`.
#
# Note that the arrays are treated as true *sets*. The number of times
# a given entry appears in each array is ignored--only the presence or
# absence of a value is significant. (For example, `[1,1]` is considered
# a subset of `[1]`.)
@strict_subset_of:(a,b)=>@subset_of(a,b) and not @subset_of(b,a) # Note: there are probably more efficient ways to do this.
# **is_strict_subset_of** - *an alias for `strict_subset_of`*
@is_strict_subset_of:(args...)=>@strict_subset_of(args...)
# **sets_are_equal** - *compare two arrays as if they were sets*
#
# Given two arrays `a` and `b`, returns `true` if every element of
# `a` is also found in `b` and every element of `b` is also found in `a`.
#
# Note that the arrays are treated as true *sets*. Both the order of
# and number of times a given entry appears in each array is ignored--only
# the presence or absence of a value is significant. (For example, `[1,2]` has
# set equality with `[2,1]` and `[1,2,1]` has set equality with `[2,2,1]`.)
#
# NOTE: currenly only does a shallow comparison
@sets_are_equal:(a,b)=>
unless a? and Array.isArray(a) and b? and Array.isArray(b)
throw new Error("Expected arrays.")
else
for e in a
unless e in b
return false
for e in b
unless e in a
return false
return true
# Returns `true` iff the given arrays contain equal (`===`) elements in the
# exact same order. (Also see `sets_are_equal`).
# Deprecated; use `ObjectUtil.deep_equal` instead
@arrays_are_equal:(a,b)=>
unless a? and Array.isArray(a) and b? and Array.isArray(b)
throw new Error("Expected arrays.")
else
return ObjectUtil.deep_equal(a, b)
# Returns a clone of `array` with duplicate values removed
# When `key` is specified, elements of the array are treated as maps, and the
# specified key field is used to test for equality
@uniquify:(array,key)=>
clone = []
if key?
keys = []
for elt in array
unless elt[key] in keys
clone.push elt
keys.push elt[key]
else
for elt in array
unless elt in clone
clone.push elt
return clone
################################################################################
class NumberUtil
# **round_decimal** - *round a number to the specified precision*
#
# Formats the given `value` as a decimal string with `digits` signficant
# digits to the right of the decimal point.
#
# For example, given `v = 1234.567` then:
#
# - `round_decimal(v,0)` yields `"1235"`
# - `round_decimal(v,1)` yields `"1234.6"`
# - `round_decimal(v,2)` yields `"1234.57"`
# - `round_decimal(v,3)` yields `"1234.567"`
# - `round_decimal(v,4)` yields `"1234.5670"`
# - `round_decimal(v,5)` yields `"1234.56700"`
# - `round_decimal(v,-1)` yields `"1230"`
# - `round_decimal(v,-2)` yields `"1200"`
# - `round_decimal(v,-3)` yields `"1000"`
# - `round_decimal(v,-4)` yields `"0"`
#
# Returns `null` if `value` is not a number and cannot
# be coerced into one. (Note that this method uses a less
# permissive form of coercion that `parseInt` and `parseFloat`.
# The input value must be a decimal string in standard (non-scientific)
# notation.)
@round_decimal:(value,digits=0)=>
digits ?= 0
unless value?
return null
else
unless typeof value is 'number'
if /^\s*-?(([0-9]+(\.[0-9]+))|(\.[0-9]+))\s*$/.test "#{value}"
value = parseFloat(value)
else
return null
if isNaN(value)
return null
else if digits >= 0
return value.toFixed(digits)
else
factor = Math.pow(10,Math.abs(digits))
return "#{(Math.round(value/factor))*factor}"
# **is_int** - *check if the given object is an (optionally signed) simple integer value*
#
# Returns `true` if the given value is (or can be converted to) a
# valid integer (without any rounding). E.g., `is_int(3)` and `is_int("3")`
# yield `true` but `is_int(3.14159)` and `is_int("3.0")` yield `false`.
@is_int:(v)=>
unless v?
return false
else
return /^-?((0)|([1-9][0-9]*))$/.test "#{v}"
# **to_int** - *returns a valid integer or null*
@to_int:(v)=>
if @is_int(v)
v = parseInt(v)
if isNaN(v)
return null
else
return v
else
return null
@is_float:(v)=>
unless v?
return false
else
return /^-?((((0)|([1-9][0-9]*))(\.[0-9]+)?)|(\.[0-9]+))$/.test "#{v}"
@to_float:(v)=>
if @is_float(v)
v = parseFloat(v)
if isNaN(v)
return null
else
return v
else
return null
################################################################################
class ColorUtil
# **hex_to_rgb_triplet** - *convert a hex-based `#rrggbb` string to decimal `[r,g,b]` values*
#
# Given an HTML/CSS-style hex color string, yields an array of the R,G and B values.
# E.g. `hex_to_rgb("#3300FF")` yields `[51,0,255]`.
# The leading `#` character is optional, and both uppercase and lowercase letters
# are supported.
@hex_to_rgb_triplet:(hex)=>
result = /^\s*#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})\s*$/i.exec(hex)
if result?
return [
parseInt(result[1],16)
parseInt(result[2],16)
parseInt(result[3],16)
]
else
return null
# **hex_to_rgb_strng** - *convert a hex-based `#rrggbb` string to a decimal-based `rgb(r,g,b)` string*
#
# Given an HTML/CSS-style hex color string, yields the corresponding `rgb(R,G,B)`
# form. E.g. `hex_to_rgb("#3300FF")` yields `rgb(51,0,255)`.
# The leading `#` character is optional, and both uppercase and lowercase letters
# are supported.
@hex_to_rgb_string:(hex)=>
[r,g,b] = @hex_to_rgb_triplet(hex) ? [null,null,null]
if r? and g? and b?
return "rgb(#{r},#{g},#{b})"
else
return null
# **rgb_string_to_triplet** - *extract the `[r,g,b]` values from an `rgb(r,g,b)` string*
@rgb_string_to_triplet:(rgb)=>
result = /^\s*rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)\s*$/i.exec(rgb)
if result?
r = parseInt(result[1])
g = parseInt(result[2])
b = parseInt(result[3])
return [r,g,b]
else
return null
# **rgb_to_hex** - *convert `r`, `g` and `b` components or an `rgb(r,g,b`) string to a hex-based `#rrggbb` string*
#
# Given an RGB triplet returns the equivalent HTML/CSS-style hex string.
# E.g, `rgb_to_hex(51,0,255)` yields `#3300FF`.
@rgb_to_hex:(r,g,b)=>
if typeof r is 'string' and not g? and not b?
[r,g,b] = @rgb_string_to_triplet(r) ? [null,null,null]
unless r? and g? and b?
return null
else
i2h = (i)->
h = i.toString(16)
return if h.length is 1 then "0#{h}" else h
return "##{i2h(r)}#{i2h(g)}#{i2h(b)}"
################################################################################
class RandomUtil
# **random_bytes** - *generate a string of random bytes*
#
# Generates a string of `count` pseudo-random bytes in the specified encoding.
# (Defaults to `hex`.)
#
# Note that `count` specifies the number of *bytes* to be generated. The encoded
# string may be more or less than `count` *characters*.
@random_bytes:(count=32,enc='hex')=>
count ?= 32
enc ?= 'hex'
if typeof count is 'string'
if typeof enc is 'number'
[count,enc] = [enc,count]
else
enc = count
count = 32
bytes = crypto.randomBytes(count)
if /buffer/i.test enc
return bytes
else
return bytes.toString(enc)
@seed_rng:(seed)->
return new Math.seedrandom(seed)
@set_rng:(rng)=>
@rng = rng ? new Math.seedrandom()
@rng:Math.random
# **random_hex** - *generate a string of `count` pseudo-random characters from the set ``[0-9a-f]``.
@random_hex:(count=32,rng)=>
count ?= 32
@_random_digits(count,16,rng)
# **random_alphanumeric** - *generate a string of `count` pseudo-random characters from the set `[a-z0-9]`.
@random_alphanumeric:(count=32,rng)=>
count ?= 32
@_random_digits(count,36,rng)
# **random_numeric** - *generate a string of `count` pseudo-random characters from the set `[0-9]`.*
@random_numeric:(count=32,rng)=>
count ?= 32
@_random_digits(count,10,rng)
# **random_Alpha** - *generate a string of `count` pseudo-random characters from the set `[a-zA-Z]` (mixed case).
@random_Alpha:(count=32,rng)=>
count ?= 32
@_random_alpha(count,'M',rng)
# **random_ALPHA** - *generate a string of `count` pseudo-random characters from the set `[A-Z]` (upper case).
@random_ALPHA:(count=32,rng)=>
count ?= 32
@_random_alpha(count,'U',rng)
# **random_alpha** - *generate a string of `count` pseudo-random characters from the set `[a-z]` (lower case).
@random_alpha:(count=32,rng)=>
count ?= 32
@_random_alpha(count,'L',rng)
@random_Alphanumeric:(count=32,rng)=>
count ?= 32
@random_string "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", count, rng
@random_string:(alphabet,count,rng)=>
if typeof alphabet is 'function' and not count? and not rng?
rng = alphabet
count = null
alphabet = null
if typeof count is 'function' and not rng?
rng = count
count = null
if typeof alphabet is 'number' and typeof count isnt 'number'
count = alphabet
alphabet = null
alphabet ?= "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
count ?= 32
rng ?= @rng
result = ""
for i in [0...count]
result += alphabet[Math.floor(rng()*alphabet.length)]
return result
# lettercase = 'upper', 'lower', 'both' (or 'mixed')
@_random_alpha:(count=32,lettercase='lower',rng)=>
count ?= 32
lettercase ?= 'lower'
rng ?= @rng
str = ""
include_upper = /^(u|b|m)/i.test lettercase
include_lower = not /^u/i.test lettercase # everything but `UPPER` includes `LOWER`, to avoid both checks being false
while str.length < count
char = Math.floor(rng()*26)
if include_upper and include_lower
if rng() > 0.5
char += 97 # a
else
char += 65 # A
else if include_upper
char += 65 # A
else
char += 97 # a
str += String.fromCharCode(char)
return str
# **random_element** - *selects a random element from the given array (or map)*
# In the case of a map, a random key/value pair will be returned as a two-element array.
@random_element:(collection,rng)=>
unless collection?
return undefined
else
if Array.isArray(collection)
unless collection.length > 0
return undefined
else
rng ?= @rng
index = Math.floor(rng()*collection.length)
return collection[index]
else if collection? and typeof collection is 'object'
key = @random_element(Object.keys(collection),rng)
return [key,collection[key]]
# **_random_digits** - *generate a string of random bytes in the specfied base number system*
# (An internal method that generates `count` characters in the specified base.)
@_random_digits:(args...)=> #count=32,base,rng
ints = []
rng = null
while args.length > 0
a = args.shift()
if typeof a is 'function'
if rng?
throw new Error("Unexpected arguments: #{args}")
else
rng = a
else
if ints.length is 2 and a?
throw new Error("Unexpected arguments: #{args}")
else
ints.push a
[count,base] = ints
count ?= 32
base ?= 10
rng ?= @rng
str = ""
while str.length < count
str += rng().toString(base).substring(2)
if str.length > count
str = str.substring(0,count)
return str
# performs an IN PLACE shuffle of the given array
@shuffle:(list)->
if list? and Array.isArray(list) and list.length > 1
for i in [(list.length-1)..0]
j = Math.floor(Math.random() * (i + 1))
x = list[i]
list[i] = list[j]
list[j] = x
return list
@random_value:(min,max,rng)=>
if typeof max is 'function' and not rng?
rng = max
max = undefined
if typeof min is 'function' and not rng?
rng = min
min = undefined
if typeof min is 'number' and not max?
max = min
min = undefined
min ?= 0
max ?= 1
if max < min
[min, max] = [max, min]
rng ?= @rng ? Math.random
range = max - min
value = min + (rng()*range)
return value
# Assign the given (non-null) identifier to a randomly selected category such that:
# 1. For a given collection of identifiers results will be randomly distributed among the categories.
# 2. For a given identifier the result will be the same every time the method is called.
# The `categories` parameter is optional:
# - when missing, identifiers will be randomly assigned to either `true` or `false`
# - when an value between 0 and 1, identifiers will be assigned to either `true` or `false`, with `true` appearing `100*value` % of the time
# - when an array, identifiers will be assigned to an element of the array with equal probability
@randomly_assign:(id, categories)=>
categories ?= [true, false]
if typeof categories is 'number'
if categories < 0 or categories > 1
throw new Error("Expected a value between 0 and 1 (inlcusive). Found #{categories}.")
else
value = @random_value 0, 1, @seed_rng(id)
return value <= categories
else if Array.isArray(categories)
value = @random_element categories, @seed_rng(id)
else
throw new Error("Expected a number or an array. Found #{typeof categories}: #{categories}")
################################################################################
class PasswordUtil
# Compare the `expected_digest` with the hash computed from the remaining
# parameters.
@validate_hashed_password:(expected_digest,password,salt,pepper,hash_type)=>
[salt,digest] = @hash_password(password,salt,pepper,hash_type)
password = undefined # forget password when no longer needed
return Util.slow_equals(expected_digest,digest)[0]
# Hash the given `password`, optionally using the given `salt`.
# If no `salt` is provided a new random salt will be generated.
# Returns `[salt,digest]`.
# options := { password, salt, pepper, hash_type }
@hash_password:(password,salt,pepper,hash_type)=>
# parse input parameters
if typeof password is 'object'
hash_type = password.hash_type
pepper = password.pepper
salt = password.salt
password = password.password
# set defaults
hash_type ?= 'sha512'
salt ?= 64
# convert types
password = new Buffer(password) if password? and not Buffer.isBuffer(password)
pepper = new Buffer(pepper) if pepper? and not Buffer.isBuffer(pepper)
if typeof salt is 'number'
salt = RandomUtil.random_bytes(salt,'buffer')
else unless Buffer.isBuffer(salt)
salt = new Buffer(salt)
# validate inputs
if not password?
throw new Error("password parameter is required")
else
# calculate hash
hash = crypto.createHash(hash_type)
hash.update salt
if pepper?
hash.update pepper
hash.update password
password = undefined # forget password when no longer needed
digest = hash.digest()
# return generated salt and calculated hash
return [salt,digest]
################################################################################
class ComparatorUtil
# **slow_equals** - *constant-time comparison of two buffers for equality*
# Performs a byte by byte comparision of the given buffers
# but does it in *constant* time (rather than aborting as soon
# as a delta is discovered). `a^b` (`a xor b`) would be better
# if supported.
#
# To prevent optimizations from short-cutting this process, an array
# containing `[ equal?, number-of-identical-bytes, number-of-different-bytes ]`
# is returned.
#
# For equality tests, you'll want something like `if(Util.slow_equals(a,b)[0])`.
#
@slow_equals:(a,b)=>
same_count = delta_count = 0
if b.length > a.length
[a,b] = [b,a]
for i in [0...a.length]
if a[i] isnt b[i]
delta_count += 1
else
same_count += 1
if (delta_count is 0 and a.length is b.length)
return [true,same_count,delta_count]
else
return [false,same_count,delta_count]
# **compare** - *a basic comparator function*
#
# A basic comparator.
#
# When `a` and `b` are strings, they are compared in a case-folded
# sort (both 'A' and `a` before both `B` and 'b') using
# `String.prototype.localeCompare`.
#
# Otherwise JavaScript's default `<` and `>` operators are used.
#
# This method allows `null` values, which are sorted before any non-null values.
#
# Returns:
# - a positive integer when `a > b`, or when `a` is not `null` and `b` is `null`
# - a negative integer when `a < b`, or when `a` is `null` and `b` is not `null`
# - zero (`0`) otherwise (when `!(a > b) && !(a < b)` or when both `a` and `b` are `null`).
@compare:(a,b)=>
if a? and b?
if a.localeCompare? and b.localeCompare? and a.toUpperCase? and b.toUpperCase?
A = a.toUpperCase()
B = b.toUpperCase()
val = A.localeCompare(B)
if val is 0
return a.localeCompare(b)
else
return val
else
return (if a > b then 1 else (if a < b then -1 else 0))
else if a? and not b?
return 1
else if b? and not a?
return -1
else
return 0
# DEPRECATED - just use @compare
@case_insensitive_compare:(a,b)=>@compare(a,b)
# **field_comparator** - *compares objects based on an attribute*
#
# Generates a comparator that compares objects based on the specified field.
# E.g., `field_comparator('foo')` will compare two objects `A` and `B`
# based on the value of `A.foo` and `B.foo`.
#
# When `locale_compare` is `true`, string-valued fields will be compared using
# the `localeCompare` function. Otherwise the (ASCII-betical) `<` and `>`
# operators are used.
#
# Also see `compare`.
#
@field_comparator:(field,locale_compare=false)=>
locale_compare = false
@path_comparator([field],locale_compare)
# **path_operator** - *compares objects based on (optionally nested) attributes*
#
# Generates a comparator that compares objects based on the value obtained
# by walking the given path (in an object graph).
#
# E.g., `path_comparator(['foo','bar'])` will compare two objects `A` and `B`
# based on the value of `A.foo.bar` and `B.foo.bar`.
#
# If a `null` value is encountered while walking the object-graph, the
# two values are immediately compared. (Hence given:
#
# a = { foo: null }
# b = { foo: { bar: null } }
# path = [ 'foo','bar' ]
#
# `path_comparator(path)(a,b)` will compare `null` and `{ bar: null }`, since
# the value of `a.foo` is `null`.)
#
# When `locale_compare` is `true`, string-valued fields will be compared using
# the `localeCompare` function. Otherwise the (ASCII-betical) `<` and `>`
# operators are used.
#
# Also see `compare`.
#
@path_comparator:(path,locale_compare=false)=>
locale_compare = false
(a,b)=>
fn = null
if locale_compare
fn = Util.compare
else
fn = (a,b)=>
if a? and b?
return (if a > b then 1 else (if a < b then -1 else 0))
else if a? and not b?
return 1
else if b? and not a?
return -1
else
return 0
A = a
B = b
for f in path
A = A?[f]
B = B?[f]
unless A? and B? # should we continue walking the graph if one of the values is not-null?
return fn(A,B)
return fn(A,B)
# **desc_comparator** - *reverses another comparison function.*
#
# Generates a comparator that reverses the sort order of the input comparator.
# I.e., if when sorted by comparator `c` an array is ordered `[1,2,3]`, the
# array will be ordered `[3,2,1]` when sorted by `desc_comparator(c)`.
@desc_comparator:(c)=>((a,b)->(c(b,a)))
# **descending_comparator** - *an alias for `desc_comparator`*
@descending_comparator:(args...)=>@desc_comparator(args...)
# **composite_comparator** - *chains several comparison functions into one*
#
# Given a list (array) of comparators, generates a comparator that first
# compares elements by list[0], then list[1], etc. until a non-equal
# comparision is found, or we run out of comparators.
@composite_comparator:(list)=>
(a,b)->
for c in list
r = c(a,b)
unless r is 0
return r
return 0
################################################################################
class WebUtil
# Identifies the "client IP" for the given request in various circumstances
@remote_ip:(req)=>
req?.get?('x-forwarded-for') ?
req?.headers?['x-forwarded-for'] ?
req?.connection?.remoteAddress ?
req?.socket?.remoteAddress ?
req?.connection?.socket?.remoteAddress
# replaces the now deprecated `req.param` found in Express.js
@param:(req, name, default_value)=>
unless req? and name?
return default_value
else
unless Array.isArray(name)
name = [name]
for n in name
val = req.params?[n] ? req.body?[n] ? req.query?[n]
if val?
return val
return default_value
@map_to_query_string:(map)->
return @map_to_qs(map)
@map_to_qs:(map)->
parts = []
for name, value of (map ? {})
unless Array.isArray(value)
value = [value]
parts = parts.concat value.map((v)->"#{encodeURIComponent(name)}=#{encodeURIComponent(v)}")
return parts.join("&")
@append_query_string:(url, name, value)=>
return @append_qs url, name, value
@append_qs:(url,name,value)=>
if name?
if /\?/.test url
url += "&"
else
url += "?"
if typeof name is 'string' and value?
unless Array.isArray(value)
value = [value]
url += value.map((v)->"#{encodeURIComponent(name)}=#{encodeURIComponent(v)}").join("&")
else if typeof name is 'string' and not value?
url += name
else if typeof name is 'object' and not value?
url += @map_to_qs(name)
else
throw new Error("Not sure what to do with the parameters #{name} and #{value}.")
return url
class IOUtil
@pipe_to_buffer:(readable_stream,callback)=>
data = []
length = 0
readable_stream.on 'data', (chunk)=>
if chunk?
data.push chunk
length += chunk.length
readable_stream.on 'error', (err)=>
callback(err)
readable_stream.on 'end', ()=>
callback null, Buffer.concat(data)
@pipe_to_file:(readable_stream,dest,options,callback)=>
if options? and typeof options is 'function' and not callback?
callback = options
options = null
out = fs.createWriteStream(dest,options)
out.on 'close', callback
out.on 'error', callback
readable_stream.pipe(out)
@download_to_buffer:(url,callback)=>
params = {}
if typeof url is 'string'
params.url = url
else
params = url
request params, (err,response,body)=>
if err?
callback(err)
else unless /^2[0-9][0-9]$/.test request?.statusCode
callback(response,body)
else
callback(null,body)
@download_to_file:(url,dest,options,callback)=>
if options? and typeof options is 'function' and not callback?
callback = options
options = null
params = {}
if typeof url is 'string'
params.url = url
else
params = url
out = fs.createWriteStream(dest,options)
out.on 'close', callback
out.on 'error', callback
request(params).pipe(out)
################################################################################
class ErrorUtil
# **handle_error** - *invoke a callback on error*
#
# If `err` is `null` (or `undefined`), returns
# `false`.
#
# If `err` is not `null`, and `callback` exists,
# invokes `callback(err)` and returns `true`.
#
# If `err` is not `null`, `callback` does not
# exist and `thrown_when_no_callback` is `true`
# (the default), `throws` the given error.
#
# If `err` is not `null`, `callback` does not
# exist and `thrown_when_no_callback` is `false`,
# prints the `err` to STDERR and returns `true`.
#
# Particularly useful for the CoffeeScript idiom:
#
# some_error_generating_function a, b, (err,foo,bar)->
# unless Util.handle_error err, callback
# # ...continue processing...
#
# rather than:
#
# some_error_generating_function a, b, (err,foo,bar)->
# if err?
# callback(err)
# else
# # ...continue processing...
#
@handle_error:(err,callback,throw_when_no_callback=true)=>
throw_when_no_callback ?= true
if err?
if callback?
callback(err)
return true
else if throw_when_no_callback
throw err
else
console.error "ERROR",err
else
return false
################################################################################
class IdUtil
# **uuid** - *normalize or generate a UUID value*
#
# When called with no arguments, generates a new UUID value.
#
# When a UUID value `v` is provided, a normalized value is returned (downcased and
# with any dashes (`-`) removed, matching `/^[0-9a-f]{32}$/`).
#
# E.g., given `02823B75-8C4A-3BC4-7F03-0A8482D5A9AB`, returns `02823b758c4a3bc47f030a8482d5a9ab`.
# If `generate` is `true` and `v` is `null`, a new (normalized) UUID value is generated and returned.
#
# DEPRECATED the `generate=false` default will be changed in some future release; to
# maintain the same behavior switch to `normalize_uuid`. To switch to the
# new behavior now, use `make_uuid` (or variants).
@uuid:(v,generate=false)=>
if arguments.length is 0
generate = true
unless v?
if generate
v = @uuid(uuid.v1())
else
return null
else unless v.replace?
throw new Error("Expected string but found #{typeof v}",v)
else unless /^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$/i.test v
throw new Error("Encountered invalid UUID format #{v}.")
return v.replace(/-/g,'').toLowerCase()
@normalize_uuid:(v,generate=false)=>
generate ?= false
@uuid v, generate
@make_uuid:(v)=>
@uuid(v ? uuid.v1())
@make_uuid_v1:(v)=>
@uuid(v ? uuid.v1())
@make_uuid_v4:(v)=>
@uuid(v ? uuid.v4())
# **pad_uuid** - *normalize or generate a *padded* UUID value*
#
# When a UUID value `v` is provided, a normalized value is returned (matching
# `/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/`).
#
# If `generate` is `true` and `v` is `null`, a new (normalized) UUID value
# is generated and returned.
@pad_uuid:(v,generate=false)=>
generate ?= false
v = @uuid(v,generate)
if v?
return (v.substring(0,8)+"-"+v.substring(8,12)+"-"+v.substring(12,16)+"-"+v.substring(16,20)+"-"+v.substring(20))
else
return null
################################################################################
class Base64
# **b64e** - *encodes a buffer as Base64*
#
# Base64-encodes the given Buffer or string, returning a string.
# When a string value is provided, the optional `output_encoding` attribute
# specifies the encoding to use when converting characters to bytes.
@encode:(buf,output_encoding='utf8')=>
output_encoding ?= 'utf8'
if not buf?
return null
else
unless buf instanceof Buffer
buf = new Buffer(buf.toString(),output_encoding)
return buf.toString('base64')
# **b64d** - *decodes a Base64-encoded string*
#
# Base64-decodes the given Buffer or string, returning a string.
# The optional `output_encoding` attribute specifies the encoding to use
# when converting bytes to characters.
@decode:(buf,output_encoding='utf8')=>
output_encoding ?= 'utf8'
if not buf?
return null
else
unless buf instanceof Buffer
buf = new Buffer(buf.toString(),'base64')
return buf.toString(output_encoding)
################################################################################
# **Util** - *collects assorted utility functions*
class Util
# The call `get_funky_json(json, "foo", "bar")`
# will return `Xyzzy` for both:
#
# json = { foo: { bar: "Xyzzy" } }
#
# and
#
# json = { foo: { bar: {$:"Xyzzy" } } }
#
# This is used to mask the differences between certain XML-to-JSON
# translators. (Source `<foo><bar>Xyzzy</bar></foo>` can be converted
# to either of the above).
@get_funky_json:(json,keys...)=>
@gfj(json,keys...)
@gfj:(json,keys...)->
for key in keys
unless json?
return null
else
json = json[key] ? json["@#{key}"]
value = json?.$ ? json
return value
@version_satisfies:(verstr,rangestr)=>
unless rangestr?
rangestr = verstr
verstr = null
verstr ?= process.version
return semver.satisfies(verstr,rangestr)
@to_unit: DateUtil.to_unit
@start_time: DateUtil.start_time
@duration: DateUtil.duration
@iso_8601_regexp: DateUtil.iso_8601_regexp
@lpad_array: ArrayUtil.lpad_array
@rpad_array: ArrayUtil.rpad_array
@smart_join: ArrayUtil.smart_join
@trim_trailing_null: ArrayUtil.trim_trailing_null
@right_shift_args: ArrayUtil.right_shift_args
@paginate_list: ArrayUtil.paginate_list
@subset_of: ArrayUtil.subset_of
@is_subset_of: ArrayUtil.is_subset_of
@strict_subset_of: ArrayUtil.strict_subset_of
@is_strict_subset_of: ArrayUtil.is_strict_subset_of
@sets_are_equal: ArrayUtil.sets_are_equal
@arrays_are_equal: ArrayUtil.arrays_are_equal
@uniquify: ArrayUtil.uniquify
@round_decimal: NumberUtil.round_decimal
@is_int: NumberUtil.is_int
@to_int: NumberUtil.to_int
@is_float: NumberUtil.is_float
@to_float: NumberUtil.to_float
@is_decimal: NumberUtil.is_float
@to_decimal: NumberUtil.to_float
@remove_null: ObjectUtil.remove_null
@remove_falsey: ObjectUtil.remove_falsey
@merge: ObjectUtil.merge
@shallow_clone: ObjectUtil.shallow_clone
@object_array_to_map: ObjectUtil.object_array_to_map
@hex_to_rgb_triplet: ColorUtil.hex_to_rgb_triplet
@hex_to_rgb_string: ColorUtil.hex_to_rgb_string
@rgb_string_to_triplet: ColorUtil.rgb_string_to_triplet
@rgb_to_hex: ColorUtil.rgb_to_hex
@random_bytes: RandomUtil.random_bytes
@random_hex: RandomUtil.random_hex
@random_alphanumeric: RandomUtil.random_alphanumeric
@random_Alphanumeric: RandomUtil.random_Alphanumeric
@random_string: RandomUtil.random_string
@random_numeric: RandomUtil.random_numeric
@random_alpha: RandomUtil.random_alpha
@random_ALPHA: RandomUtil.random_ALPHA
@random_Alpha: RandomUtil.random_Alpha
@random_element: RandomUtil.random_element
@seed_rng: RandomUtil.seed_rng
@set_rng: RandomUtil.set_rng
@random_digits: RandomUtil._random_digits
@random_value: RandomUtil.random_value
@shuffle: RandomUtil.shuffle
@validate_hashed_password:PasswordUtil.validate_hashed_password
@hash_password:PasswordUtil.hash_password
@slow_equals:ComparatorUtil.slow_equals
@compare:ComparatorUtil.compare
@case_insensitive_compare:ComparatorUtil.case_insensitive_compare
@field_comparator:ComparatorUtil.field_comparator
@path_comparator:ComparatorUtil.path_comparator
@desc_comparator:ComparatorUtil.desc_comparator
@descending_comparator:ComparatorUtil.descending_comparator
@composite_comparator:ComparatorUtil.composite_comparator
@remote_ip:WebUtil.remote_ip
@handle_error:ErrorUtil.handle_error
@uuid:IdUtil.uuid
@pad_uuid:IdUtil.pad_uuid
@b64e:Base64.encode
@b64d:Base64.decode
################################################################################
ArrayUtil.shuffle = RandomUtil.shuffle
################################################################################
exports.ArrayUtil = ArrayUtil
exports.Base64 = Base64
exports.ColorUtil = ColorUtil
exports.ComparatorUtil = ComparatorUtil
exports.DateUtil = DateUtil
exports.ErrorUtil = ErrorUtil
exports.IdUtil = IdUtil
exports.MapUtil = ObjectUtil
exports.NumberUtil = NumberUtil
exports.PasswordUtil = PasswordUtil
exports.RandomUtil = RandomUtil
exports.StringUtil = StringUtil
exports.Util = Util
exports.WebUtil = WebUtil
################################################################################
# (TESTS FOR STDIN METHODS)
# if require.main is module
# if /^-?-?read(-|_)?stdin$/.test process.argv[2]
# console.log Util.read_stdin_sync().toString()
# else if /^-?-?read(-|_)?stdin(-|_)?json$/.test process.argv[2]
# console.log Util.load_json_stdin_sync()
| 115390 | fs = require 'fs'
path = require 'path'
HOMEDIR = path.join(__dirname,'..')
LIB_COV = path.join(HOMEDIR,'lib-cov')
LIB_DIR = if fs.existsSync(LIB_COV) then LIB_COV else path.join(HOMEDIR,'lib')
ObjectUtil = require(path.join(LIB_DIR,'object-util')).ObjectUtil
StringUtil = require(path.join(LIB_DIR,'string-util')).StringUtil
uuid = require 'uuid'
crypto = require 'crypto'
mkdirp = require 'mkdirp'
request = require 'request'
remove = require 'remove'
seedrandom = require 'seedrandom'
semver = require 'semver'
DEBUG = (/(^|,)inote-?util($|,)/i.test process?.env?.NODE_DEBUG) or (/(^|,)Util($|,)/.test process?.env?.NODE_DEBUG)
################################################################################
class DateUtil
@DAY_OF_WEEK = [
"Sunday"
"Monday"
"Tuesday"
"Wednesday"
"Thursday"
"Friday"
"Saturday"
]
@MONTH = [
"January"
"February"
"March"
"April"
"May"
"June"
"July"
"August"
"September"
"October"
"November"
"December"
]
@format_datetime_long:(dt = new Date())=>
if typeof dt is 'string'
try
dt = new Date(dt)
catch e
return null
return "#{@format_date_long(dt)} at #{@format_time_long(dt)}"
@format_time_long:(dt = new Date())=>
hours = dt.getUTCHours() % 12
if hours is 0
hours = 12
minutes = dt.getUTCMinutes()
if minutes < 10
minutes = "0#{minutes}"
if dt.getUTCHours() > 12
ampm = "PM"
else
ampm = "AM"
return "#{hours}:#{minutes} #{ampm} GMT"
@format_date_long:(dt = new Date())=>
if typeof dt is 'string'
try
dt = new Date(dt)
catch e
return null
return "#{@DAY_OF_WEEK[dt.getUTCDay()]} #{dt.getUTCDate()} #{@MONTH[dt.getUTCMonth()]} #{dt.getUTCFullYear()}"
@to_unit:(value,singular,plural)=>
unless plural?
plural = "#{singular}s"
if value is 1 or value is -1
return "#{value} #{singular}"
else
return "#{value} #{plural}"
@start_time: Date.now()
@duration:(now,start)=>
start ?= @start_time
now ?= Date.now()
if start instanceof Date
start = start.getTime()
if now instanceof Date
now = now.getTime()
#
result = {}
result.begin = start
result.end = now
result.delta = now - start
#
duration = result.delta
result.in_millis = {}
result.in_millis.millis = duration % (1000)
result.in_millis.seconds = duration % (1000 * 60)
result.in_millis.minutes = duration % (1000 * 60 * 60)
result.in_millis.hours = duration % (1000 * 60 * 60 * 24)
result.in_millis.days = duration % (1000 * 60 * 60 * 24 * 7)
result.in_millis.weeks = duration % (1000 * 60 * 60 * 24 * 7 * 52)
result.in_millis.years = duration
#
result.raw = {}
result.raw.millis = result.in_millis.millis
result.raw.seconds = result.in_millis.seconds / (1000)
result.raw.minutes = result.in_millis.minutes / (1000 * 60)
result.raw.hours = result.in_millis.hours / (1000 * 60 * 60)
result.raw.days = result.in_millis.days / (1000 * 60 * 60 * 24)
result.raw.weeks = result.in_millis.weeks / (1000 * 60 * 60 * 24 * 7)
result.raw.years = result.in_millis.years / (1000 * 60 * 60 * 24 * 7 * 52)
#
result.whole = {}
result.whole.millis = Math.floor(result.raw.millis)
result.whole.seconds = Math.floor(result.raw.seconds)
result.whole.minutes = Math.floor(result.raw.minutes)
result.whole.hours = Math.floor(result.raw.hours)
result.whole.days = Math.floor(result.raw.days)
result.whole.weeks = Math.floor(result.raw.weeks)
result.whole.years = Math.floor(result.raw.years)
#
result.array = {}
result.array.full = {}
result.array.full.values = [
result.whole.years
result.whole.weeks
result.whole.days
result.whole.hours
result.whole.minutes
result.whole.seconds
result.whole.millis
]
result.array.full.short = [
"#{result.whole.years}y"
"#{result.whole.weeks}w"
"#{result.whole.days}d"
"#{result.whole.hours}h"
"#{result.whole.minutes}m"
"#{result.whole.seconds}s"
"#{result.whole.millis}m"
]
result.array.full.long = [
@to_unit(result.whole.years,"year")
@to_unit(result.whole.weeks,"week")
@to_unit(result.whole.days,"day")
@to_unit(result.whole.hours,"hour")
@to_unit(result.whole.minutes,"minute")
@to_unit(result.whole.seconds,"second")
@to_unit(result.whole.millis,"millisecond")
]
result.array.full.no_millis = {}
result.array.full.no_millis.values = [].concat(result.array.full.values[0...-1])
result.array.full.no_millis.short = [].concat(result.array.full.short[0...-1])
result.array.full.no_millis.long = [].concat(result.array.full.long[0...-1])
#
values = [].concat(result.array.full.values)
values.shift() while values.length > 0 and values[0] is 0
result.array.brief = {}
result.array.brief.values = values
result.array.brief.short = []
result.array.brief.long = []
result.array.brief.no_millis = {}
result.array.brief.no_millis.values = values[0...-1]
result.array.brief.no_millis.short = []
result.array.brief.no_millis.long = []
values = [].concat(values)
for unit in [ 'millisecond','second','minute','hour','day','week','year' ]
v = values.pop()
if v?
result.array.brief.short.unshift "#{v}#{unit.substring(0,1)}"
result.array.brief.long.unshift @to_unit(v,unit)
unless unit is 'millisecond'
result.array.brief.no_millis.short.unshift "#{v}#{unit.substring(0,1)}"
result.array.brief.no_millis.long.unshift @to_unit(v,unit)
else
break
#
result.array.min = {}
result.array.min.units = []
result.array.min.short = []
result.array.min.long = []
result.array.min.no_millis = {}
result.array.min.no_millis.units = []
result.array.min.no_millis.short = []
result.array.min.no_millis.long = []
for unit, i in [ 'year','week','day','hour','minute','second','millisecond']
v = result.array.full.values[i]
unless v is 0
result.array.min.short.push "#{v}#{unit.substring(0,1)}"
result.array.min.long.push @to_unit(v,unit)
result.array.min.units.push unit
unless unit is 'millisecond'
result.array.min.no_millis.short.push "#{v}#{unit.substring(0,1)}"
result.array.min.no_millis.long.push @to_unit(v,unit)
result.array.min.no_millis.units.push unit
#
result.string = {}
result.string.full = {}
result.string.full.micro = result.array.full.short.join('')
result.string.full.short = result.array.full.short.join(' ')
result.string.full.long = result.array.full.long.join(' ')
result.string.full.verbose = ArrayUtil.smart_join(result.array.full.long, ", ", " and ")
result.string.full.no_millis = {}
result.string.full.no_millis.micro = result.array.full.no_millis.short.join('')
result.string.full.no_millis.short = result.array.full.no_millis.short.join(' ')
result.string.full.no_millis.long = result.array.full.no_millis.long.join(' ')
result.string.full.no_millis.verbose = ArrayUtil.smart_join(result.array.full.no_millis.long, ", ", " and ")
result.string.brief = {}
result.string.brief.micro = result.array.brief.short.join('')
result.string.brief.short = result.array.brief.short.join(' ')
result.string.brief.long = result.array.brief.long.join(' ')
result.string.brief.verbose = ArrayUtil.smart_join(result.array.brief.long, ", ", " and ")
result.string.brief.no_millis = {}
result.string.brief.no_millis.micro = result.array.brief.no_millis.short.join('')
result.string.brief.no_millis.short = result.array.brief.no_millis.short.join(' ')
result.string.brief.no_millis.long = result.array.brief.no_millis.long.join(' ')
result.string.brief.no_millis.verbose = ArrayUtil.smart_join(result.array.brief.no_millis.long, ", ", " and ")
result.string.min = {}
result.string.min.micro = result.array.min.short.join('')
result.string.min.short = result.array.min.short.join(' ')
result.string.min.long = result.array.min.long.join(' ')
result.string.min.verbose = ArrayUtil.smart_join(result.array.min.long, ", ", " and ")
result.string.min.no_millis = {}
result.string.min.no_millis.micro = result.array.min.no_millis.short.join('')
result.string.min.no_millis.short = result.array.min.no_millis.short.join(' ')
result.string.min.no_millis.long = result.array.min.no_millis.long.join(' ')
result.string.min.no_millis.verbose = ArrayUtil.smart_join(result.array.min.no_millis.long, ", ", " and ")
return result
# **iso_8601_regexp** - *returns a regular expression that can be used to validate an iso 8601 format date*
# note that currently only the fully-specified datetime format is supported (not dates without times or durations).
@iso_8601_regexp:()=>/^((\d{4})-(\d{2})-(\d{2}))T((\d{2})\:(\d{2})\:((\d{2})(?:\.(\d{3}))?)((?:[A-Za-z]+)|(?:[+-]\d{2}\:\d{2})))$/
################################################################################
################################################################################
class ArrayUtil
@lpad:StringUtil.lpad
@lpad_array:StringUtil.lpad_array
@rpad:StringUtil.rpad
@rpad_array:StringUtil.rpad_array
# ***smart_join*** - *like `Array.prototype.join` but with an optional final delimiter*
#
# E.g., `smart_join(["<NAME>","<NAME>","<NAME>"],", "," and ")` yields `<NAME>, <NAME> and <NAME>`.
#
# Alternatively, the `delimiter` parameter can be a map of options:
#
# * `before` - appears before the list
# * `first` - appears between the first and second element
# * `last` - appears between the next-to-last and last element
# * `delimiter` - appears between other elements (if any)
# * `after` - appears after the list
#
# E.g., given:
#
# var options = {
# before: "B",
# first: "F",
# delimiter: "D",
# last: "L",
# after: "A"
# }
#
# and
#
# var a = [1,2,3,4,5]
#
# then `smart_join(a,options)` yields `"B1F2D3D4L5A"`.
@smart_join:(array,delimiter,last)=>
unless array?
return null
else
if typeof delimiter is 'object'
options = delimiter
before = options.before
first = options.first
delimiter = options.delimiter
last = options.last
after = options.after
if first? and last?
[head,middle...,tail] = array
else if first? and not last?
[head,middle...] = array
else if last? and not first?
[middle...,tail] = array
else
middle = array
if tail? and middle.length is 0
middle = [tail]
tail = undefined
buffer = []
if before?
buffer.push before
if head?
buffer.push head
if middle?.length > 0
buffer.push first
if middle?
buffer.push middle.join(delimiter)
if tail?
if last?
buffer.push last
buffer.push tail
if after?
buffer.push after
return buffer.join("")
# **trim_trailing_null** - *remove trailing `null` values from an array*
#
# Removes any trailing `null` values from the given array.
# Leading or interspersed `null` values are left alone.
# E.g., given `[null,'foo',null,'bar',null,null]` returns `[null,'foo',null,'bar']`.
@trim_trailing_null: (a)=>
a = [].concat(a)
b = []
while a.length > 0
v = a.pop()
if v?
b.unshift v
else if b.length > 0
b.unshift v
return b
# **right_shift_args** - *convert trailing `null` values to leading `null` values*
#
# Given a list of arguments that might contain trailing `null` values, returns an array
# of the same length, but with leading rather than trailing `null`s.
# E.g,.:
#
# right_shift_args('a',null)
#
# returns:
#
# [ null, 'a' ]
#
# and,
#
# right_shift_args(1,null,2,null,null)
#
# returns:
#
# [ null, null, 1, null, 2 ]
#
# This method can be used to allow the leading arguments to a function to
# be the optional ones. For example, consider the function signature:
#
# function foo(a,b,callback)
#
# Using `right_shift_args` we can make `a` and `b` the optional arguments such that
# `foo(callback)` is equivalent to `foo(null,null,callback)` and `foo('x',callback)`
# is equivalent to `foo(null,'x',callback)`.
#
# In CoffeeScript, this can be achieved with the following idiom:
#
# foo:(a,b,c)->
# [a,b,c] = Util.right_shift_args(a,b,c)
#
# In JavaScript, you'll need to unwind the returned array on your own:
#
# function foo(a,b,c,d) {
# var args = Util.right_shift_args(a,b,c,d);
# a = args[0]; b = args[1]; c = args[2]; d = args[3];
# }
#
@right_shift_args: (values...)=>@lpad(@trim_trailing_null(values),values.length,null)
# **paginate_list** - *extract a sub-array based on offset and limit*
#
# Given a list (array), returns the sublist defined by `offset` and `limit`.
@paginate_list:(list,offset=0,limit=20)=>
offset ?= 0
limit ?= 20
list[offset...(offset+limit)]
# **subset_of** - *check whether on array contains another arrays as if they are sets *
#
# Given two arrays `a` and `b`, returns `true` if every element of
# `a` is also found in `b`.
#
# Note that the arrays are treated as true *sets*. The number of times
# a given entry appears in each array is ignored--only the presence or
# absence of a value is significant. (For example, `[1,1]` is considered
# a subset of `[1]`.)
@subset_of:(a,b)=>
unless a? and Array.isArray(a) and b? and Array.isArray(b)
throw new Error("Expected arrays.")
else
for e in a
unless e in b
return false
return true
# **is_subset_of** - *an alias for `subset_of`*
@is_subset_of:(args...)=>@subset_of(args...)
# **strict_subset_of** - *check whether on array strictly contains another arrays as if they are sets *
#
# Given two arrays `a` and `b`, returns `true` if every element of
# `a` is also found in `b` *and* at least one element of `b` does not
# appear in `a`.
#
# Note that the arrays are treated as true *sets*. The number of times
# a given entry appears in each array is ignored--only the presence or
# absence of a value is significant. (For example, `[1,1]` is considered
# a subset of `[1]`.)
@strict_subset_of:(a,b)=>@subset_of(a,b) and not @subset_of(b,a) # Note: there are probably more efficient ways to do this.
# **is_strict_subset_of** - *an alias for `strict_subset_of`*
@is_strict_subset_of:(args...)=>@strict_subset_of(args...)
# **sets_are_equal** - *compare two arrays as if they were sets*
#
# Given two arrays `a` and `b`, returns `true` if every element of
# `a` is also found in `b` and every element of `b` is also found in `a`.
#
# Note that the arrays are treated as true *sets*. Both the order of
# and number of times a given entry appears in each array is ignored--only
# the presence or absence of a value is significant. (For example, `[1,2]` has
# set equality with `[2,1]` and `[1,2,1]` has set equality with `[2,2,1]`.)
#
# NOTE: currenly only does a shallow comparison
@sets_are_equal:(a,b)=>
unless a? and Array.isArray(a) and b? and Array.isArray(b)
throw new Error("Expected arrays.")
else
for e in a
unless e in b
return false
for e in b
unless e in a
return false
return true
# Returns `true` iff the given arrays contain equal (`===`) elements in the
# exact same order. (Also see `sets_are_equal`).
# Deprecated; use `ObjectUtil.deep_equal` instead
@arrays_are_equal:(a,b)=>
unless a? and Array.isArray(a) and b? and Array.isArray(b)
throw new Error("Expected arrays.")
else
return ObjectUtil.deep_equal(a, b)
# Returns a clone of `array` with duplicate values removed
# When `key` is specified, elements of the array are treated as maps, and the
# specified key field is used to test for equality
@uniquify:(array,key)=>
clone = []
if key?
keys = []
for elt in array
unless elt[key] in keys
clone.push elt
keys.push elt[key]
else
for elt in array
unless elt in clone
clone.push elt
return clone
################################################################################
class NumberUtil
# **round_decimal** - *round a number to the specified precision*
#
# Formats the given `value` as a decimal string with `digits` signficant
# digits to the right of the decimal point.
#
# For example, given `v = 1234.567` then:
#
# - `round_decimal(v,0)` yields `"1235"`
# - `round_decimal(v,1)` yields `"1234.6"`
# - `round_decimal(v,2)` yields `"1234.57"`
# - `round_decimal(v,3)` yields `"1234.567"`
# - `round_decimal(v,4)` yields `"1234.5670"`
# - `round_decimal(v,5)` yields `"1234.56700"`
# - `round_decimal(v,-1)` yields `"1230"`
# - `round_decimal(v,-2)` yields `"1200"`
# - `round_decimal(v,-3)` yields `"1000"`
# - `round_decimal(v,-4)` yields `"0"`
#
# Returns `null` if `value` is not a number and cannot
# be coerced into one. (Note that this method uses a less
# permissive form of coercion that `parseInt` and `parseFloat`.
# The input value must be a decimal string in standard (non-scientific)
# notation.)
@round_decimal:(value,digits=0)=>
digits ?= 0
unless value?
return null
else
unless typeof value is 'number'
if /^\s*-?(([0-9]+(\.[0-9]+))|(\.[0-9]+))\s*$/.test "#{value}"
value = parseFloat(value)
else
return null
if isNaN(value)
return null
else if digits >= 0
return value.toFixed(digits)
else
factor = Math.pow(10,Math.abs(digits))
return "#{(Math.round(value/factor))*factor}"
# **is_int** - *check if the given object is an (optionally signed) simple integer value*
#
# Returns `true` if the given value is (or can be converted to) a
# valid integer (without any rounding). E.g., `is_int(3)` and `is_int("3")`
# yield `true` but `is_int(3.14159)` and `is_int("3.0")` yield `false`.
@is_int:(v)=>
unless v?
return false
else
return /^-?((0)|([1-9][0-9]*))$/.test "#{v}"
# **to_int** - *returns a valid integer or null*
@to_int:(v)=>
if @is_int(v)
v = parseInt(v)
if isNaN(v)
return null
else
return v
else
return null
@is_float:(v)=>
unless v?
return false
else
return /^-?((((0)|([1-9][0-9]*))(\.[0-9]+)?)|(\.[0-9]+))$/.test "#{v}"
@to_float:(v)=>
if @is_float(v)
v = parseFloat(v)
if isNaN(v)
return null
else
return v
else
return null
################################################################################
class ColorUtil
# **hex_to_rgb_triplet** - *convert a hex-based `#rrggbb` string to decimal `[r,g,b]` values*
#
# Given an HTML/CSS-style hex color string, yields an array of the R,G and B values.
# E.g. `hex_to_rgb("#3300FF")` yields `[51,0,255]`.
# The leading `#` character is optional, and both uppercase and lowercase letters
# are supported.
@hex_to_rgb_triplet:(hex)=>
result = /^\s*#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})\s*$/i.exec(hex)
if result?
return [
parseInt(result[1],16)
parseInt(result[2],16)
parseInt(result[3],16)
]
else
return null
# **hex_to_rgb_strng** - *convert a hex-based `#rrggbb` string to a decimal-based `rgb(r,g,b)` string*
#
# Given an HTML/CSS-style hex color string, yields the corresponding `rgb(R,G,B)`
# form. E.g. `hex_to_rgb("#3300FF")` yields `rgb(51,0,255)`.
# The leading `#` character is optional, and both uppercase and lowercase letters
# are supported.
@hex_to_rgb_string:(hex)=>
[r,g,b] = @hex_to_rgb_triplet(hex) ? [null,null,null]
if r? and g? and b?
return "rgb(#{r},#{g},#{b})"
else
return null
# **rgb_string_to_triplet** - *extract the `[r,g,b]` values from an `rgb(r,g,b)` string*
@rgb_string_to_triplet:(rgb)=>
result = /^\s*rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)\s*$/i.exec(rgb)
if result?
r = parseInt(result[1])
g = parseInt(result[2])
b = parseInt(result[3])
return [r,g,b]
else
return null
# **rgb_to_hex** - *convert `r`, `g` and `b` components or an `rgb(r,g,b`) string to a hex-based `#rrggbb` string*
#
# Given an RGB triplet returns the equivalent HTML/CSS-style hex string.
# E.g, `rgb_to_hex(51,0,255)` yields `#3300FF`.
@rgb_to_hex:(r,g,b)=>
if typeof r is 'string' and not g? and not b?
[r,g,b] = @rgb_string_to_triplet(r) ? [null,null,null]
unless r? and g? and b?
return null
else
i2h = (i)->
h = i.toString(16)
return if h.length is 1 then "0#{h}" else h
return "##{i2h(r)}#{i2h(g)}#{i2h(b)}"
################################################################################
class RandomUtil
# **random_bytes** - *generate a string of random bytes*
#
# Generates a string of `count` pseudo-random bytes in the specified encoding.
# (Defaults to `hex`.)
#
# Note that `count` specifies the number of *bytes* to be generated. The encoded
# string may be more or less than `count` *characters*.
@random_bytes:(count=32,enc='hex')=>
count ?= 32
enc ?= 'hex'
if typeof count is 'string'
if typeof enc is 'number'
[count,enc] = [enc,count]
else
enc = count
count = 32
bytes = crypto.randomBytes(count)
if /buffer/i.test enc
return bytes
else
return bytes.toString(enc)
@seed_rng:(seed)->
return new Math.seedrandom(seed)
@set_rng:(rng)=>
@rng = rng ? new Math.seedrandom()
@rng:Math.random
# **random_hex** - *generate a string of `count` pseudo-random characters from the set ``[0-9a-f]``.
@random_hex:(count=32,rng)=>
count ?= 32
@_random_digits(count,16,rng)
# **random_alphanumeric** - *generate a string of `count` pseudo-random characters from the set `[a-z0-9]`.
@random_alphanumeric:(count=32,rng)=>
count ?= 32
@_random_digits(count,36,rng)
# **random_numeric** - *generate a string of `count` pseudo-random characters from the set `[0-9]`.*
@random_numeric:(count=32,rng)=>
count ?= 32
@_random_digits(count,10,rng)
# **random_Alpha** - *generate a string of `count` pseudo-random characters from the set `[a-zA-Z]` (mixed case).
@random_Alpha:(count=32,rng)=>
count ?= 32
@_random_alpha(count,'M',rng)
# **random_ALPHA** - *generate a string of `count` pseudo-random characters from the set `[A-Z]` (upper case).
@random_ALPHA:(count=32,rng)=>
count ?= 32
@_random_alpha(count,'U',rng)
# **random_alpha** - *generate a string of `count` pseudo-random characters from the set `[a-z]` (lower case).
@random_alpha:(count=32,rng)=>
count ?= 32
@_random_alpha(count,'L',rng)
@random_Alphanumeric:(count=32,rng)=>
count ?= 32
@random_string "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", count, rng
@random_string:(alphabet,count,rng)=>
if typeof alphabet is 'function' and not count? and not rng?
rng = alphabet
count = null
alphabet = null
if typeof count is 'function' and not rng?
rng = count
count = null
if typeof alphabet is 'number' and typeof count isnt 'number'
count = alphabet
alphabet = null
alphabet ?= "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
count ?= 32
rng ?= @rng
result = ""
for i in [0...count]
result += alphabet[Math.floor(rng()*alphabet.length)]
return result
# lettercase = 'upper', 'lower', 'both' (or 'mixed')
@_random_alpha:(count=32,lettercase='lower',rng)=>
count ?= 32
lettercase ?= 'lower'
rng ?= @rng
str = ""
include_upper = /^(u|b|m)/i.test lettercase
include_lower = not /^u/i.test lettercase # everything but `UPPER` includes `LOWER`, to avoid both checks being false
while str.length < count
char = Math.floor(rng()*26)
if include_upper and include_lower
if rng() > 0.5
char += 97 # a
else
char += 65 # A
else if include_upper
char += 65 # A
else
char += 97 # a
str += String.fromCharCode(char)
return str
# **random_element** - *selects a random element from the given array (or map)*
# In the case of a map, a random key/value pair will be returned as a two-element array.
@random_element:(collection,rng)=>
unless collection?
return undefined
else
if Array.isArray(collection)
unless collection.length > 0
return undefined
else
rng ?= @rng
index = Math.floor(rng()*collection.length)
return collection[index]
else if collection? and typeof collection is 'object'
key = @random_element(Object.keys(collection),rng)
return [key,collection[key]]
# **_random_digits** - *generate a string of random bytes in the specfied base number system*
# (An internal method that generates `count` characters in the specified base.)
@_random_digits:(args...)=> #count=32,base,rng
ints = []
rng = null
while args.length > 0
a = args.shift()
if typeof a is 'function'
if rng?
throw new Error("Unexpected arguments: #{args}")
else
rng = a
else
if ints.length is 2 and a?
throw new Error("Unexpected arguments: #{args}")
else
ints.push a
[count,base] = ints
count ?= 32
base ?= 10
rng ?= @rng
str = ""
while str.length < count
str += rng().toString(base).substring(2)
if str.length > count
str = str.substring(0,count)
return str
# performs an IN PLACE shuffle of the given array
@shuffle:(list)->
if list? and Array.isArray(list) and list.length > 1
for i in [(list.length-1)..0]
j = Math.floor(Math.random() * (i + 1))
x = list[i]
list[i] = list[j]
list[j] = x
return list
@random_value:(min,max,rng)=>
if typeof max is 'function' and not rng?
rng = max
max = undefined
if typeof min is 'function' and not rng?
rng = min
min = undefined
if typeof min is 'number' and not max?
max = min
min = undefined
min ?= 0
max ?= 1
if max < min
[min, max] = [max, min]
rng ?= @rng ? Math.random
range = max - min
value = min + (rng()*range)
return value
# Assign the given (non-null) identifier to a randomly selected category such that:
# 1. For a given collection of identifiers results will be randomly distributed among the categories.
# 2. For a given identifier the result will be the same every time the method is called.
# The `categories` parameter is optional:
# - when missing, identifiers will be randomly assigned to either `true` or `false`
# - when an value between 0 and 1, identifiers will be assigned to either `true` or `false`, with `true` appearing `100*value` % of the time
# - when an array, identifiers will be assigned to an element of the array with equal probability
@randomly_assign:(id, categories)=>
categories ?= [true, false]
if typeof categories is 'number'
if categories < 0 or categories > 1
throw new Error("Expected a value between 0 and 1 (inlcusive). Found #{categories}.")
else
value = @random_value 0, 1, @seed_rng(id)
return value <= categories
else if Array.isArray(categories)
value = @random_element categories, @seed_rng(id)
else
throw new Error("Expected a number or an array. Found #{typeof categories}: #{categories}")
################################################################################
class PasswordUtil
# Compare the `expected_digest` with the hash computed from the remaining
# parameters.
@validate_hashed_password:(expected_digest,password,salt,pepper,hash_type)=>
[salt,digest] = @hash_password(password,salt,pepper,hash_type)
password = undefined # forget password when no longer needed
return Util.slow_equals(expected_digest,digest)[0]
# Hash the given `password`, optionally using the given `salt`.
# If no `salt` is provided a new random salt will be generated.
# Returns `[salt,digest]`.
# options := { password, salt, pepper, hash_type }
@hash_password:(password,salt,pepper,hash_type)=>
# parse input parameters
if typeof password is 'object'
hash_type = password.hash_type
pepper = password.pepper
salt = password.salt
password = <PASSWORD>
# set defaults
hash_type ?= 'sha512'
salt ?= 64
# convert types
password = new Buffer(password) if password? and not Buffer.isBuffer(password)
pepper = new Buffer(pepper) if pepper? and not Buffer.isBuffer(pepper)
if typeof salt is 'number'
salt = RandomUtil.random_bytes(salt,'buffer')
else unless Buffer.isBuffer(salt)
salt = new Buffer(salt)
# validate inputs
if not password?
throw new Error("password parameter is required")
else
# calculate hash
hash = crypto.createHash(hash_type)
hash.update salt
if pepper?
hash.update pepper
hash.update password
password = undefined # forget password when no longer needed
digest = hash.digest()
# return generated salt and calculated hash
return [salt,digest]
################################################################################
class ComparatorUtil
# **slow_equals** - *constant-time comparison of two buffers for equality*
# Performs a byte by byte comparision of the given buffers
# but does it in *constant* time (rather than aborting as soon
# as a delta is discovered). `a^b` (`a xor b`) would be better
# if supported.
#
# To prevent optimizations from short-cutting this process, an array
# containing `[ equal?, number-of-identical-bytes, number-of-different-bytes ]`
# is returned.
#
# For equality tests, you'll want something like `if(Util.slow_equals(a,b)[0])`.
#
@slow_equals:(a,b)=>
same_count = delta_count = 0
if b.length > a.length
[a,b] = [b,a]
for i in [0...a.length]
if a[i] isnt b[i]
delta_count += 1
else
same_count += 1
if (delta_count is 0 and a.length is b.length)
return [true,same_count,delta_count]
else
return [false,same_count,delta_count]
# **compare** - *a basic comparator function*
#
# A basic comparator.
#
# When `a` and `b` are strings, they are compared in a case-folded
# sort (both 'A' and `a` before both `B` and 'b') using
# `String.prototype.localeCompare`.
#
# Otherwise JavaScript's default `<` and `>` operators are used.
#
# This method allows `null` values, which are sorted before any non-null values.
#
# Returns:
# - a positive integer when `a > b`, or when `a` is not `null` and `b` is `null`
# - a negative integer when `a < b`, or when `a` is `null` and `b` is not `null`
# - zero (`0`) otherwise (when `!(a > b) && !(a < b)` or when both `a` and `b` are `null`).
@compare:(a,b)=>
if a? and b?
if a.localeCompare? and b.localeCompare? and a.toUpperCase? and b.toUpperCase?
A = a.toUpperCase()
B = b.toUpperCase()
val = A.localeCompare(B)
if val is 0
return a.localeCompare(b)
else
return val
else
return (if a > b then 1 else (if a < b then -1 else 0))
else if a? and not b?
return 1
else if b? and not a?
return -1
else
return 0
# DEPRECATED - just use @compare
@case_insensitive_compare:(a,b)=>@compare(a,b)
# **field_comparator** - *compares objects based on an attribute*
#
# Generates a comparator that compares objects based on the specified field.
# E.g., `field_comparator('foo')` will compare two objects `A` and `B`
# based on the value of `A.foo` and `B.foo`.
#
# When `locale_compare` is `true`, string-valued fields will be compared using
# the `localeCompare` function. Otherwise the (ASCII-betical) `<` and `>`
# operators are used.
#
# Also see `compare`.
#
@field_comparator:(field,locale_compare=false)=>
locale_compare = false
@path_comparator([field],locale_compare)
# **path_operator** - *compares objects based on (optionally nested) attributes*
#
# Generates a comparator that compares objects based on the value obtained
# by walking the given path (in an object graph).
#
# E.g., `path_comparator(['foo','bar'])` will compare two objects `A` and `B`
# based on the value of `A.foo.bar` and `B.foo.bar`.
#
# If a `null` value is encountered while walking the object-graph, the
# two values are immediately compared. (Hence given:
#
# a = { foo: null }
# b = { foo: { bar: null } }
# path = [ 'foo','bar' ]
#
# `path_comparator(path)(a,b)` will compare `null` and `{ bar: null }`, since
# the value of `a.foo` is `null`.)
#
# When `locale_compare` is `true`, string-valued fields will be compared using
# the `localeCompare` function. Otherwise the (ASCII-betical) `<` and `>`
# operators are used.
#
# Also see `compare`.
#
@path_comparator:(path,locale_compare=false)=>
locale_compare = false
(a,b)=>
fn = null
if locale_compare
fn = Util.compare
else
fn = (a,b)=>
if a? and b?
return (if a > b then 1 else (if a < b then -1 else 0))
else if a? and not b?
return 1
else if b? and not a?
return -1
else
return 0
A = a
B = b
for f in path
A = A?[f]
B = B?[f]
unless A? and B? # should we continue walking the graph if one of the values is not-null?
return fn(A,B)
return fn(A,B)
# **desc_comparator** - *reverses another comparison function.*
#
# Generates a comparator that reverses the sort order of the input comparator.
# I.e., if when sorted by comparator `c` an array is ordered `[1,2,3]`, the
# array will be ordered `[3,2,1]` when sorted by `desc_comparator(c)`.
@desc_comparator:(c)=>((a,b)->(c(b,a)))
# **descending_comparator** - *an alias for `desc_comparator`*
@descending_comparator:(args...)=>@desc_comparator(args...)
# **composite_comparator** - *chains several comparison functions into one*
#
# Given a list (array) of comparators, generates a comparator that first
# compares elements by list[0], then list[1], etc. until a non-equal
# comparision is found, or we run out of comparators.
@composite_comparator:(list)=>
(a,b)->
for c in list
r = c(a,b)
unless r is 0
return r
return 0
################################################################################
class WebUtil
# Identifies the "client IP" for the given request in various circumstances
@remote_ip:(req)=>
req?.get?('x-forwarded-for') ?
req?.headers?['x-forwarded-for'] ?
req?.connection?.remoteAddress ?
req?.socket?.remoteAddress ?
req?.connection?.socket?.remoteAddress
# replaces the now deprecated `req.param` found in Express.js
@param:(req, name, default_value)=>
unless req? and name?
return default_value
else
unless Array.isArray(name)
name = [name]
for n in name
val = req.params?[n] ? req.body?[n] ? req.query?[n]
if val?
return val
return default_value
@map_to_query_string:(map)->
return @map_to_qs(map)
@map_to_qs:(map)->
parts = []
for name, value of (map ? {})
unless Array.isArray(value)
value = [value]
parts = parts.concat value.map((v)->"#{encodeURIComponent(name)}=#{encodeURIComponent(v)}")
return parts.join("&")
@append_query_string:(url, name, value)=>
return @append_qs url, name, value
@append_qs:(url,name,value)=>
if name?
if /\?/.test url
url += "&"
else
url += "?"
if typeof name is 'string' and value?
unless Array.isArray(value)
value = [value]
url += value.map((v)->"#{encodeURIComponent(name)}=#{encodeURIComponent(v)}").join("&")
else if typeof name is 'string' and not value?
url += name
else if typeof name is 'object' and not value?
url += @map_to_qs(name)
else
throw new Error("Not sure what to do with the parameters #{name} and #{value}.")
return url
class IOUtil
@pipe_to_buffer:(readable_stream,callback)=>
data = []
length = 0
readable_stream.on 'data', (chunk)=>
if chunk?
data.push chunk
length += chunk.length
readable_stream.on 'error', (err)=>
callback(err)
readable_stream.on 'end', ()=>
callback null, Buffer.concat(data)
@pipe_to_file:(readable_stream,dest,options,callback)=>
if options? and typeof options is 'function' and not callback?
callback = options
options = null
out = fs.createWriteStream(dest,options)
out.on 'close', callback
out.on 'error', callback
readable_stream.pipe(out)
@download_to_buffer:(url,callback)=>
params = {}
if typeof url is 'string'
params.url = url
else
params = url
request params, (err,response,body)=>
if err?
callback(err)
else unless /^2[0-9][0-9]$/.test request?.statusCode
callback(response,body)
else
callback(null,body)
@download_to_file:(url,dest,options,callback)=>
if options? and typeof options is 'function' and not callback?
callback = options
options = null
params = {}
if typeof url is 'string'
params.url = url
else
params = url
out = fs.createWriteStream(dest,options)
out.on 'close', callback
out.on 'error', callback
request(params).pipe(out)
################################################################################
class ErrorUtil
# **handle_error** - *invoke a callback on error*
#
# If `err` is `null` (or `undefined`), returns
# `false`.
#
# If `err` is not `null`, and `callback` exists,
# invokes `callback(err)` and returns `true`.
#
# If `err` is not `null`, `callback` does not
# exist and `thrown_when_no_callback` is `true`
# (the default), `throws` the given error.
#
# If `err` is not `null`, `callback` does not
# exist and `thrown_when_no_callback` is `false`,
# prints the `err` to STDERR and returns `true`.
#
# Particularly useful for the CoffeeScript idiom:
#
# some_error_generating_function a, b, (err,foo,bar)->
# unless Util.handle_error err, callback
# # ...continue processing...
#
# rather than:
#
# some_error_generating_function a, b, (err,foo,bar)->
# if err?
# callback(err)
# else
# # ...continue processing...
#
@handle_error:(err,callback,throw_when_no_callback=true)=>
throw_when_no_callback ?= true
if err?
if callback?
callback(err)
return true
else if throw_when_no_callback
throw err
else
console.error "ERROR",err
else
return false
################################################################################
class IdUtil
# **uuid** - *normalize or generate a UUID value*
#
# When called with no arguments, generates a new UUID value.
#
# When a UUID value `v` is provided, a normalized value is returned (downcased and
# with any dashes (`-`) removed, matching `/^[0-9a-f]{32}$/`).
#
# E.g., given `02823B75-8C4A-3BC4-7F03-0A8482D5A9AB`, returns `02823b758c4a3bc47f030a8482d5a9ab`.
# If `generate` is `true` and `v` is `null`, a new (normalized) UUID value is generated and returned.
#
# DEPRECATED the `generate=false` default will be changed in some future release; to
# maintain the same behavior switch to `normalize_uuid`. To switch to the
# new behavior now, use `make_uuid` (or variants).
@uuid:(v,generate=false)=>
if arguments.length is 0
generate = true
unless v?
if generate
v = @uuid(uuid.v1())
else
return null
else unless v.replace?
throw new Error("Expected string but found #{typeof v}",v)
else unless /^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$/i.test v
throw new Error("Encountered invalid UUID format #{v}.")
return v.replace(/-/g,'').toLowerCase()
@normalize_uuid:(v,generate=false)=>
generate ?= false
@uuid v, generate
@make_uuid:(v)=>
@uuid(v ? uuid.v1())
@make_uuid_v1:(v)=>
@uuid(v ? uuid.v1())
@make_uuid_v4:(v)=>
@uuid(v ? uuid.v4())
# **pad_uuid** - *normalize or generate a *padded* UUID value*
#
# When a UUID value `v` is provided, a normalized value is returned (matching
# `/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/`).
#
# If `generate` is `true` and `v` is `null`, a new (normalized) UUID value
# is generated and returned.
@pad_uuid:(v,generate=false)=>
generate ?= false
v = @uuid(v,generate)
if v?
return (v.substring(0,8)+"-"+v.substring(8,12)+"-"+v.substring(12,16)+"-"+v.substring(16,20)+"-"+v.substring(20))
else
return null
################################################################################
class Base64
# **b64e** - *encodes a buffer as Base64*
#
# Base64-encodes the given Buffer or string, returning a string.
# When a string value is provided, the optional `output_encoding` attribute
# specifies the encoding to use when converting characters to bytes.
@encode:(buf,output_encoding='utf8')=>
output_encoding ?= 'utf8'
if not buf?
return null
else
unless buf instanceof Buffer
buf = new Buffer(buf.toString(),output_encoding)
return buf.toString('base64')
# **b64d** - *decodes a Base64-encoded string*
#
# Base64-decodes the given Buffer or string, returning a string.
# The optional `output_encoding` attribute specifies the encoding to use
# when converting bytes to characters.
@decode:(buf,output_encoding='utf8')=>
output_encoding ?= 'utf8'
if not buf?
return null
else
unless buf instanceof Buffer
buf = new Buffer(buf.toString(),'base64')
return buf.toString(output_encoding)
################################################################################
# **Util** - *collects assorted utility functions*
class Util
# The call `get_funky_json(json, "foo", "bar")`
# will return `Xyzzy` for both:
#
# json = { foo: { bar: "Xyzzy" } }
#
# and
#
# json = { foo: { bar: {$:"Xyzzy" } } }
#
# This is used to mask the differences between certain XML-to-JSON
# translators. (Source `<foo><bar>Xyzzy</bar></foo>` can be converted
# to either of the above).
@get_funky_json:(json,keys...)=>
@gfj(json,keys...)
@gfj:(json,keys...)->
for key in keys
unless json?
return null
else
json = json[key] ? json["@#{key}"]
value = json?.$ ? json
return value
@version_satisfies:(verstr,rangestr)=>
unless rangestr?
rangestr = verstr
verstr = null
verstr ?= process.version
return semver.satisfies(verstr,rangestr)
@to_unit: DateUtil.to_unit
@start_time: DateUtil.start_time
@duration: DateUtil.duration
@iso_8601_regexp: DateUtil.iso_8601_regexp
@lpad_array: ArrayUtil.lpad_array
@rpad_array: ArrayUtil.rpad_array
@smart_join: ArrayUtil.smart_join
@trim_trailing_null: ArrayUtil.trim_trailing_null
@right_shift_args: ArrayUtil.right_shift_args
@paginate_list: ArrayUtil.paginate_list
@subset_of: ArrayUtil.subset_of
@is_subset_of: ArrayUtil.is_subset_of
@strict_subset_of: ArrayUtil.strict_subset_of
@is_strict_subset_of: ArrayUtil.is_strict_subset_of
@sets_are_equal: ArrayUtil.sets_are_equal
@arrays_are_equal: ArrayUtil.arrays_are_equal
@uniquify: ArrayUtil.uniquify
@round_decimal: NumberUtil.round_decimal
@is_int: NumberUtil.is_int
@to_int: NumberUtil.to_int
@is_float: NumberUtil.is_float
@to_float: NumberUtil.to_float
@is_decimal: NumberUtil.is_float
@to_decimal: NumberUtil.to_float
@remove_null: ObjectUtil.remove_null
@remove_falsey: ObjectUtil.remove_falsey
@merge: ObjectUtil.merge
@shallow_clone: ObjectUtil.shallow_clone
@object_array_to_map: ObjectUtil.object_array_to_map
@hex_to_rgb_triplet: ColorUtil.hex_to_rgb_triplet
@hex_to_rgb_string: ColorUtil.hex_to_rgb_string
@rgb_string_to_triplet: ColorUtil.rgb_string_to_triplet
@rgb_to_hex: ColorUtil.rgb_to_hex
@random_bytes: RandomUtil.random_bytes
@random_hex: RandomUtil.random_hex
@random_alphanumeric: RandomUtil.random_alphanumeric
@random_Alphanumeric: RandomUtil.random_Alphanumeric
@random_string: RandomUtil.random_string
@random_numeric: RandomUtil.random_numeric
@random_alpha: RandomUtil.random_alpha
@random_ALPHA: RandomUtil.random_ALPHA
@random_Alpha: RandomUtil.random_Alpha
@random_element: RandomUtil.random_element
@seed_rng: RandomUtil.seed_rng
@set_rng: RandomUtil.set_rng
@random_digits: RandomUtil._random_digits
@random_value: RandomUtil.random_value
@shuffle: RandomUtil.shuffle
@validate_hashed_password:PasswordUtil.validate_hashed_password
@hash_password:PasswordUtil.hash_password
@slow_equals:ComparatorUtil.slow_equals
@compare:ComparatorUtil.compare
@case_insensitive_compare:ComparatorUtil.case_insensitive_compare
@field_comparator:ComparatorUtil.field_comparator
@path_comparator:ComparatorUtil.path_comparator
@desc_comparator:ComparatorUtil.desc_comparator
@descending_comparator:ComparatorUtil.descending_comparator
@composite_comparator:ComparatorUtil.composite_comparator
@remote_ip:WebUtil.remote_ip
@handle_error:ErrorUtil.handle_error
@uuid:IdUtil.uuid
@pad_uuid:IdUtil.pad_uuid
@b64e:Base64.encode
@b64d:Base64.decode
################################################################################
ArrayUtil.shuffle = RandomUtil.shuffle
################################################################################
exports.ArrayUtil = ArrayUtil
exports.Base64 = Base64
exports.ColorUtil = ColorUtil
exports.ComparatorUtil = ComparatorUtil
exports.DateUtil = DateUtil
exports.ErrorUtil = ErrorUtil
exports.IdUtil = IdUtil
exports.MapUtil = ObjectUtil
exports.NumberUtil = NumberUtil
exports.PasswordUtil = PasswordUtil
exports.RandomUtil = RandomUtil
exports.StringUtil = StringUtil
exports.Util = Util
exports.WebUtil = WebUtil
################################################################################
# (TESTS FOR STDIN METHODS)
# if require.main is module
# if /^-?-?read(-|_)?stdin$/.test process.argv[2]
# console.log Util.read_stdin_sync().toString()
# else if /^-?-?read(-|_)?stdin(-|_)?json$/.test process.argv[2]
# console.log Util.load_json_stdin_sync()
| true | fs = require 'fs'
path = require 'path'
HOMEDIR = path.join(__dirname,'..')
LIB_COV = path.join(HOMEDIR,'lib-cov')
LIB_DIR = if fs.existsSync(LIB_COV) then LIB_COV else path.join(HOMEDIR,'lib')
ObjectUtil = require(path.join(LIB_DIR,'object-util')).ObjectUtil
StringUtil = require(path.join(LIB_DIR,'string-util')).StringUtil
uuid = require 'uuid'
crypto = require 'crypto'
mkdirp = require 'mkdirp'
request = require 'request'
remove = require 'remove'
seedrandom = require 'seedrandom'
semver = require 'semver'
DEBUG = (/(^|,)inote-?util($|,)/i.test process?.env?.NODE_DEBUG) or (/(^|,)Util($|,)/.test process?.env?.NODE_DEBUG)
################################################################################
class DateUtil
@DAY_OF_WEEK = [
"Sunday"
"Monday"
"Tuesday"
"Wednesday"
"Thursday"
"Friday"
"Saturday"
]
@MONTH = [
"January"
"February"
"March"
"April"
"May"
"June"
"July"
"August"
"September"
"October"
"November"
"December"
]
@format_datetime_long:(dt = new Date())=>
if typeof dt is 'string'
try
dt = new Date(dt)
catch e
return null
return "#{@format_date_long(dt)} at #{@format_time_long(dt)}"
@format_time_long:(dt = new Date())=>
hours = dt.getUTCHours() % 12
if hours is 0
hours = 12
minutes = dt.getUTCMinutes()
if minutes < 10
minutes = "0#{minutes}"
if dt.getUTCHours() > 12
ampm = "PM"
else
ampm = "AM"
return "#{hours}:#{minutes} #{ampm} GMT"
@format_date_long:(dt = new Date())=>
if typeof dt is 'string'
try
dt = new Date(dt)
catch e
return null
return "#{@DAY_OF_WEEK[dt.getUTCDay()]} #{dt.getUTCDate()} #{@MONTH[dt.getUTCMonth()]} #{dt.getUTCFullYear()}"
@to_unit:(value,singular,plural)=>
unless plural?
plural = "#{singular}s"
if value is 1 or value is -1
return "#{value} #{singular}"
else
return "#{value} #{plural}"
@start_time: Date.now()
@duration:(now,start)=>
start ?= @start_time
now ?= Date.now()
if start instanceof Date
start = start.getTime()
if now instanceof Date
now = now.getTime()
#
result = {}
result.begin = start
result.end = now
result.delta = now - start
#
duration = result.delta
result.in_millis = {}
result.in_millis.millis = duration % (1000)
result.in_millis.seconds = duration % (1000 * 60)
result.in_millis.minutes = duration % (1000 * 60 * 60)
result.in_millis.hours = duration % (1000 * 60 * 60 * 24)
result.in_millis.days = duration % (1000 * 60 * 60 * 24 * 7)
result.in_millis.weeks = duration % (1000 * 60 * 60 * 24 * 7 * 52)
result.in_millis.years = duration
#
result.raw = {}
result.raw.millis = result.in_millis.millis
result.raw.seconds = result.in_millis.seconds / (1000)
result.raw.minutes = result.in_millis.minutes / (1000 * 60)
result.raw.hours = result.in_millis.hours / (1000 * 60 * 60)
result.raw.days = result.in_millis.days / (1000 * 60 * 60 * 24)
result.raw.weeks = result.in_millis.weeks / (1000 * 60 * 60 * 24 * 7)
result.raw.years = result.in_millis.years / (1000 * 60 * 60 * 24 * 7 * 52)
#
result.whole = {}
result.whole.millis = Math.floor(result.raw.millis)
result.whole.seconds = Math.floor(result.raw.seconds)
result.whole.minutes = Math.floor(result.raw.minutes)
result.whole.hours = Math.floor(result.raw.hours)
result.whole.days = Math.floor(result.raw.days)
result.whole.weeks = Math.floor(result.raw.weeks)
result.whole.years = Math.floor(result.raw.years)
#
result.array = {}
result.array.full = {}
result.array.full.values = [
result.whole.years
result.whole.weeks
result.whole.days
result.whole.hours
result.whole.minutes
result.whole.seconds
result.whole.millis
]
result.array.full.short = [
"#{result.whole.years}y"
"#{result.whole.weeks}w"
"#{result.whole.days}d"
"#{result.whole.hours}h"
"#{result.whole.minutes}m"
"#{result.whole.seconds}s"
"#{result.whole.millis}m"
]
result.array.full.long = [
@to_unit(result.whole.years,"year")
@to_unit(result.whole.weeks,"week")
@to_unit(result.whole.days,"day")
@to_unit(result.whole.hours,"hour")
@to_unit(result.whole.minutes,"minute")
@to_unit(result.whole.seconds,"second")
@to_unit(result.whole.millis,"millisecond")
]
result.array.full.no_millis = {}
result.array.full.no_millis.values = [].concat(result.array.full.values[0...-1])
result.array.full.no_millis.short = [].concat(result.array.full.short[0...-1])
result.array.full.no_millis.long = [].concat(result.array.full.long[0...-1])
#
values = [].concat(result.array.full.values)
values.shift() while values.length > 0 and values[0] is 0
result.array.brief = {}
result.array.brief.values = values
result.array.brief.short = []
result.array.brief.long = []
result.array.brief.no_millis = {}
result.array.brief.no_millis.values = values[0...-1]
result.array.brief.no_millis.short = []
result.array.brief.no_millis.long = []
values = [].concat(values)
for unit in [ 'millisecond','second','minute','hour','day','week','year' ]
v = values.pop()
if v?
result.array.brief.short.unshift "#{v}#{unit.substring(0,1)}"
result.array.brief.long.unshift @to_unit(v,unit)
unless unit is 'millisecond'
result.array.brief.no_millis.short.unshift "#{v}#{unit.substring(0,1)}"
result.array.brief.no_millis.long.unshift @to_unit(v,unit)
else
break
#
result.array.min = {}
result.array.min.units = []
result.array.min.short = []
result.array.min.long = []
result.array.min.no_millis = {}
result.array.min.no_millis.units = []
result.array.min.no_millis.short = []
result.array.min.no_millis.long = []
for unit, i in [ 'year','week','day','hour','minute','second','millisecond']
v = result.array.full.values[i]
unless v is 0
result.array.min.short.push "#{v}#{unit.substring(0,1)}"
result.array.min.long.push @to_unit(v,unit)
result.array.min.units.push unit
unless unit is 'millisecond'
result.array.min.no_millis.short.push "#{v}#{unit.substring(0,1)}"
result.array.min.no_millis.long.push @to_unit(v,unit)
result.array.min.no_millis.units.push unit
#
result.string = {}
result.string.full = {}
result.string.full.micro = result.array.full.short.join('')
result.string.full.short = result.array.full.short.join(' ')
result.string.full.long = result.array.full.long.join(' ')
result.string.full.verbose = ArrayUtil.smart_join(result.array.full.long, ", ", " and ")
result.string.full.no_millis = {}
result.string.full.no_millis.micro = result.array.full.no_millis.short.join('')
result.string.full.no_millis.short = result.array.full.no_millis.short.join(' ')
result.string.full.no_millis.long = result.array.full.no_millis.long.join(' ')
result.string.full.no_millis.verbose = ArrayUtil.smart_join(result.array.full.no_millis.long, ", ", " and ")
result.string.brief = {}
result.string.brief.micro = result.array.brief.short.join('')
result.string.brief.short = result.array.brief.short.join(' ')
result.string.brief.long = result.array.brief.long.join(' ')
result.string.brief.verbose = ArrayUtil.smart_join(result.array.brief.long, ", ", " and ")
result.string.brief.no_millis = {}
result.string.brief.no_millis.micro = result.array.brief.no_millis.short.join('')
result.string.brief.no_millis.short = result.array.brief.no_millis.short.join(' ')
result.string.brief.no_millis.long = result.array.brief.no_millis.long.join(' ')
result.string.brief.no_millis.verbose = ArrayUtil.smart_join(result.array.brief.no_millis.long, ", ", " and ")
result.string.min = {}
result.string.min.micro = result.array.min.short.join('')
result.string.min.short = result.array.min.short.join(' ')
result.string.min.long = result.array.min.long.join(' ')
result.string.min.verbose = ArrayUtil.smart_join(result.array.min.long, ", ", " and ")
result.string.min.no_millis = {}
result.string.min.no_millis.micro = result.array.min.no_millis.short.join('')
result.string.min.no_millis.short = result.array.min.no_millis.short.join(' ')
result.string.min.no_millis.long = result.array.min.no_millis.long.join(' ')
result.string.min.no_millis.verbose = ArrayUtil.smart_join(result.array.min.no_millis.long, ", ", " and ")
return result
# **iso_8601_regexp** - *returns a regular expression that can be used to validate an iso 8601 format date*
# note that currently only the fully-specified datetime format is supported (not dates without times or durations).
@iso_8601_regexp:()=>/^((\d{4})-(\d{2})-(\d{2}))T((\d{2})\:(\d{2})\:((\d{2})(?:\.(\d{3}))?)((?:[A-Za-z]+)|(?:[+-]\d{2}\:\d{2})))$/
################################################################################
################################################################################
class ArrayUtil
@lpad:StringUtil.lpad
@lpad_array:StringUtil.lpad_array
@rpad:StringUtil.rpad
@rpad_array:StringUtil.rpad_array
# ***smart_join*** - *like `Array.prototype.join` but with an optional final delimiter*
#
# E.g., `smart_join(["PI:NAME:<NAME>END_PI","PI:NAME:<NAME>END_PI","PI:NAME:<NAME>END_PI"],", "," and ")` yields `PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI`.
#
# Alternatively, the `delimiter` parameter can be a map of options:
#
# * `before` - appears before the list
# * `first` - appears between the first and second element
# * `last` - appears between the next-to-last and last element
# * `delimiter` - appears between other elements (if any)
# * `after` - appears after the list
#
# E.g., given:
#
# var options = {
# before: "B",
# first: "F",
# delimiter: "D",
# last: "L",
# after: "A"
# }
#
# and
#
# var a = [1,2,3,4,5]
#
# then `smart_join(a,options)` yields `"B1F2D3D4L5A"`.
@smart_join:(array,delimiter,last)=>
unless array?
return null
else
if typeof delimiter is 'object'
options = delimiter
before = options.before
first = options.first
delimiter = options.delimiter
last = options.last
after = options.after
if first? and last?
[head,middle...,tail] = array
else if first? and not last?
[head,middle...] = array
else if last? and not first?
[middle...,tail] = array
else
middle = array
if tail? and middle.length is 0
middle = [tail]
tail = undefined
buffer = []
if before?
buffer.push before
if head?
buffer.push head
if middle?.length > 0
buffer.push first
if middle?
buffer.push middle.join(delimiter)
if tail?
if last?
buffer.push last
buffer.push tail
if after?
buffer.push after
return buffer.join("")
# **trim_trailing_null** - *remove trailing `null` values from an array*
#
# Removes any trailing `null` values from the given array.
# Leading or interspersed `null` values are left alone.
# E.g., given `[null,'foo',null,'bar',null,null]` returns `[null,'foo',null,'bar']`.
@trim_trailing_null: (a)=>
a = [].concat(a)
b = []
while a.length > 0
v = a.pop()
if v?
b.unshift v
else if b.length > 0
b.unshift v
return b
# **right_shift_args** - *convert trailing `null` values to leading `null` values*
#
# Given a list of arguments that might contain trailing `null` values, returns an array
# of the same length, but with leading rather than trailing `null`s.
# E.g,.:
#
# right_shift_args('a',null)
#
# returns:
#
# [ null, 'a' ]
#
# and,
#
# right_shift_args(1,null,2,null,null)
#
# returns:
#
# [ null, null, 1, null, 2 ]
#
# This method can be used to allow the leading arguments to a function to
# be the optional ones. For example, consider the function signature:
#
# function foo(a,b,callback)
#
# Using `right_shift_args` we can make `a` and `b` the optional arguments such that
# `foo(callback)` is equivalent to `foo(null,null,callback)` and `foo('x',callback)`
# is equivalent to `foo(null,'x',callback)`.
#
# In CoffeeScript, this can be achieved with the following idiom:
#
# foo:(a,b,c)->
# [a,b,c] = Util.right_shift_args(a,b,c)
#
# In JavaScript, you'll need to unwind the returned array on your own:
#
# function foo(a,b,c,d) {
# var args = Util.right_shift_args(a,b,c,d);
# a = args[0]; b = args[1]; c = args[2]; d = args[3];
# }
#
@right_shift_args: (values...)=>@lpad(@trim_trailing_null(values),values.length,null)
# **paginate_list** - *extract a sub-array based on offset and limit*
#
# Given a list (array), returns the sublist defined by `offset` and `limit`.
@paginate_list:(list,offset=0,limit=20)=>
offset ?= 0
limit ?= 20
list[offset...(offset+limit)]
# **subset_of** - *check whether on array contains another arrays as if they are sets *
#
# Given two arrays `a` and `b`, returns `true` if every element of
# `a` is also found in `b`.
#
# Note that the arrays are treated as true *sets*. The number of times
# a given entry appears in each array is ignored--only the presence or
# absence of a value is significant. (For example, `[1,1]` is considered
# a subset of `[1]`.)
@subset_of:(a,b)=>
unless a? and Array.isArray(a) and b? and Array.isArray(b)
throw new Error("Expected arrays.")
else
for e in a
unless e in b
return false
return true
# **is_subset_of** - *an alias for `subset_of`*
@is_subset_of:(args...)=>@subset_of(args...)
# **strict_subset_of** - *check whether on array strictly contains another arrays as if they are sets *
#
# Given two arrays `a` and `b`, returns `true` if every element of
# `a` is also found in `b` *and* at least one element of `b` does not
# appear in `a`.
#
# Note that the arrays are treated as true *sets*. The number of times
# a given entry appears in each array is ignored--only the presence or
# absence of a value is significant. (For example, `[1,1]` is considered
# a subset of `[1]`.)
@strict_subset_of:(a,b)=>@subset_of(a,b) and not @subset_of(b,a) # Note: there are probably more efficient ways to do this.
# **is_strict_subset_of** - *an alias for `strict_subset_of`*
@is_strict_subset_of:(args...)=>@strict_subset_of(args...)
# **sets_are_equal** - *compare two arrays as if they were sets*
#
# Given two arrays `a` and `b`, returns `true` if every element of
# `a` is also found in `b` and every element of `b` is also found in `a`.
#
# Note that the arrays are treated as true *sets*. Both the order of
# and number of times a given entry appears in each array is ignored--only
# the presence or absence of a value is significant. (For example, `[1,2]` has
# set equality with `[2,1]` and `[1,2,1]` has set equality with `[2,2,1]`.)
#
# NOTE: currenly only does a shallow comparison
@sets_are_equal:(a,b)=>
unless a? and Array.isArray(a) and b? and Array.isArray(b)
throw new Error("Expected arrays.")
else
for e in a
unless e in b
return false
for e in b
unless e in a
return false
return true
# Returns `true` iff the given arrays contain equal (`===`) elements in the
# exact same order. (Also see `sets_are_equal`).
# Deprecated; use `ObjectUtil.deep_equal` instead
@arrays_are_equal:(a,b)=>
unless a? and Array.isArray(a) and b? and Array.isArray(b)
throw new Error("Expected arrays.")
else
return ObjectUtil.deep_equal(a, b)
# Returns a clone of `array` with duplicate values removed
# When `key` is specified, elements of the array are treated as maps, and the
# specified key field is used to test for equality
@uniquify:(array,key)=>
clone = []
if key?
keys = []
for elt in array
unless elt[key] in keys
clone.push elt
keys.push elt[key]
else
for elt in array
unless elt in clone
clone.push elt
return clone
################################################################################
class NumberUtil
# **round_decimal** - *round a number to the specified precision*
#
# Formats the given `value` as a decimal string with `digits` signficant
# digits to the right of the decimal point.
#
# For example, given `v = 1234.567` then:
#
# - `round_decimal(v,0)` yields `"1235"`
# - `round_decimal(v,1)` yields `"1234.6"`
# - `round_decimal(v,2)` yields `"1234.57"`
# - `round_decimal(v,3)` yields `"1234.567"`
# - `round_decimal(v,4)` yields `"1234.5670"`
# - `round_decimal(v,5)` yields `"1234.56700"`
# - `round_decimal(v,-1)` yields `"1230"`
# - `round_decimal(v,-2)` yields `"1200"`
# - `round_decimal(v,-3)` yields `"1000"`
# - `round_decimal(v,-4)` yields `"0"`
#
# Returns `null` if `value` is not a number and cannot
# be coerced into one. (Note that this method uses a less
# permissive form of coercion that `parseInt` and `parseFloat`.
# The input value must be a decimal string in standard (non-scientific)
# notation.)
@round_decimal:(value,digits=0)=>
digits ?= 0
unless value?
return null
else
unless typeof value is 'number'
if /^\s*-?(([0-9]+(\.[0-9]+))|(\.[0-9]+))\s*$/.test "#{value}"
value = parseFloat(value)
else
return null
if isNaN(value)
return null
else if digits >= 0
return value.toFixed(digits)
else
factor = Math.pow(10,Math.abs(digits))
return "#{(Math.round(value/factor))*factor}"
# **is_int** - *check if the given object is an (optionally signed) simple integer value*
#
# Returns `true` if the given value is (or can be converted to) a
# valid integer (without any rounding). E.g., `is_int(3)` and `is_int("3")`
# yield `true` but `is_int(3.14159)` and `is_int("3.0")` yield `false`.
@is_int:(v)=>
unless v?
return false
else
return /^-?((0)|([1-9][0-9]*))$/.test "#{v}"
# **to_int** - *returns a valid integer or null*
@to_int:(v)=>
if @is_int(v)
v = parseInt(v)
if isNaN(v)
return null
else
return v
else
return null
@is_float:(v)=>
unless v?
return false
else
return /^-?((((0)|([1-9][0-9]*))(\.[0-9]+)?)|(\.[0-9]+))$/.test "#{v}"
@to_float:(v)=>
if @is_float(v)
v = parseFloat(v)
if isNaN(v)
return null
else
return v
else
return null
################################################################################
class ColorUtil
# **hex_to_rgb_triplet** - *convert a hex-based `#rrggbb` string to decimal `[r,g,b]` values*
#
# Given an HTML/CSS-style hex color string, yields an array of the R,G and B values.
# E.g. `hex_to_rgb("#3300FF")` yields `[51,0,255]`.
# The leading `#` character is optional, and both uppercase and lowercase letters
# are supported.
@hex_to_rgb_triplet:(hex)=>
result = /^\s*#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})\s*$/i.exec(hex)
if result?
return [
parseInt(result[1],16)
parseInt(result[2],16)
parseInt(result[3],16)
]
else
return null
# **hex_to_rgb_strng** - *convert a hex-based `#rrggbb` string to a decimal-based `rgb(r,g,b)` string*
#
# Given an HTML/CSS-style hex color string, yields the corresponding `rgb(R,G,B)`
# form. E.g. `hex_to_rgb("#3300FF")` yields `rgb(51,0,255)`.
# The leading `#` character is optional, and both uppercase and lowercase letters
# are supported.
@hex_to_rgb_string:(hex)=>
[r,g,b] = @hex_to_rgb_triplet(hex) ? [null,null,null]
if r? and g? and b?
return "rgb(#{r},#{g},#{b})"
else
return null
# **rgb_string_to_triplet** - *extract the `[r,g,b]` values from an `rgb(r,g,b)` string*
@rgb_string_to_triplet:(rgb)=>
result = /^\s*rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)\s*$/i.exec(rgb)
if result?
r = parseInt(result[1])
g = parseInt(result[2])
b = parseInt(result[3])
return [r,g,b]
else
return null
# **rgb_to_hex** - *convert `r`, `g` and `b` components or an `rgb(r,g,b`) string to a hex-based `#rrggbb` string*
#
# Given an RGB triplet returns the equivalent HTML/CSS-style hex string.
# E.g, `rgb_to_hex(51,0,255)` yields `#3300FF`.
@rgb_to_hex:(r,g,b)=>
if typeof r is 'string' and not g? and not b?
[r,g,b] = @rgb_string_to_triplet(r) ? [null,null,null]
unless r? and g? and b?
return null
else
i2h = (i)->
h = i.toString(16)
return if h.length is 1 then "0#{h}" else h
return "##{i2h(r)}#{i2h(g)}#{i2h(b)}"
################################################################################
class RandomUtil
# **random_bytes** - *generate a string of random bytes*
#
# Generates a string of `count` pseudo-random bytes in the specified encoding.
# (Defaults to `hex`.)
#
# Note that `count` specifies the number of *bytes* to be generated. The encoded
# string may be more or less than `count` *characters*.
@random_bytes:(count=32,enc='hex')=>
count ?= 32
enc ?= 'hex'
if typeof count is 'string'
if typeof enc is 'number'
[count,enc] = [enc,count]
else
enc = count
count = 32
bytes = crypto.randomBytes(count)
if /buffer/i.test enc
return bytes
else
return bytes.toString(enc)
@seed_rng:(seed)->
return new Math.seedrandom(seed)
@set_rng:(rng)=>
@rng = rng ? new Math.seedrandom()
@rng:Math.random
# **random_hex** - *generate a string of `count` pseudo-random characters from the set ``[0-9a-f]``.
@random_hex:(count=32,rng)=>
count ?= 32
@_random_digits(count,16,rng)
# **random_alphanumeric** - *generate a string of `count` pseudo-random characters from the set `[a-z0-9]`.
@random_alphanumeric:(count=32,rng)=>
count ?= 32
@_random_digits(count,36,rng)
# **random_numeric** - *generate a string of `count` pseudo-random characters from the set `[0-9]`.*
@random_numeric:(count=32,rng)=>
count ?= 32
@_random_digits(count,10,rng)
# **random_Alpha** - *generate a string of `count` pseudo-random characters from the set `[a-zA-Z]` (mixed case).
@random_Alpha:(count=32,rng)=>
count ?= 32
@_random_alpha(count,'M',rng)
# **random_ALPHA** - *generate a string of `count` pseudo-random characters from the set `[A-Z]` (upper case).
@random_ALPHA:(count=32,rng)=>
count ?= 32
@_random_alpha(count,'U',rng)
# **random_alpha** - *generate a string of `count` pseudo-random characters from the set `[a-z]` (lower case).
@random_alpha:(count=32,rng)=>
count ?= 32
@_random_alpha(count,'L',rng)
@random_Alphanumeric:(count=32,rng)=>
count ?= 32
@random_string "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", count, rng
@random_string:(alphabet,count,rng)=>
if typeof alphabet is 'function' and not count? and not rng?
rng = alphabet
count = null
alphabet = null
if typeof count is 'function' and not rng?
rng = count
count = null
if typeof alphabet is 'number' and typeof count isnt 'number'
count = alphabet
alphabet = null
alphabet ?= "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
count ?= 32
rng ?= @rng
result = ""
for i in [0...count]
result += alphabet[Math.floor(rng()*alphabet.length)]
return result
# lettercase = 'upper', 'lower', 'both' (or 'mixed')
@_random_alpha:(count=32,lettercase='lower',rng)=>
count ?= 32
lettercase ?= 'lower'
rng ?= @rng
str = ""
include_upper = /^(u|b|m)/i.test lettercase
include_lower = not /^u/i.test lettercase # everything but `UPPER` includes `LOWER`, to avoid both checks being false
while str.length < count
char = Math.floor(rng()*26)
if include_upper and include_lower
if rng() > 0.5
char += 97 # a
else
char += 65 # A
else if include_upper
char += 65 # A
else
char += 97 # a
str += String.fromCharCode(char)
return str
# **random_element** - *selects a random element from the given array (or map)*
# In the case of a map, a random key/value pair will be returned as a two-element array.
@random_element:(collection,rng)=>
unless collection?
return undefined
else
if Array.isArray(collection)
unless collection.length > 0
return undefined
else
rng ?= @rng
index = Math.floor(rng()*collection.length)
return collection[index]
else if collection? and typeof collection is 'object'
key = @random_element(Object.keys(collection),rng)
return [key,collection[key]]
# **_random_digits** - *generate a string of random bytes in the specfied base number system*
# (An internal method that generates `count` characters in the specified base.)
@_random_digits:(args...)=> #count=32,base,rng
ints = []
rng = null
while args.length > 0
a = args.shift()
if typeof a is 'function'
if rng?
throw new Error("Unexpected arguments: #{args}")
else
rng = a
else
if ints.length is 2 and a?
throw new Error("Unexpected arguments: #{args}")
else
ints.push a
[count,base] = ints
count ?= 32
base ?= 10
rng ?= @rng
str = ""
while str.length < count
str += rng().toString(base).substring(2)
if str.length > count
str = str.substring(0,count)
return str
# performs an IN PLACE shuffle of the given array
@shuffle:(list)->
if list? and Array.isArray(list) and list.length > 1
for i in [(list.length-1)..0]
j = Math.floor(Math.random() * (i + 1))
x = list[i]
list[i] = list[j]
list[j] = x
return list
@random_value:(min,max,rng)=>
if typeof max is 'function' and not rng?
rng = max
max = undefined
if typeof min is 'function' and not rng?
rng = min
min = undefined
if typeof min is 'number' and not max?
max = min
min = undefined
min ?= 0
max ?= 1
if max < min
[min, max] = [max, min]
rng ?= @rng ? Math.random
range = max - min
value = min + (rng()*range)
return value
# Assign the given (non-null) identifier to a randomly selected category such that:
# 1. For a given collection of identifiers results will be randomly distributed among the categories.
# 2. For a given identifier the result will be the same every time the method is called.
# The `categories` parameter is optional:
# - when missing, identifiers will be randomly assigned to either `true` or `false`
# - when an value between 0 and 1, identifiers will be assigned to either `true` or `false`, with `true` appearing `100*value` % of the time
# - when an array, identifiers will be assigned to an element of the array with equal probability
@randomly_assign:(id, categories)=>
categories ?= [true, false]
if typeof categories is 'number'
if categories < 0 or categories > 1
throw new Error("Expected a value between 0 and 1 (inlcusive). Found #{categories}.")
else
value = @random_value 0, 1, @seed_rng(id)
return value <= categories
else if Array.isArray(categories)
value = @random_element categories, @seed_rng(id)
else
throw new Error("Expected a number or an array. Found #{typeof categories}: #{categories}")
################################################################################
class PasswordUtil
# Compare the `expected_digest` with the hash computed from the remaining
# parameters.
@validate_hashed_password:(expected_digest,password,salt,pepper,hash_type)=>
[salt,digest] = @hash_password(password,salt,pepper,hash_type)
password = undefined # forget password when no longer needed
return Util.slow_equals(expected_digest,digest)[0]
# Hash the given `password`, optionally using the given `salt`.
# If no `salt` is provided a new random salt will be generated.
# Returns `[salt,digest]`.
# options := { password, salt, pepper, hash_type }
@hash_password:(password,salt,pepper,hash_type)=>
# parse input parameters
if typeof password is 'object'
hash_type = password.hash_type
pepper = password.pepper
salt = password.salt
password = PI:PASSWORD:<PASSWORD>END_PI
# set defaults
hash_type ?= 'sha512'
salt ?= 64
# convert types
password = new Buffer(password) if password? and not Buffer.isBuffer(password)
pepper = new Buffer(pepper) if pepper? and not Buffer.isBuffer(pepper)
if typeof salt is 'number'
salt = RandomUtil.random_bytes(salt,'buffer')
else unless Buffer.isBuffer(salt)
salt = new Buffer(salt)
# validate inputs
if not password?
throw new Error("password parameter is required")
else
# calculate hash
hash = crypto.createHash(hash_type)
hash.update salt
if pepper?
hash.update pepper
hash.update password
password = undefined # forget password when no longer needed
digest = hash.digest()
# return generated salt and calculated hash
return [salt,digest]
################################################################################
class ComparatorUtil
# **slow_equals** - *constant-time comparison of two buffers for equality*
# Performs a byte by byte comparision of the given buffers
# but does it in *constant* time (rather than aborting as soon
# as a delta is discovered). `a^b` (`a xor b`) would be better
# if supported.
#
# To prevent optimizations from short-cutting this process, an array
# containing `[ equal?, number-of-identical-bytes, number-of-different-bytes ]`
# is returned.
#
# For equality tests, you'll want something like `if(Util.slow_equals(a,b)[0])`.
#
@slow_equals:(a,b)=>
same_count = delta_count = 0
if b.length > a.length
[a,b] = [b,a]
for i in [0...a.length]
if a[i] isnt b[i]
delta_count += 1
else
same_count += 1
if (delta_count is 0 and a.length is b.length)
return [true,same_count,delta_count]
else
return [false,same_count,delta_count]
# **compare** - *a basic comparator function*
#
# A basic comparator.
#
# When `a` and `b` are strings, they are compared in a case-folded
# sort (both 'A' and `a` before both `B` and 'b') using
# `String.prototype.localeCompare`.
#
# Otherwise JavaScript's default `<` and `>` operators are used.
#
# This method allows `null` values, which are sorted before any non-null values.
#
# Returns:
# - a positive integer when `a > b`, or when `a` is not `null` and `b` is `null`
# - a negative integer when `a < b`, or when `a` is `null` and `b` is not `null`
# - zero (`0`) otherwise (when `!(a > b) && !(a < b)` or when both `a` and `b` are `null`).
@compare:(a,b)=>
if a? and b?
if a.localeCompare? and b.localeCompare? and a.toUpperCase? and b.toUpperCase?
A = a.toUpperCase()
B = b.toUpperCase()
val = A.localeCompare(B)
if val is 0
return a.localeCompare(b)
else
return val
else
return (if a > b then 1 else (if a < b then -1 else 0))
else if a? and not b?
return 1
else if b? and not a?
return -1
else
return 0
# DEPRECATED - just use @compare
@case_insensitive_compare:(a,b)=>@compare(a,b)
# **field_comparator** - *compares objects based on an attribute*
#
# Generates a comparator that compares objects based on the specified field.
# E.g., `field_comparator('foo')` will compare two objects `A` and `B`
# based on the value of `A.foo` and `B.foo`.
#
# When `locale_compare` is `true`, string-valued fields will be compared using
# the `localeCompare` function. Otherwise the (ASCII-betical) `<` and `>`
# operators are used.
#
# Also see `compare`.
#
@field_comparator:(field,locale_compare=false)=>
locale_compare = false
@path_comparator([field],locale_compare)
# **path_operator** - *compares objects based on (optionally nested) attributes*
#
# Generates a comparator that compares objects based on the value obtained
# by walking the given path (in an object graph).
#
# E.g., `path_comparator(['foo','bar'])` will compare two objects `A` and `B`
# based on the value of `A.foo.bar` and `B.foo.bar`.
#
# If a `null` value is encountered while walking the object-graph, the
# two values are immediately compared. (Hence given:
#
# a = { foo: null }
# b = { foo: { bar: null } }
# path = [ 'foo','bar' ]
#
# `path_comparator(path)(a,b)` will compare `null` and `{ bar: null }`, since
# the value of `a.foo` is `null`.)
#
# When `locale_compare` is `true`, string-valued fields will be compared using
# the `localeCompare` function. Otherwise the (ASCII-betical) `<` and `>`
# operators are used.
#
# Also see `compare`.
#
@path_comparator:(path,locale_compare=false)=>
locale_compare = false
(a,b)=>
fn = null
if locale_compare
fn = Util.compare
else
fn = (a,b)=>
if a? and b?
return (if a > b then 1 else (if a < b then -1 else 0))
else if a? and not b?
return 1
else if b? and not a?
return -1
else
return 0
A = a
B = b
for f in path
A = A?[f]
B = B?[f]
unless A? and B? # should we continue walking the graph if one of the values is not-null?
return fn(A,B)
return fn(A,B)
# **desc_comparator** - *reverses another comparison function.*
#
# Generates a comparator that reverses the sort order of the input comparator.
# I.e., if when sorted by comparator `c` an array is ordered `[1,2,3]`, the
# array will be ordered `[3,2,1]` when sorted by `desc_comparator(c)`.
@desc_comparator:(c)=>((a,b)->(c(b,a)))
# **descending_comparator** - *an alias for `desc_comparator`*
@descending_comparator:(args...)=>@desc_comparator(args...)
# **composite_comparator** - *chains several comparison functions into one*
#
# Given a list (array) of comparators, generates a comparator that first
# compares elements by list[0], then list[1], etc. until a non-equal
# comparision is found, or we run out of comparators.
@composite_comparator:(list)=>
(a,b)->
for c in list
r = c(a,b)
unless r is 0
return r
return 0
################################################################################
class WebUtil
# Identifies the "client IP" for the given request in various circumstances
@remote_ip:(req)=>
req?.get?('x-forwarded-for') ?
req?.headers?['x-forwarded-for'] ?
req?.connection?.remoteAddress ?
req?.socket?.remoteAddress ?
req?.connection?.socket?.remoteAddress
# replaces the now deprecated `req.param` found in Express.js
@param:(req, name, default_value)=>
unless req? and name?
return default_value
else
unless Array.isArray(name)
name = [name]
for n in name
val = req.params?[n] ? req.body?[n] ? req.query?[n]
if val?
return val
return default_value
@map_to_query_string:(map)->
return @map_to_qs(map)
@map_to_qs:(map)->
parts = []
for name, value of (map ? {})
unless Array.isArray(value)
value = [value]
parts = parts.concat value.map((v)->"#{encodeURIComponent(name)}=#{encodeURIComponent(v)}")
return parts.join("&")
@append_query_string:(url, name, value)=>
return @append_qs url, name, value
@append_qs:(url,name,value)=>
if name?
if /\?/.test url
url += "&"
else
url += "?"
if typeof name is 'string' and value?
unless Array.isArray(value)
value = [value]
url += value.map((v)->"#{encodeURIComponent(name)}=#{encodeURIComponent(v)}").join("&")
else if typeof name is 'string' and not value?
url += name
else if typeof name is 'object' and not value?
url += @map_to_qs(name)
else
throw new Error("Not sure what to do with the parameters #{name} and #{value}.")
return url
class IOUtil
@pipe_to_buffer:(readable_stream,callback)=>
data = []
length = 0
readable_stream.on 'data', (chunk)=>
if chunk?
data.push chunk
length += chunk.length
readable_stream.on 'error', (err)=>
callback(err)
readable_stream.on 'end', ()=>
callback null, Buffer.concat(data)
@pipe_to_file:(readable_stream,dest,options,callback)=>
if options? and typeof options is 'function' and not callback?
callback = options
options = null
out = fs.createWriteStream(dest,options)
out.on 'close', callback
out.on 'error', callback
readable_stream.pipe(out)
@download_to_buffer:(url,callback)=>
params = {}
if typeof url is 'string'
params.url = url
else
params = url
request params, (err,response,body)=>
if err?
callback(err)
else unless /^2[0-9][0-9]$/.test request?.statusCode
callback(response,body)
else
callback(null,body)
@download_to_file:(url,dest,options,callback)=>
if options? and typeof options is 'function' and not callback?
callback = options
options = null
params = {}
if typeof url is 'string'
params.url = url
else
params = url
out = fs.createWriteStream(dest,options)
out.on 'close', callback
out.on 'error', callback
request(params).pipe(out)
################################################################################
class ErrorUtil
# **handle_error** - *invoke a callback on error*
#
# If `err` is `null` (or `undefined`), returns
# `false`.
#
# If `err` is not `null`, and `callback` exists,
# invokes `callback(err)` and returns `true`.
#
# If `err` is not `null`, `callback` does not
# exist and `thrown_when_no_callback` is `true`
# (the default), `throws` the given error.
#
# If `err` is not `null`, `callback` does not
# exist and `thrown_when_no_callback` is `false`,
# prints the `err` to STDERR and returns `true`.
#
# Particularly useful for the CoffeeScript idiom:
#
# some_error_generating_function a, b, (err,foo,bar)->
# unless Util.handle_error err, callback
# # ...continue processing...
#
# rather than:
#
# some_error_generating_function a, b, (err,foo,bar)->
# if err?
# callback(err)
# else
# # ...continue processing...
#
@handle_error:(err,callback,throw_when_no_callback=true)=>
throw_when_no_callback ?= true
if err?
if callback?
callback(err)
return true
else if throw_when_no_callback
throw err
else
console.error "ERROR",err
else
return false
################################################################################
class IdUtil
# **uuid** - *normalize or generate a UUID value*
#
# When called with no arguments, generates a new UUID value.
#
# When a UUID value `v` is provided, a normalized value is returned (downcased and
# with any dashes (`-`) removed, matching `/^[0-9a-f]{32}$/`).
#
# E.g., given `02823B75-8C4A-3BC4-7F03-0A8482D5A9AB`, returns `02823b758c4a3bc47f030a8482d5a9ab`.
# If `generate` is `true` and `v` is `null`, a new (normalized) UUID value is generated and returned.
#
# DEPRECATED the `generate=false` default will be changed in some future release; to
# maintain the same behavior switch to `normalize_uuid`. To switch to the
# new behavior now, use `make_uuid` (or variants).
@uuid:(v,generate=false)=>
if arguments.length is 0
generate = true
unless v?
if generate
v = @uuid(uuid.v1())
else
return null
else unless v.replace?
throw new Error("Expected string but found #{typeof v}",v)
else unless /^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$/i.test v
throw new Error("Encountered invalid UUID format #{v}.")
return v.replace(/-/g,'').toLowerCase()
@normalize_uuid:(v,generate=false)=>
generate ?= false
@uuid v, generate
@make_uuid:(v)=>
@uuid(v ? uuid.v1())
@make_uuid_v1:(v)=>
@uuid(v ? uuid.v1())
@make_uuid_v4:(v)=>
@uuid(v ? uuid.v4())
# **pad_uuid** - *normalize or generate a *padded* UUID value*
#
# When a UUID value `v` is provided, a normalized value is returned (matching
# `/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/`).
#
# If `generate` is `true` and `v` is `null`, a new (normalized) UUID value
# is generated and returned.
@pad_uuid:(v,generate=false)=>
generate ?= false
v = @uuid(v,generate)
if v?
return (v.substring(0,8)+"-"+v.substring(8,12)+"-"+v.substring(12,16)+"-"+v.substring(16,20)+"-"+v.substring(20))
else
return null
################################################################################
class Base64
# **b64e** - *encodes a buffer as Base64*
#
# Base64-encodes the given Buffer or string, returning a string.
# When a string value is provided, the optional `output_encoding` attribute
# specifies the encoding to use when converting characters to bytes.
@encode:(buf,output_encoding='utf8')=>
output_encoding ?= 'utf8'
if not buf?
return null
else
unless buf instanceof Buffer
buf = new Buffer(buf.toString(),output_encoding)
return buf.toString('base64')
# **b64d** - *decodes a Base64-encoded string*
#
# Base64-decodes the given Buffer or string, returning a string.
# The optional `output_encoding` attribute specifies the encoding to use
# when converting bytes to characters.
@decode:(buf,output_encoding='utf8')=>
output_encoding ?= 'utf8'
if not buf?
return null
else
unless buf instanceof Buffer
buf = new Buffer(buf.toString(),'base64')
return buf.toString(output_encoding)
################################################################################
# **Util** - *collects assorted utility functions*
class Util
# The call `get_funky_json(json, "foo", "bar")`
# will return `Xyzzy` for both:
#
# json = { foo: { bar: "Xyzzy" } }
#
# and
#
# json = { foo: { bar: {$:"Xyzzy" } } }
#
# This is used to mask the differences between certain XML-to-JSON
# translators. (Source `<foo><bar>Xyzzy</bar></foo>` can be converted
# to either of the above).
@get_funky_json:(json,keys...)=>
@gfj(json,keys...)
@gfj:(json,keys...)->
for key in keys
unless json?
return null
else
json = json[key] ? json["@#{key}"]
value = json?.$ ? json
return value
@version_satisfies:(verstr,rangestr)=>
unless rangestr?
rangestr = verstr
verstr = null
verstr ?= process.version
return semver.satisfies(verstr,rangestr)
@to_unit: DateUtil.to_unit
@start_time: DateUtil.start_time
@duration: DateUtil.duration
@iso_8601_regexp: DateUtil.iso_8601_regexp
@lpad_array: ArrayUtil.lpad_array
@rpad_array: ArrayUtil.rpad_array
@smart_join: ArrayUtil.smart_join
@trim_trailing_null: ArrayUtil.trim_trailing_null
@right_shift_args: ArrayUtil.right_shift_args
@paginate_list: ArrayUtil.paginate_list
@subset_of: ArrayUtil.subset_of
@is_subset_of: ArrayUtil.is_subset_of
@strict_subset_of: ArrayUtil.strict_subset_of
@is_strict_subset_of: ArrayUtil.is_strict_subset_of
@sets_are_equal: ArrayUtil.sets_are_equal
@arrays_are_equal: ArrayUtil.arrays_are_equal
@uniquify: ArrayUtil.uniquify
@round_decimal: NumberUtil.round_decimal
@is_int: NumberUtil.is_int
@to_int: NumberUtil.to_int
@is_float: NumberUtil.is_float
@to_float: NumberUtil.to_float
@is_decimal: NumberUtil.is_float
@to_decimal: NumberUtil.to_float
@remove_null: ObjectUtil.remove_null
@remove_falsey: ObjectUtil.remove_falsey
@merge: ObjectUtil.merge
@shallow_clone: ObjectUtil.shallow_clone
@object_array_to_map: ObjectUtil.object_array_to_map
@hex_to_rgb_triplet: ColorUtil.hex_to_rgb_triplet
@hex_to_rgb_string: ColorUtil.hex_to_rgb_string
@rgb_string_to_triplet: ColorUtil.rgb_string_to_triplet
@rgb_to_hex: ColorUtil.rgb_to_hex
@random_bytes: RandomUtil.random_bytes
@random_hex: RandomUtil.random_hex
@random_alphanumeric: RandomUtil.random_alphanumeric
@random_Alphanumeric: RandomUtil.random_Alphanumeric
@random_string: RandomUtil.random_string
@random_numeric: RandomUtil.random_numeric
@random_alpha: RandomUtil.random_alpha
@random_ALPHA: RandomUtil.random_ALPHA
@random_Alpha: RandomUtil.random_Alpha
@random_element: RandomUtil.random_element
@seed_rng: RandomUtil.seed_rng
@set_rng: RandomUtil.set_rng
@random_digits: RandomUtil._random_digits
@random_value: RandomUtil.random_value
@shuffle: RandomUtil.shuffle
@validate_hashed_password:PasswordUtil.validate_hashed_password
@hash_password:PasswordUtil.hash_password
@slow_equals:ComparatorUtil.slow_equals
@compare:ComparatorUtil.compare
@case_insensitive_compare:ComparatorUtil.case_insensitive_compare
@field_comparator:ComparatorUtil.field_comparator
@path_comparator:ComparatorUtil.path_comparator
@desc_comparator:ComparatorUtil.desc_comparator
@descending_comparator:ComparatorUtil.descending_comparator
@composite_comparator:ComparatorUtil.composite_comparator
@remote_ip:WebUtil.remote_ip
@handle_error:ErrorUtil.handle_error
@uuid:IdUtil.uuid
@pad_uuid:IdUtil.pad_uuid
@b64e:Base64.encode
@b64d:Base64.decode
################################################################################
ArrayUtil.shuffle = RandomUtil.shuffle
################################################################################
exports.ArrayUtil = ArrayUtil
exports.Base64 = Base64
exports.ColorUtil = ColorUtil
exports.ComparatorUtil = ComparatorUtil
exports.DateUtil = DateUtil
exports.ErrorUtil = ErrorUtil
exports.IdUtil = IdUtil
exports.MapUtil = ObjectUtil
exports.NumberUtil = NumberUtil
exports.PasswordUtil = PasswordUtil
exports.RandomUtil = RandomUtil
exports.StringUtil = StringUtil
exports.Util = Util
exports.WebUtil = WebUtil
################################################################################
# (TESTS FOR STDIN METHODS)
# if require.main is module
# if /^-?-?read(-|_)?stdin$/.test process.argv[2]
# console.log Util.read_stdin_sync().toString()
# else if /^-?-?read(-|_)?stdin(-|_)?json$/.test process.argv[2]
# console.log Util.load_json_stdin_sync()
|
[
{
"context": " # MarionetteApp.Models.MyModel.create({name: 'foo'})\n # MarionetteApp.Models.MyModel.find(21)\n ",
"end": 130,
"score": 0.7627394199371338,
"start": 127,
"tag": "NAME",
"value": "foo"
}
] | app/assets/javascripts/portland/traits/cachable_model.js.coffee | ralfthewise/portland | 0 | Portland.Traits.CachableModel =
# this trait allows you to do things like:
# MarionetteApp.Models.MyModel.create({name: 'foo'})
# MarionetteApp.Models.MyModel.find(21)
# Mixin like this:
# mixin(@, MarionetteApp.Traits.CachableModel)
cachable: true
included: (traitable) ->
traitable.cachedModels = {}
create: (idOrAttributes, options) -> @_fromAttributes(idOrAttributes, options)
find: (idOrAttributes, options) -> @_fromAttributes(idOrAttributes, options)
_fromAttributes: (idOrAttributes, options = {}) ->
#determine our attributes hash since idOrAttributes can be undefined, an id, or a hash
attributes = switch
when not idOrAttributes? then {}
when _.isObject(idOrAttributes) then idOrAttributes
else
(a = {})[@::.idAttribute] = idOrAttributes
a
#lookup our cached model
id = attributes[@::.idAttribute]
if id?
model = @cachedModels[id]
if model?
model.set(attributes)
else
model = (@cachedModels[id] = new @(attributes, options))
else
model = new @(attributes, options)
model.once("change:#{model.idAttribute}", => @cachedModels[model.id] = model)
_fetchIfNeeded(model, options)
return model
_fetchIfNeeded = (model, options) ->
return unless model?
if options.fetch is true
model.fetch()
else if options.fetch isnt false
# fetch if it only has default values
defaultKeys = _.union([model.idAttribute],_.keys(_.result(model,'defaults')||{}))
model.fetch() if (not model.isNew() and _.isEmpty(_.omit(model.attributes, defaultKeys)))
| 98667 | Portland.Traits.CachableModel =
# this trait allows you to do things like:
# MarionetteApp.Models.MyModel.create({name: '<NAME>'})
# MarionetteApp.Models.MyModel.find(21)
# Mixin like this:
# mixin(@, MarionetteApp.Traits.CachableModel)
cachable: true
included: (traitable) ->
traitable.cachedModels = {}
create: (idOrAttributes, options) -> @_fromAttributes(idOrAttributes, options)
find: (idOrAttributes, options) -> @_fromAttributes(idOrAttributes, options)
_fromAttributes: (idOrAttributes, options = {}) ->
#determine our attributes hash since idOrAttributes can be undefined, an id, or a hash
attributes = switch
when not idOrAttributes? then {}
when _.isObject(idOrAttributes) then idOrAttributes
else
(a = {})[@::.idAttribute] = idOrAttributes
a
#lookup our cached model
id = attributes[@::.idAttribute]
if id?
model = @cachedModels[id]
if model?
model.set(attributes)
else
model = (@cachedModels[id] = new @(attributes, options))
else
model = new @(attributes, options)
model.once("change:#{model.idAttribute}", => @cachedModels[model.id] = model)
_fetchIfNeeded(model, options)
return model
_fetchIfNeeded = (model, options) ->
return unless model?
if options.fetch is true
model.fetch()
else if options.fetch isnt false
# fetch if it only has default values
defaultKeys = _.union([model.idAttribute],_.keys(_.result(model,'defaults')||{}))
model.fetch() if (not model.isNew() and _.isEmpty(_.omit(model.attributes, defaultKeys)))
| true | Portland.Traits.CachableModel =
# this trait allows you to do things like:
# MarionetteApp.Models.MyModel.create({name: 'PI:NAME:<NAME>END_PI'})
# MarionetteApp.Models.MyModel.find(21)
# Mixin like this:
# mixin(@, MarionetteApp.Traits.CachableModel)
cachable: true
included: (traitable) ->
traitable.cachedModels = {}
create: (idOrAttributes, options) -> @_fromAttributes(idOrAttributes, options)
find: (idOrAttributes, options) -> @_fromAttributes(idOrAttributes, options)
_fromAttributes: (idOrAttributes, options = {}) ->
#determine our attributes hash since idOrAttributes can be undefined, an id, or a hash
attributes = switch
when not idOrAttributes? then {}
when _.isObject(idOrAttributes) then idOrAttributes
else
(a = {})[@::.idAttribute] = idOrAttributes
a
#lookup our cached model
id = attributes[@::.idAttribute]
if id?
model = @cachedModels[id]
if model?
model.set(attributes)
else
model = (@cachedModels[id] = new @(attributes, options))
else
model = new @(attributes, options)
model.once("change:#{model.idAttribute}", => @cachedModels[model.id] = model)
_fetchIfNeeded(model, options)
return model
_fetchIfNeeded = (model, options) ->
return unless model?
if options.fetch is true
model.fetch()
else if options.fetch isnt false
# fetch if it only has default values
defaultKeys = _.union([model.idAttribute],_.keys(_.result(model,'defaults')||{}))
model.fetch() if (not model.isNew() and _.isEmpty(_.omit(model.attributes, defaultKeys)))
|
[
{
"context": "ebars._escape is used to prevent formatting like <a@b.com>\n # from being injected as live html.\n ",
"end": 1027,
"score": 0.9937286376953125,
"start": 1020,
"tag": "EMAIL",
"value": "a@b.com"
}
] | client/controllers/text.coffee | ecohealthalliance/grits-diagnostic-dashboard-release | 0 | color = (feature) =>
@grits.services.color Template.dash.getIdKeyFromFeature(feature)
Template.text.highlight = (content) ->
features = Session.get('features')
if features and content and (features instanceof Array)
if features?.length > 0 and features[0].textOffsets
# sort occurrences in descending order of start, so that we can add them
# to the content string from end to beginning, so that offsets remain
# valid.
featuresByOccurrence = []
for feature in features
for occurrence in feature.textOffsets
featuresByOccurrence.push
name: feature.name
feature: feature
occurrence: occurrence
featuresByOccurrence = _.sortBy(featuresByOccurrence, (feature) -> feature.occurrence[0])
highlightedContent = ''
last_idx = 0
for feature in featuresByOccurrence
occurrence = feature.occurrence
if occurrence[0] >= last_idx
# Handlebars._escape is used to prevent formatting like <a@b.com>
# from being injected as live html.
highlightedContent += Handlebars._escape(content.substring(last_idx, occurrence[0]))
if feature.feature.color
bgColor = feature.feature.color
else
bgColor = color(feature.feature)
highlightText = Handlebars._escape(content.substring(occurrence[0], occurrence[1]))
highlightedContent += """<span
class='label'
style='
background-color:#{bgColor};
box-shadow: 0px 0px 0px 2px #{bgColor};
'>#{highlightText}</span>"""
last_idx = occurrence[1]
highlightedContent += Handlebars._escape(content.substring(last_idx, content.length))
return new Spacebars.SafeString(highlightedContent)
else if features?.length > 0
features = _.sortBy(features, (feature) -> (feature.name or feature.text).length)
highlightedContent = Handlebars._escape(content)
for feature in features
featureDisplay = feature.name or feature.text
bgColor = color(feature)
# The escaping might break this regex.
highlightedContent = highlightedContent.replace(
new RegExp("\\b#{featureDisplay}\\b", 'gi'),
"<span class='label' style='background-color:#{bgColor};" +
"box-shadow: 0px 0px 0px 2px #{bgColor};'>$&</span>"
)
new Spacebars.SafeString(highlightedContent)
else
content
else
content
| 210759 | color = (feature) =>
@grits.services.color Template.dash.getIdKeyFromFeature(feature)
Template.text.highlight = (content) ->
features = Session.get('features')
if features and content and (features instanceof Array)
if features?.length > 0 and features[0].textOffsets
# sort occurrences in descending order of start, so that we can add them
# to the content string from end to beginning, so that offsets remain
# valid.
featuresByOccurrence = []
for feature in features
for occurrence in feature.textOffsets
featuresByOccurrence.push
name: feature.name
feature: feature
occurrence: occurrence
featuresByOccurrence = _.sortBy(featuresByOccurrence, (feature) -> feature.occurrence[0])
highlightedContent = ''
last_idx = 0
for feature in featuresByOccurrence
occurrence = feature.occurrence
if occurrence[0] >= last_idx
# Handlebars._escape is used to prevent formatting like <<EMAIL>>
# from being injected as live html.
highlightedContent += Handlebars._escape(content.substring(last_idx, occurrence[0]))
if feature.feature.color
bgColor = feature.feature.color
else
bgColor = color(feature.feature)
highlightText = Handlebars._escape(content.substring(occurrence[0], occurrence[1]))
highlightedContent += """<span
class='label'
style='
background-color:#{bgColor};
box-shadow: 0px 0px 0px 2px #{bgColor};
'>#{highlightText}</span>"""
last_idx = occurrence[1]
highlightedContent += Handlebars._escape(content.substring(last_idx, content.length))
return new Spacebars.SafeString(highlightedContent)
else if features?.length > 0
features = _.sortBy(features, (feature) -> (feature.name or feature.text).length)
highlightedContent = Handlebars._escape(content)
for feature in features
featureDisplay = feature.name or feature.text
bgColor = color(feature)
# The escaping might break this regex.
highlightedContent = highlightedContent.replace(
new RegExp("\\b#{featureDisplay}\\b", 'gi'),
"<span class='label' style='background-color:#{bgColor};" +
"box-shadow: 0px 0px 0px 2px #{bgColor};'>$&</span>"
)
new Spacebars.SafeString(highlightedContent)
else
content
else
content
| true | color = (feature) =>
@grits.services.color Template.dash.getIdKeyFromFeature(feature)
Template.text.highlight = (content) ->
features = Session.get('features')
if features and content and (features instanceof Array)
if features?.length > 0 and features[0].textOffsets
# sort occurrences in descending order of start, so that we can add them
# to the content string from end to beginning, so that offsets remain
# valid.
featuresByOccurrence = []
for feature in features
for occurrence in feature.textOffsets
featuresByOccurrence.push
name: feature.name
feature: feature
occurrence: occurrence
featuresByOccurrence = _.sortBy(featuresByOccurrence, (feature) -> feature.occurrence[0])
highlightedContent = ''
last_idx = 0
for feature in featuresByOccurrence
occurrence = feature.occurrence
if occurrence[0] >= last_idx
# Handlebars._escape is used to prevent formatting like <PI:EMAIL:<EMAIL>END_PI>
# from being injected as live html.
highlightedContent += Handlebars._escape(content.substring(last_idx, occurrence[0]))
if feature.feature.color
bgColor = feature.feature.color
else
bgColor = color(feature.feature)
highlightText = Handlebars._escape(content.substring(occurrence[0], occurrence[1]))
highlightedContent += """<span
class='label'
style='
background-color:#{bgColor};
box-shadow: 0px 0px 0px 2px #{bgColor};
'>#{highlightText}</span>"""
last_idx = occurrence[1]
highlightedContent += Handlebars._escape(content.substring(last_idx, content.length))
return new Spacebars.SafeString(highlightedContent)
else if features?.length > 0
features = _.sortBy(features, (feature) -> (feature.name or feature.text).length)
highlightedContent = Handlebars._escape(content)
for feature in features
featureDisplay = feature.name or feature.text
bgColor = color(feature)
# The escaping might break this regex.
highlightedContent = highlightedContent.replace(
new RegExp("\\b#{featureDisplay}\\b", 'gi'),
"<span class='label' style='background-color:#{bgColor};" +
"box-shadow: 0px 0px 0px 2px #{bgColor};'>$&</span>"
)
new Spacebars.SafeString(highlightedContent)
else
content
else
content
|
[
{
"context": ", ->\n pt1 =\n id: 'pt1'\n name: 'myType'\n pt2 =\n id: 'pt2'\n name: 'myT",
"end": 345,
"score": 0.961233913898468,
"start": 339,
"tag": "NAME",
"value": "myType"
},
{
"context": "ype'\n pt2 =\n id: 'pt2'\n name: 'myType2'\n attributes: [\n { name: 'foo', a",
"end": 399,
"score": 0.9456861615180969,
"start": 392,
"tag": "NAME",
"value": "myType2"
},
{
"context": " ]\n pt3 =\n id: 'pt3'\n name: 'myType'\n @types.buildMaps [pt1, pt2, pt3]\n exp",
"end": 545,
"score": 0.9672616124153137,
"start": 539,
"tag": "NAME",
"value": "myType"
}
] | src/spec/types.spec.coffee | easybi-vv/sphere-node-product-csv-sync-1 | 7 | _ = require 'underscore'
Types = require '../lib/types'
describe 'Types', ->
beforeEach ->
@types = new Types()
describe '#constructor', ->
it 'should construct', ->
expect(@types).toBeDefined()
describe '#buildMaps', ->
it 'should create maps for product types', ->
pt1 =
id: 'pt1'
name: 'myType'
pt2 =
id: 'pt2'
name: 'myType2'
attributes: [
{ name: 'foo', attributeConstraint: 'SameForAll' }
]
pt3 =
id: 'pt3'
name: 'myType'
@types.buildMaps [pt1, pt2, pt3]
expect(_.size @types.id2index).toBe 3
expect(@types.id2index['pt1']).toBe 0
expect(@types.id2index['pt2']).toBe 1
expect(@types.id2index['pt3']).toBe 2
expect(@types.name2id['myType']).toBe 'pt3'
expect(@types.name2id['myType2']).toBe 'pt2'
expect(_.size @types.duplicateNames).toBe 1
expect(@types.duplicateNames[0]).toBe 'myType'
expect(_.size @types.id2SameForAllAttributes).toBe 3
expect(@types.id2SameForAllAttributes['pt1']).toEqual []
expect(@types.id2SameForAllAttributes['pt2']).toEqual [ 'foo' ]
expect(@types.id2SameForAllAttributes['pt3']).toEqual []
expect(_.size @types.id2nameAttributeDefMap).toBe 3
expectedObj =
foo: pt2.attributes[0]
expect(@types.id2nameAttributeDefMap['pt2']).toEqual expectedObj
| 95532 | _ = require 'underscore'
Types = require '../lib/types'
describe 'Types', ->
beforeEach ->
@types = new Types()
describe '#constructor', ->
it 'should construct', ->
expect(@types).toBeDefined()
describe '#buildMaps', ->
it 'should create maps for product types', ->
pt1 =
id: 'pt1'
name: '<NAME>'
pt2 =
id: 'pt2'
name: '<NAME>'
attributes: [
{ name: 'foo', attributeConstraint: 'SameForAll' }
]
pt3 =
id: 'pt3'
name: '<NAME>'
@types.buildMaps [pt1, pt2, pt3]
expect(_.size @types.id2index).toBe 3
expect(@types.id2index['pt1']).toBe 0
expect(@types.id2index['pt2']).toBe 1
expect(@types.id2index['pt3']).toBe 2
expect(@types.name2id['myType']).toBe 'pt3'
expect(@types.name2id['myType2']).toBe 'pt2'
expect(_.size @types.duplicateNames).toBe 1
expect(@types.duplicateNames[0]).toBe 'myType'
expect(_.size @types.id2SameForAllAttributes).toBe 3
expect(@types.id2SameForAllAttributes['pt1']).toEqual []
expect(@types.id2SameForAllAttributes['pt2']).toEqual [ 'foo' ]
expect(@types.id2SameForAllAttributes['pt3']).toEqual []
expect(_.size @types.id2nameAttributeDefMap).toBe 3
expectedObj =
foo: pt2.attributes[0]
expect(@types.id2nameAttributeDefMap['pt2']).toEqual expectedObj
| true | _ = require 'underscore'
Types = require '../lib/types'
describe 'Types', ->
beforeEach ->
@types = new Types()
describe '#constructor', ->
it 'should construct', ->
expect(@types).toBeDefined()
describe '#buildMaps', ->
it 'should create maps for product types', ->
pt1 =
id: 'pt1'
name: 'PI:NAME:<NAME>END_PI'
pt2 =
id: 'pt2'
name: 'PI:NAME:<NAME>END_PI'
attributes: [
{ name: 'foo', attributeConstraint: 'SameForAll' }
]
pt3 =
id: 'pt3'
name: 'PI:NAME:<NAME>END_PI'
@types.buildMaps [pt1, pt2, pt3]
expect(_.size @types.id2index).toBe 3
expect(@types.id2index['pt1']).toBe 0
expect(@types.id2index['pt2']).toBe 1
expect(@types.id2index['pt3']).toBe 2
expect(@types.name2id['myType']).toBe 'pt3'
expect(@types.name2id['myType2']).toBe 'pt2'
expect(_.size @types.duplicateNames).toBe 1
expect(@types.duplicateNames[0]).toBe 'myType'
expect(_.size @types.id2SameForAllAttributes).toBe 3
expect(@types.id2SameForAllAttributes['pt1']).toEqual []
expect(@types.id2SameForAllAttributes['pt2']).toEqual [ 'foo' ]
expect(@types.id2SameForAllAttributes['pt3']).toEqual []
expect(_.size @types.id2nameAttributeDefMap).toBe 3
expectedObj =
foo: pt2.attributes[0]
expect(@types.id2nameAttributeDefMap['pt2']).toEqual expectedObj
|
[
{
"context": "###\n * onemap-crawl\n * https://github.com//onemap-crawl\n *\n * Copyright (c) 2015 \n * Licensed under the M",
"end": 55,
"score": 0.9994813799858093,
"start": 43,
"tag": "USERNAME",
"value": "onemap-crawl"
},
{
"context": "quire('nodestalker')\nclient = nodestalker.Client \"127.0.0.1:11300\"\n#db = new neo4j \"http://neo4j:98941998@128",
"end": 730,
"score": 0.9997668862342834,
"start": 721,
"tag": "IP_ADDRESS",
"value": "127.0.0.1"
},
{
"context": "0.1:11300\"\n#db = new neo4j \"http://neo4j:98941998@128.199.100.77:7474\"\n\nneo4j = require \"./neo4j\"\n\nclass App\n M",
"end": 791,
"score": 0.9997642636299133,
"start": 777,
"tag": "IP_ADDRESS",
"value": "128.199.100.77"
},
{
"context": ">\n neo4j = new neo4j(\"neo4j\", \"98941998\", \"128.199.100.77:7474\")\n \n @config = config\n ",
"end": 937,
"score": 0.9997531175613403,
"start": 923,
"tag": "IP_ADDRESS",
"value": "128.199.100.77"
}
] | crawl.coffee | weicong96/smcrawl | 0 | ###
* onemap-crawl
* https://github.com//onemap-crawl
*
* Copyright (c) 2015
* Licensed under the MIT license.
###
config = require("./config")
request = require("request")
express = require("express")
mongodb = require("mongodb")
moment = require "moment"
permutation = require "./permutation"
GoogleScheduler = require("./src/google-scheduler")
InstagramScheduler = require("./src/instagram-scheduler")
Google = require("./src/class/Google")
Instagram = require("./src/class/Instagram")
GoogleDetails = require "./src/class/GoogleDetails"
geolib = require("geolib")
fs = require("fs")
q = require("q")
redis = require("redis").createClient();
nodestalker = require('nodestalker')
client = nodestalker.Client "127.0.0.1:11300"
#db = new neo4j "http://neo4j:98941998@128.199.100.77:7474"
neo4j = require "./neo4j"
class App
Models : {}
constructor : ()->
neo4j = new neo4j("neo4j", "98941998", "128.199.100.77:7474")
@config = config
@request = request
@q = q
@moment = moment
@coordinatesFromKml().then (result)=>
@coordinates = result
client.use("jobs").onSuccess (data)=>
@con = client
mongodb.connect config.mongodb , (err,db)=>
if !err
#@clearJobs()
@listenToTube()
@Models.GoogleDB = db.collection "google"
@Models.InstagramDB = db.collection "instagram"
@Instagram = new Instagram(@)
@GoogleDetails = new GoogleDetails(@)
@Google = new Google(@)
#googlesch = new GoogleScheduler(@)
instagramsch = new InstagramScheduler(@)
setRedisValue : (key , value)=>
redis.set key, value
getRedisKey : (key)=>
defer = q.defer()
redis.get key , (err, value)=>
defer.resolve value
return defer.promise;
findIfNeeded : (entity, model)=>
#Find using primary key
query = {}
query[entity.primaryKey] = model[entity.primaryKey]
entity.db.findOne query, (err,doc)=>
parsedEntity = entity.getEntity(model)#If entity is equal, then no need carry on with new code, can be useful for updating?
words = entity.getWords parsedEntity, entity
@putWords words, entity, parsedEntity
if !err
if !doc or doc.length is 0 #If found this place, don't insert.
entity.db.insert parsedEntity, (err,doc)=>
if err
console.log err
else
entity.db.update query, {$set : parsedEntity} , (err,doc)=>
if !err and doc
console.log query
else
console.log "error!"
coordinatesFromKml : ()=>
defer = q.defer();
fs.readFile "mapindex.geojson", 'utf-8', (err,data)=>
if err
console.log err
geojson = JSON.parse data
allCoordinates = []
for feature in geojson["features"]
coordinates = feature["geometry"]["coordinates"]
polygonCoordinates = []
for coordinate in coordinates[0]
coordinate.splice 2, 1
polygonCoordinates.push {longitude : coordinate[0], latitude : coordinate[1]}
center = geolib.getCenter polygonCoordinates
allCoordinates.push center
defer.resolve allCoordinates
return defer.promise
makeRecursiveCall : ()=>
url = arguments[0]
_type = ""
subtype = ""
if url.indexOf("instagram") > -1
_type = "instagram"
else if url.indexOf("google") > -1
_type = "google"
if url.indexOf("details") > -1
subtype = "details"
else
subtype = "search"
jobPayload =
data : arguments
type : _type
section : subtype
@con.put(JSON.stringify(jobPayload)).onSuccess (data)=>
putWords : (words, entity, parsedEntity)=>
words = entity.getWords(parsedEntity)
words = permutation(words, 2)
for word in words
neo4j.createNode {word : word[0]}, (err,node)=>
if err
throw err
console.log node.body['metadata']['id']
neo4j.createNode {word : word[1]}, (err,node2)=>
if err
throw err
console.log node2.body['metadata']['id']
neo4j.createRelationship node1.body['metadata']['id'] , node2.body['metadata']['id'], "USED_WITH", {}, (err, res)=>
if err
throw err
console.log res
#for _word in words
#db.insertNode {word : _word[0]}, (err, node)=>
#if err
# throw err
#console.log node
#if err
#console.log err
#node.createRelationshipTo node2, "USED_WITH", (err,data)=>
#console.log err
#console.log data
clearJobs : ()=>
@con.watch('jobs').onSuccess (data)=>
@con.reserve().onSuccess (job)=>
console.log "clear job #{job.id}"
@con.deleteJob(job.id).onSuccess ()=>
@clearJobs()
@clearJobs()
listenToTube : ()=>
@con.watch('jobs').onSuccess (data)=>
@con.reserve().onSuccess (job)=>
json_string = job.data
job_id = job.id
if json_string
json_data = JSON.parse(json_string).data
if json_data
arr = Object.keys(json_data).map (key)=>
return json_data[key]
unixts = new @moment().startOf('hour').unix()
model = null
parsedPayload = JSON.parse(json_string)
type = parsedPayload.type
if type is "instagram"
model = @Instagram
if type is "google"
model = @Google
@getRedisKey(type+"_"+unixts).then (value)=>
if value <= (@config[type]['query_limit']-1)
@makeRequest.apply(null, arr).then (res)=>
@getRedisKey(type+"_"+unixts).then (value)=>
value = parseInt value
if !value
value = 0
value = value + res['pages']
@setRedisValue type+"_"+unixts, value
console.log "#{type}_#{unixts} : #{value}"
if !Array.isArray res['data']
@findIfNeeded model , res['data']
else
for media in res['data']
@findIfNeeded model, media
@con.deleteJob(job_id).onSuccess ()=>
console.log "destry job #{job_id}"
@listenToTube() #tube doesn't listen constantly? kind of a recursive call
else
console.log "query limit reached for #{@moment(unixts * 1000).format()} "
@con.release(job_id, 0, @config[type]['query_interval']/1000)
@listenToTube()
else
@listenToTube()
else
@listenToTube()
#Read from beanstalkd tube
#Then make request after that
makeRequest : (_url, token, urlTokenKey, entriesKey, entries, previousResponse, pages)=>
if !entries
entries = []
defer = q.defer();
mode = ""
url = ""
if previousResponse and previousResponse[token]
url = "#{_url}&#{urlTokenKey}=#{previousResponse[token]}"
else
url = "#{_url}"
if url.indexOf "instagram" != -1
mode = "instagram"
#if !previousResponse and mode is "instagram" and @App.getRedisKey("hour") >= 5000
#reset page count for this hour
#If its error, probably need to update info here?
#Reject first if count is reached and schdule antoher one at a later timing
makeRequest = ()=>
defer = q.defer();
if pages is NaN or pages is undefined
pages = 1
@request url, (error, response, body)=>
if body
body = JSON.parse body
if body[token]
setTimeout ()=>
@makeRequest(_url, token, urlTokenKey, entriesKey, body[entriesKey], body, pages+1).then (responses)=>
Array.prototype.push.apply responses['data'], body[entriesKey]
defer.resolve {data : responses['data'] , pages : responses['pages']}
,2000
else
defer.resolve {data : body[entriesKey], pages : pages}
return defer.promise
makeRequest().then (res)=>
defer.resolve res
return defer.promise
distanceFrom : (lat0,lon0, dyLatOffset, dxLngOffset)=>
pi = Math.PI
lat = lat0 + (180/pi)*(dyLatOffset/6378137)
lon = lon0 + (180/pi)*(dxLngOffset/6378137)/Math.cos(lat0)
return [lat, lon];
objectid : (id)=>
return new mongodb.ObjectID id
sendContent : (req, res,content)=>
res.status 200
return res.json content
sendError: (req, res, error, content)=>
res.status error
return res.end content
new App()
module.exports = App
| 99685 | ###
* onemap-crawl
* https://github.com//onemap-crawl
*
* Copyright (c) 2015
* Licensed under the MIT license.
###
config = require("./config")
request = require("request")
express = require("express")
mongodb = require("mongodb")
moment = require "moment"
permutation = require "./permutation"
GoogleScheduler = require("./src/google-scheduler")
InstagramScheduler = require("./src/instagram-scheduler")
Google = require("./src/class/Google")
Instagram = require("./src/class/Instagram")
GoogleDetails = require "./src/class/GoogleDetails"
geolib = require("geolib")
fs = require("fs")
q = require("q")
redis = require("redis").createClient();
nodestalker = require('nodestalker')
client = nodestalker.Client "127.0.0.1:11300"
#db = new neo4j "http://neo4j:98941998@172.16.58.3:7474"
neo4j = require "./neo4j"
class App
Models : {}
constructor : ()->
neo4j = new neo4j("neo4j", "98941998", "172.16.58.3:7474")
@config = config
@request = request
@q = q
@moment = moment
@coordinatesFromKml().then (result)=>
@coordinates = result
client.use("jobs").onSuccess (data)=>
@con = client
mongodb.connect config.mongodb , (err,db)=>
if !err
#@clearJobs()
@listenToTube()
@Models.GoogleDB = db.collection "google"
@Models.InstagramDB = db.collection "instagram"
@Instagram = new Instagram(@)
@GoogleDetails = new GoogleDetails(@)
@Google = new Google(@)
#googlesch = new GoogleScheduler(@)
instagramsch = new InstagramScheduler(@)
setRedisValue : (key , value)=>
redis.set key, value
getRedisKey : (key)=>
defer = q.defer()
redis.get key , (err, value)=>
defer.resolve value
return defer.promise;
findIfNeeded : (entity, model)=>
#Find using primary key
query = {}
query[entity.primaryKey] = model[entity.primaryKey]
entity.db.findOne query, (err,doc)=>
parsedEntity = entity.getEntity(model)#If entity is equal, then no need carry on with new code, can be useful for updating?
words = entity.getWords parsedEntity, entity
@putWords words, entity, parsedEntity
if !err
if !doc or doc.length is 0 #If found this place, don't insert.
entity.db.insert parsedEntity, (err,doc)=>
if err
console.log err
else
entity.db.update query, {$set : parsedEntity} , (err,doc)=>
if !err and doc
console.log query
else
console.log "error!"
coordinatesFromKml : ()=>
defer = q.defer();
fs.readFile "mapindex.geojson", 'utf-8', (err,data)=>
if err
console.log err
geojson = JSON.parse data
allCoordinates = []
for feature in geojson["features"]
coordinates = feature["geometry"]["coordinates"]
polygonCoordinates = []
for coordinate in coordinates[0]
coordinate.splice 2, 1
polygonCoordinates.push {longitude : coordinate[0], latitude : coordinate[1]}
center = geolib.getCenter polygonCoordinates
allCoordinates.push center
defer.resolve allCoordinates
return defer.promise
makeRecursiveCall : ()=>
url = arguments[0]
_type = ""
subtype = ""
if url.indexOf("instagram") > -1
_type = "instagram"
else if url.indexOf("google") > -1
_type = "google"
if url.indexOf("details") > -1
subtype = "details"
else
subtype = "search"
jobPayload =
data : arguments
type : _type
section : subtype
@con.put(JSON.stringify(jobPayload)).onSuccess (data)=>
putWords : (words, entity, parsedEntity)=>
words = entity.getWords(parsedEntity)
words = permutation(words, 2)
for word in words
neo4j.createNode {word : word[0]}, (err,node)=>
if err
throw err
console.log node.body['metadata']['id']
neo4j.createNode {word : word[1]}, (err,node2)=>
if err
throw err
console.log node2.body['metadata']['id']
neo4j.createRelationship node1.body['metadata']['id'] , node2.body['metadata']['id'], "USED_WITH", {}, (err, res)=>
if err
throw err
console.log res
#for _word in words
#db.insertNode {word : _word[0]}, (err, node)=>
#if err
# throw err
#console.log node
#if err
#console.log err
#node.createRelationshipTo node2, "USED_WITH", (err,data)=>
#console.log err
#console.log data
clearJobs : ()=>
@con.watch('jobs').onSuccess (data)=>
@con.reserve().onSuccess (job)=>
console.log "clear job #{job.id}"
@con.deleteJob(job.id).onSuccess ()=>
@clearJobs()
@clearJobs()
listenToTube : ()=>
@con.watch('jobs').onSuccess (data)=>
@con.reserve().onSuccess (job)=>
json_string = job.data
job_id = job.id
if json_string
json_data = JSON.parse(json_string).data
if json_data
arr = Object.keys(json_data).map (key)=>
return json_data[key]
unixts = new @moment().startOf('hour').unix()
model = null
parsedPayload = JSON.parse(json_string)
type = parsedPayload.type
if type is "instagram"
model = @Instagram
if type is "google"
model = @Google
@getRedisKey(type+"_"+unixts).then (value)=>
if value <= (@config[type]['query_limit']-1)
@makeRequest.apply(null, arr).then (res)=>
@getRedisKey(type+"_"+unixts).then (value)=>
value = parseInt value
if !value
value = 0
value = value + res['pages']
@setRedisValue type+"_"+unixts, value
console.log "#{type}_#{unixts} : #{value}"
if !Array.isArray res['data']
@findIfNeeded model , res['data']
else
for media in res['data']
@findIfNeeded model, media
@con.deleteJob(job_id).onSuccess ()=>
console.log "destry job #{job_id}"
@listenToTube() #tube doesn't listen constantly? kind of a recursive call
else
console.log "query limit reached for #{@moment(unixts * 1000).format()} "
@con.release(job_id, 0, @config[type]['query_interval']/1000)
@listenToTube()
else
@listenToTube()
else
@listenToTube()
#Read from beanstalkd tube
#Then make request after that
makeRequest : (_url, token, urlTokenKey, entriesKey, entries, previousResponse, pages)=>
if !entries
entries = []
defer = q.defer();
mode = ""
url = ""
if previousResponse and previousResponse[token]
url = "#{_url}&#{urlTokenKey}=#{previousResponse[token]}"
else
url = "#{_url}"
if url.indexOf "instagram" != -1
mode = "instagram"
#if !previousResponse and mode is "instagram" and @App.getRedisKey("hour") >= 5000
#reset page count for this hour
#If its error, probably need to update info here?
#Reject first if count is reached and schdule antoher one at a later timing
makeRequest = ()=>
defer = q.defer();
if pages is NaN or pages is undefined
pages = 1
@request url, (error, response, body)=>
if body
body = JSON.parse body
if body[token]
setTimeout ()=>
@makeRequest(_url, token, urlTokenKey, entriesKey, body[entriesKey], body, pages+1).then (responses)=>
Array.prototype.push.apply responses['data'], body[entriesKey]
defer.resolve {data : responses['data'] , pages : responses['pages']}
,2000
else
defer.resolve {data : body[entriesKey], pages : pages}
return defer.promise
makeRequest().then (res)=>
defer.resolve res
return defer.promise
distanceFrom : (lat0,lon0, dyLatOffset, dxLngOffset)=>
pi = Math.PI
lat = lat0 + (180/pi)*(dyLatOffset/6378137)
lon = lon0 + (180/pi)*(dxLngOffset/6378137)/Math.cos(lat0)
return [lat, lon];
objectid : (id)=>
return new mongodb.ObjectID id
sendContent : (req, res,content)=>
res.status 200
return res.json content
sendError: (req, res, error, content)=>
res.status error
return res.end content
new App()
module.exports = App
| true | ###
* onemap-crawl
* https://github.com//onemap-crawl
*
* Copyright (c) 2015
* Licensed under the MIT license.
###
config = require("./config")
request = require("request")
express = require("express")
mongodb = require("mongodb")
moment = require "moment"
permutation = require "./permutation"
GoogleScheduler = require("./src/google-scheduler")
InstagramScheduler = require("./src/instagram-scheduler")
Google = require("./src/class/Google")
Instagram = require("./src/class/Instagram")
GoogleDetails = require "./src/class/GoogleDetails"
geolib = require("geolib")
fs = require("fs")
q = require("q")
redis = require("redis").createClient();
nodestalker = require('nodestalker')
client = nodestalker.Client "127.0.0.1:11300"
#db = new neo4j "http://neo4j:98941998@PI:IP_ADDRESS:172.16.58.3END_PI:7474"
neo4j = require "./neo4j"
class App
Models : {}
constructor : ()->
neo4j = new neo4j("neo4j", "98941998", "PI:IP_ADDRESS:172.16.58.3END_PI:7474")
@config = config
@request = request
@q = q
@moment = moment
@coordinatesFromKml().then (result)=>
@coordinates = result
client.use("jobs").onSuccess (data)=>
@con = client
mongodb.connect config.mongodb , (err,db)=>
if !err
#@clearJobs()
@listenToTube()
@Models.GoogleDB = db.collection "google"
@Models.InstagramDB = db.collection "instagram"
@Instagram = new Instagram(@)
@GoogleDetails = new GoogleDetails(@)
@Google = new Google(@)
#googlesch = new GoogleScheduler(@)
instagramsch = new InstagramScheduler(@)
setRedisValue : (key , value)=>
redis.set key, value
getRedisKey : (key)=>
defer = q.defer()
redis.get key , (err, value)=>
defer.resolve value
return defer.promise;
findIfNeeded : (entity, model)=>
#Find using primary key
query = {}
query[entity.primaryKey] = model[entity.primaryKey]
entity.db.findOne query, (err,doc)=>
parsedEntity = entity.getEntity(model)#If entity is equal, then no need carry on with new code, can be useful for updating?
words = entity.getWords parsedEntity, entity
@putWords words, entity, parsedEntity
if !err
if !doc or doc.length is 0 #If found this place, don't insert.
entity.db.insert parsedEntity, (err,doc)=>
if err
console.log err
else
entity.db.update query, {$set : parsedEntity} , (err,doc)=>
if !err and doc
console.log query
else
console.log "error!"
coordinatesFromKml : ()=>
defer = q.defer();
fs.readFile "mapindex.geojson", 'utf-8', (err,data)=>
if err
console.log err
geojson = JSON.parse data
allCoordinates = []
for feature in geojson["features"]
coordinates = feature["geometry"]["coordinates"]
polygonCoordinates = []
for coordinate in coordinates[0]
coordinate.splice 2, 1
polygonCoordinates.push {longitude : coordinate[0], latitude : coordinate[1]}
center = geolib.getCenter polygonCoordinates
allCoordinates.push center
defer.resolve allCoordinates
return defer.promise
makeRecursiveCall : ()=>
url = arguments[0]
_type = ""
subtype = ""
if url.indexOf("instagram") > -1
_type = "instagram"
else if url.indexOf("google") > -1
_type = "google"
if url.indexOf("details") > -1
subtype = "details"
else
subtype = "search"
jobPayload =
data : arguments
type : _type
section : subtype
@con.put(JSON.stringify(jobPayload)).onSuccess (data)=>
putWords : (words, entity, parsedEntity)=>
words = entity.getWords(parsedEntity)
words = permutation(words, 2)
for word in words
neo4j.createNode {word : word[0]}, (err,node)=>
if err
throw err
console.log node.body['metadata']['id']
neo4j.createNode {word : word[1]}, (err,node2)=>
if err
throw err
console.log node2.body['metadata']['id']
neo4j.createRelationship node1.body['metadata']['id'] , node2.body['metadata']['id'], "USED_WITH", {}, (err, res)=>
if err
throw err
console.log res
#for _word in words
#db.insertNode {word : _word[0]}, (err, node)=>
#if err
# throw err
#console.log node
#if err
#console.log err
#node.createRelationshipTo node2, "USED_WITH", (err,data)=>
#console.log err
#console.log data
clearJobs : ()=>
@con.watch('jobs').onSuccess (data)=>
@con.reserve().onSuccess (job)=>
console.log "clear job #{job.id}"
@con.deleteJob(job.id).onSuccess ()=>
@clearJobs()
@clearJobs()
listenToTube : ()=>
@con.watch('jobs').onSuccess (data)=>
@con.reserve().onSuccess (job)=>
json_string = job.data
job_id = job.id
if json_string
json_data = JSON.parse(json_string).data
if json_data
arr = Object.keys(json_data).map (key)=>
return json_data[key]
unixts = new @moment().startOf('hour').unix()
model = null
parsedPayload = JSON.parse(json_string)
type = parsedPayload.type
if type is "instagram"
model = @Instagram
if type is "google"
model = @Google
@getRedisKey(type+"_"+unixts).then (value)=>
if value <= (@config[type]['query_limit']-1)
@makeRequest.apply(null, arr).then (res)=>
@getRedisKey(type+"_"+unixts).then (value)=>
value = parseInt value
if !value
value = 0
value = value + res['pages']
@setRedisValue type+"_"+unixts, value
console.log "#{type}_#{unixts} : #{value}"
if !Array.isArray res['data']
@findIfNeeded model , res['data']
else
for media in res['data']
@findIfNeeded model, media
@con.deleteJob(job_id).onSuccess ()=>
console.log "destry job #{job_id}"
@listenToTube() #tube doesn't listen constantly? kind of a recursive call
else
console.log "query limit reached for #{@moment(unixts * 1000).format()} "
@con.release(job_id, 0, @config[type]['query_interval']/1000)
@listenToTube()
else
@listenToTube()
else
@listenToTube()
#Read from beanstalkd tube
#Then make request after that
makeRequest : (_url, token, urlTokenKey, entriesKey, entries, previousResponse, pages)=>
if !entries
entries = []
defer = q.defer();
mode = ""
url = ""
if previousResponse and previousResponse[token]
url = "#{_url}&#{urlTokenKey}=#{previousResponse[token]}"
else
url = "#{_url}"
if url.indexOf "instagram" != -1
mode = "instagram"
#if !previousResponse and mode is "instagram" and @App.getRedisKey("hour") >= 5000
#reset page count for this hour
#If its error, probably need to update info here?
#Reject first if count is reached and schdule antoher one at a later timing
makeRequest = ()=>
defer = q.defer();
if pages is NaN or pages is undefined
pages = 1
@request url, (error, response, body)=>
if body
body = JSON.parse body
if body[token]
setTimeout ()=>
@makeRequest(_url, token, urlTokenKey, entriesKey, body[entriesKey], body, pages+1).then (responses)=>
Array.prototype.push.apply responses['data'], body[entriesKey]
defer.resolve {data : responses['data'] , pages : responses['pages']}
,2000
else
defer.resolve {data : body[entriesKey], pages : pages}
return defer.promise
makeRequest().then (res)=>
defer.resolve res
return defer.promise
distanceFrom : (lat0,lon0, dyLatOffset, dxLngOffset)=>
pi = Math.PI
lat = lat0 + (180/pi)*(dyLatOffset/6378137)
lon = lon0 + (180/pi)*(dxLngOffset/6378137)/Math.cos(lat0)
return [lat, lon];
objectid : (id)=>
return new mongodb.ObjectID id
sendContent : (req, res,content)=>
res.status 200
return res.json content
sendError: (req, res, error, content)=>
res.status error
return res.end content
new App()
module.exports = App
|
[
{
"context": "# Copyright Joyent, Inc. and other Node contributors.\n#\n# Permission",
"end": 18,
"score": 0.9990740418434143,
"start": 12,
"tag": "NAME",
"value": "Joyent"
}
] | test/pummel/test-fs-watch-file-slow.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.
# swallow
createFile = ->
console.log "creating file"
fs.writeFileSync FILENAME, "test"
setTimeout touchFile, TIMEOUT
return
touchFile = ->
console.log "touch file"
fs.writeFileSync FILENAME, "test"
setTimeout removeFile, TIMEOUT
return
removeFile = ->
console.log "remove file"
fs.unlinkSync FILENAME
return
common = require("../common")
assert = require("assert")
path = require("path")
fs = require("fs")
FILENAME = path.join(common.tmpDir, "watch-me")
TIMEOUT = 1300
nevents = 0
try
fs.unlinkSync FILENAME
fs.watchFile FILENAME,
interval: TIMEOUT - 250
, (curr, prev) ->
console.log [
curr
prev
]
switch ++nevents
when 1
assert.equal fs.existsSync(FILENAME), false
when 2, 3
assert.equal fs.existsSync(FILENAME), true
when 4
assert.equal fs.existsSync(FILENAME), false
fs.unwatchFile FILENAME
else
assert 0
return
process.on "exit", ->
assert.equal nevents, 4
return
setTimeout createFile, TIMEOUT
| 174433 | # 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.
# swallow
createFile = ->
console.log "creating file"
fs.writeFileSync FILENAME, "test"
setTimeout touchFile, TIMEOUT
return
touchFile = ->
console.log "touch file"
fs.writeFileSync FILENAME, "test"
setTimeout removeFile, TIMEOUT
return
removeFile = ->
console.log "remove file"
fs.unlinkSync FILENAME
return
common = require("../common")
assert = require("assert")
path = require("path")
fs = require("fs")
FILENAME = path.join(common.tmpDir, "watch-me")
TIMEOUT = 1300
nevents = 0
try
fs.unlinkSync FILENAME
fs.watchFile FILENAME,
interval: TIMEOUT - 250
, (curr, prev) ->
console.log [
curr
prev
]
switch ++nevents
when 1
assert.equal fs.existsSync(FILENAME), false
when 2, 3
assert.equal fs.existsSync(FILENAME), true
when 4
assert.equal fs.existsSync(FILENAME), false
fs.unwatchFile FILENAME
else
assert 0
return
process.on "exit", ->
assert.equal nevents, 4
return
setTimeout createFile, TIMEOUT
| 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.
# swallow
createFile = ->
console.log "creating file"
fs.writeFileSync FILENAME, "test"
setTimeout touchFile, TIMEOUT
return
touchFile = ->
console.log "touch file"
fs.writeFileSync FILENAME, "test"
setTimeout removeFile, TIMEOUT
return
removeFile = ->
console.log "remove file"
fs.unlinkSync FILENAME
return
common = require("../common")
assert = require("assert")
path = require("path")
fs = require("fs")
FILENAME = path.join(common.tmpDir, "watch-me")
TIMEOUT = 1300
nevents = 0
try
fs.unlinkSync FILENAME
fs.watchFile FILENAME,
interval: TIMEOUT - 250
, (curr, prev) ->
console.log [
curr
prev
]
switch ++nevents
when 1
assert.equal fs.existsSync(FILENAME), false
when 2, 3
assert.equal fs.existsSync(FILENAME), true
when 4
assert.equal fs.existsSync(FILENAME), false
fs.unwatchFile FILENAME
else
assert 0
return
process.on "exit", ->
assert.equal nevents, 4
return
setTimeout createFile, TIMEOUT
|
[
{
"context": ", ->\n code = \"\"\"\n var name = 'Josh';\n console.log(name);\n \"\"\"\n ",
"end": 7072,
"score": 0.9995945692062378,
"start": 7068,
"tag": "NAME",
"value": "Josh"
},
{
"context": " }\n var peter = new Person('Peter', 31);\n peter.sayHello();\n \"\"",
"end": 21077,
"score": 0.999424934387207,
"start": 21072,
"tag": "NAME",
"value": "Peter"
}
] | tests/jasmine/client/unit/JSLessons/spec/JSLessonsSpec.coffee | Elfoslav/codermania | 56 | describe "JSLesson.checkAssignment", ->
#arithmetic operators
Meteor.startup ->
Meteor.setTimeout(
describe 'Statements', ->
lesson = JSLessonsList._collection.findOne({id: '1y'})
it "should return true for correct code", ->
code = """
console.log('statement 1');
console.log(\"statement 2\");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Expressions', ->
lesson = JSLessonsList._collection.findOne({id: '1c'})
it "should return true for correct code", ->
code = """
console.log(8 + 2 <= 11);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
console.log( (8 + 2) <= 11 );
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Variables introduction', ->
lesson = JSLessonsList._collection.findOne({id: '1d'})
it "should return true for correct code", ->
code = """
var emptyVariable;
console.log(emptyVariable);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return false for incorrect code 1", ->
code = """
var emptyVariable = 'lol';
console.log(emptyVariable);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
it "should return false for incorrect code 2", ->
code = """
var emptyVariable;
console.log(emptyVariable)
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
it "should return false for incorrect code 3", ->
code = """
var emptyVariable
console.log(emptyVariable);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'Coding conventions', ->
lesson = JSLessonsList._collection.findOne({id: '1u'})
it "should return true for correct code", ->
code = """
var message = 'Conventions are good for you';
console.log(1 + 2);
console.log(4 <= 5);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return false for incorrect code", ->
code = """
var message= 'Conventions are good for you';
console.log(1+2);
console.log(4<= 5);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'arithmetic operators', ->
lesson = JSLessonsList._collection.findOne({id: '1i'})
it "should not return true for code console.log(5 % 3);", ->
code = """
console.log(5 % 3);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toEqual('Result should be 3. Your result is 2')
it "should not return true for code console.log(11 % 3)", ->
code = """
console.log(11 % 3)
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toEqual('Missing semicolon')
it "should return true for code console.log(11 % 4);", ->
code = """
console.log(11 % 4);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Comparison operators', ->
lesson = JSLessonsList._collection.findOne({id: '1s'})
it "should not return true - missing semicolon", ->
code = """
//Following expressions must be evaluated to true
console.log(42 < 5)
console.log(6 === "6");
console.log(1 != "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
it "should return true for correct code 1", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 == "6");
console.log(1 == "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 !== "6");
console.log(1 !== "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 == "6");
console.log(1 !== "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 !== "6");
console.log(1 == "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Assignment operators', ->
lesson = JSLessonsList._collection.findOne({id: '1j'})
it "should return true for correct code", ->
code = """
var number = 5;
number *= 2;
console.log(number);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'String variables', ->
lesson = JSLessonsList._collection.findOne({id: '1e'})
it "should return true for correct code", ->
code = """
var name = 'Josh';
console.log(name);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Integer variables', ->
lesson = JSLessonsList._collection.findOne({id: '1f'})
it "should return true for correct code", ->
code = """
var x = 5123;
var y = 6;
var z = 10;
console.log(x * y + z);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'String operators', ->
lesson = JSLessonsList._collection.findOne({id: '1k'})
it "should return true for correct code", ->
code = """
var text = 'Hello';
text += ' world';
console.log(text);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Float variables', ->
lesson = JSLessonsList._collection.findOne({id: '1g'})
it "should return true for correct code", ->
code = """
var pi = 3.14;
var r = 5;
var circumference = 2 * pi * r;
console.log(circumference);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Boolean variables', ->
lesson = JSLessonsList._collection.findOne({id: '1h'})
it "should return true for correct code 1", ->
code = """
var isCoderMan = false;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var isCoderMan = true;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
var isCoderMan = 20 == 30;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
var isCoderMan = 20 === 30;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 5", ->
code = """
var isCoderMan = 20 <= 30;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should NOT return true for incorrect code", ->
code = """
var isCoderMan = '';
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'Arrays', ->
lesson = JSLessonsList._collection.findOne({id: '1l'})
it "should return true for correct code", ->
code = """
var fruits = ['apple', 'orange', 'banana'];
console.log(fruits[1]);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Conditions', ->
lesson = JSLessonsList._collection.findOne({id: '1m'})
it "should return true for correct code", ->
code = """
var age = 65;
if (age >= 18) {
console.log('You are an adult');
} else {
console.log('You are a child');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Switch', ->
lesson = JSLessonsList._collection.findOne({id: '1v'})
it "should return true for correct code", ->
code = """
var letter = 'b';
switch (letter) {
case 'a':
console.log('letter \"a\"');
break;
case 'b':
console.log('letter \"b\"');
break;
case 'c':
console.log('letter \"c\"');
break;
default:
console.log('Unknown letter');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Logical operators', ->
lesson = JSLessonsList._collection.findOne({id: '1n'})
it "should return true for correct code 1", ->
code = """
var isPokemon = true;
var isPikachu = true;
if (isPokemon && isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var isPokemon = false;
var isPikachu = true;
if (isPokemon || isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
var isPokemon = true;
var isPikachu = true;
if (isPokemon || isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
var isPokemon = true;
var isPikachu = false;
if (isPokemon || isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should NOT return true for bad code", ->
code = """
var isPokemon = false;
var isPikachu = true;
if (isPokemon && isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'Falsey and truthy', ->
lesson = JSLessonsList._collection.findOne({id: '1o'})
it "should return true for correct code 1", ->
code = """
//define falsey variable under this line:
var falseyVar = '';
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
//define falsey variable under this line:
var falseyVar = 0;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
//define falsey variable under this line:
var falseyVar = null;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
//define falsey variable under this line:
var falseyVar;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 5", ->
code = """
//define falsey variable under this line:
var falseyVar = NaN;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Loops', ->
lesson = JSLessonsList._collection.findOne({id: '1p'})
it "should return true for correct code 1", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
for (var i = 0; i < fruits.length; i++) {
console.log(fruits[i]);
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
for (var i = 0; i <= fruits.length - 1; i++) {
console.log(fruits[i]);
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Loops - while', ->
lesson = JSLessonsList._collection.findOne({id: '1t'})
it "should return true for correct code 1", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
//write while loop under this line:
var i = 0;
while (i < fruits.length) {
console.log(fruits[i]);
i++;
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
//write while loop under this line:
var i = 0;
while (i <= fruits.length - 1) {
console.log(fruits[i]);
i++;
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Functions', ->
lesson = JSLessonsList._collection.findOne({id: '1q'})
it "should return true for correct code 1", ->
code = """
function sum(numbers) {
var sum = 0;
for (var i = 0; i < numbers.length; i++) {
sum += numbers[i];
}
return sum;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
function sum(numbers) {
var s = 0;
for (var i = 0; i < numbers.length; i++) {
s += numbers[i];
}
return s;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
function sum(numbers) {
var s = 0;
for (var i = 0; i < numbers.length; i++) {
s = s + numbers[i];
}
return s;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
function sum(numbers) {
var s = 0;
for (var i = 0; i <= numbers.length - 1; i++) {
s = numbers[i] + s;
}
return s;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Objects', ->
lesson = JSLessonsList._collection.findOne({id: '1r'})
it "should return true for correct code 1", ->
code = """
function Person(name, age) {
this.name = name;
this.age = age;
this.sayHello = function() {
console.log('Hello, my name is ' + this.name);
console.log('And my age is ' + this.age);
}
}
var peter = new Person('Peter', 31);
peter.sayHello();
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Errors', ->
lesson = JSLessonsList._collection.findOne({id: '1x'})
it "should return true for correct code 1", ->
code = """
var boat = 'Titanic';
var obstruction = 'glacier';
if (boat == 'Titanic' && obstruction === 'glacier') {
throw new Error('Captain, we have a problem!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var boat = 'Titanic';
var obstruction = 'glacier';
if ((boat == \"Titanic\") && (obstruction === 'glacier')) {
throw new Error('Captain, we have a problem!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
, 2000)
| 99243 | describe "JSLesson.checkAssignment", ->
#arithmetic operators
Meteor.startup ->
Meteor.setTimeout(
describe 'Statements', ->
lesson = JSLessonsList._collection.findOne({id: '1y'})
it "should return true for correct code", ->
code = """
console.log('statement 1');
console.log(\"statement 2\");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Expressions', ->
lesson = JSLessonsList._collection.findOne({id: '1c'})
it "should return true for correct code", ->
code = """
console.log(8 + 2 <= 11);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
console.log( (8 + 2) <= 11 );
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Variables introduction', ->
lesson = JSLessonsList._collection.findOne({id: '1d'})
it "should return true for correct code", ->
code = """
var emptyVariable;
console.log(emptyVariable);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return false for incorrect code 1", ->
code = """
var emptyVariable = 'lol';
console.log(emptyVariable);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
it "should return false for incorrect code 2", ->
code = """
var emptyVariable;
console.log(emptyVariable)
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
it "should return false for incorrect code 3", ->
code = """
var emptyVariable
console.log(emptyVariable);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'Coding conventions', ->
lesson = JSLessonsList._collection.findOne({id: '1u'})
it "should return true for correct code", ->
code = """
var message = 'Conventions are good for you';
console.log(1 + 2);
console.log(4 <= 5);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return false for incorrect code", ->
code = """
var message= 'Conventions are good for you';
console.log(1+2);
console.log(4<= 5);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'arithmetic operators', ->
lesson = JSLessonsList._collection.findOne({id: '1i'})
it "should not return true for code console.log(5 % 3);", ->
code = """
console.log(5 % 3);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toEqual('Result should be 3. Your result is 2')
it "should not return true for code console.log(11 % 3)", ->
code = """
console.log(11 % 3)
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toEqual('Missing semicolon')
it "should return true for code console.log(11 % 4);", ->
code = """
console.log(11 % 4);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Comparison operators', ->
lesson = JSLessonsList._collection.findOne({id: '1s'})
it "should not return true - missing semicolon", ->
code = """
//Following expressions must be evaluated to true
console.log(42 < 5)
console.log(6 === "6");
console.log(1 != "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
it "should return true for correct code 1", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 == "6");
console.log(1 == "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 !== "6");
console.log(1 !== "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 == "6");
console.log(1 !== "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 !== "6");
console.log(1 == "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Assignment operators', ->
lesson = JSLessonsList._collection.findOne({id: '1j'})
it "should return true for correct code", ->
code = """
var number = 5;
number *= 2;
console.log(number);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'String variables', ->
lesson = JSLessonsList._collection.findOne({id: '1e'})
it "should return true for correct code", ->
code = """
var name = '<NAME>';
console.log(name);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Integer variables', ->
lesson = JSLessonsList._collection.findOne({id: '1f'})
it "should return true for correct code", ->
code = """
var x = 5123;
var y = 6;
var z = 10;
console.log(x * y + z);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'String operators', ->
lesson = JSLessonsList._collection.findOne({id: '1k'})
it "should return true for correct code", ->
code = """
var text = 'Hello';
text += ' world';
console.log(text);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Float variables', ->
lesson = JSLessonsList._collection.findOne({id: '1g'})
it "should return true for correct code", ->
code = """
var pi = 3.14;
var r = 5;
var circumference = 2 * pi * r;
console.log(circumference);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Boolean variables', ->
lesson = JSLessonsList._collection.findOne({id: '1h'})
it "should return true for correct code 1", ->
code = """
var isCoderMan = false;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var isCoderMan = true;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
var isCoderMan = 20 == 30;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
var isCoderMan = 20 === 30;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 5", ->
code = """
var isCoderMan = 20 <= 30;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should NOT return true for incorrect code", ->
code = """
var isCoderMan = '';
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'Arrays', ->
lesson = JSLessonsList._collection.findOne({id: '1l'})
it "should return true for correct code", ->
code = """
var fruits = ['apple', 'orange', 'banana'];
console.log(fruits[1]);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Conditions', ->
lesson = JSLessonsList._collection.findOne({id: '1m'})
it "should return true for correct code", ->
code = """
var age = 65;
if (age >= 18) {
console.log('You are an adult');
} else {
console.log('You are a child');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Switch', ->
lesson = JSLessonsList._collection.findOne({id: '1v'})
it "should return true for correct code", ->
code = """
var letter = 'b';
switch (letter) {
case 'a':
console.log('letter \"a\"');
break;
case 'b':
console.log('letter \"b\"');
break;
case 'c':
console.log('letter \"c\"');
break;
default:
console.log('Unknown letter');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Logical operators', ->
lesson = JSLessonsList._collection.findOne({id: '1n'})
it "should return true for correct code 1", ->
code = """
var isPokemon = true;
var isPikachu = true;
if (isPokemon && isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var isPokemon = false;
var isPikachu = true;
if (isPokemon || isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
var isPokemon = true;
var isPikachu = true;
if (isPokemon || isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
var isPokemon = true;
var isPikachu = false;
if (isPokemon || isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should NOT return true for bad code", ->
code = """
var isPokemon = false;
var isPikachu = true;
if (isPokemon && isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'Falsey and truthy', ->
lesson = JSLessonsList._collection.findOne({id: '1o'})
it "should return true for correct code 1", ->
code = """
//define falsey variable under this line:
var falseyVar = '';
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
//define falsey variable under this line:
var falseyVar = 0;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
//define falsey variable under this line:
var falseyVar = null;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
//define falsey variable under this line:
var falseyVar;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 5", ->
code = """
//define falsey variable under this line:
var falseyVar = NaN;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Loops', ->
lesson = JSLessonsList._collection.findOne({id: '1p'})
it "should return true for correct code 1", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
for (var i = 0; i < fruits.length; i++) {
console.log(fruits[i]);
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
for (var i = 0; i <= fruits.length - 1; i++) {
console.log(fruits[i]);
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Loops - while', ->
lesson = JSLessonsList._collection.findOne({id: '1t'})
it "should return true for correct code 1", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
//write while loop under this line:
var i = 0;
while (i < fruits.length) {
console.log(fruits[i]);
i++;
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
//write while loop under this line:
var i = 0;
while (i <= fruits.length - 1) {
console.log(fruits[i]);
i++;
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Functions', ->
lesson = JSLessonsList._collection.findOne({id: '1q'})
it "should return true for correct code 1", ->
code = """
function sum(numbers) {
var sum = 0;
for (var i = 0; i < numbers.length; i++) {
sum += numbers[i];
}
return sum;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
function sum(numbers) {
var s = 0;
for (var i = 0; i < numbers.length; i++) {
s += numbers[i];
}
return s;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
function sum(numbers) {
var s = 0;
for (var i = 0; i < numbers.length; i++) {
s = s + numbers[i];
}
return s;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
function sum(numbers) {
var s = 0;
for (var i = 0; i <= numbers.length - 1; i++) {
s = numbers[i] + s;
}
return s;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Objects', ->
lesson = JSLessonsList._collection.findOne({id: '1r'})
it "should return true for correct code 1", ->
code = """
function Person(name, age) {
this.name = name;
this.age = age;
this.sayHello = function() {
console.log('Hello, my name is ' + this.name);
console.log('And my age is ' + this.age);
}
}
var peter = new Person('<NAME>', 31);
peter.sayHello();
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Errors', ->
lesson = JSLessonsList._collection.findOne({id: '1x'})
it "should return true for correct code 1", ->
code = """
var boat = 'Titanic';
var obstruction = 'glacier';
if (boat == 'Titanic' && obstruction === 'glacier') {
throw new Error('Captain, we have a problem!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var boat = 'Titanic';
var obstruction = 'glacier';
if ((boat == \"Titanic\") && (obstruction === 'glacier')) {
throw new Error('Captain, we have a problem!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
, 2000)
| true | describe "JSLesson.checkAssignment", ->
#arithmetic operators
Meteor.startup ->
Meteor.setTimeout(
describe 'Statements', ->
lesson = JSLessonsList._collection.findOne({id: '1y'})
it "should return true for correct code", ->
code = """
console.log('statement 1');
console.log(\"statement 2\");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Expressions', ->
lesson = JSLessonsList._collection.findOne({id: '1c'})
it "should return true for correct code", ->
code = """
console.log(8 + 2 <= 11);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
console.log( (8 + 2) <= 11 );
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Variables introduction', ->
lesson = JSLessonsList._collection.findOne({id: '1d'})
it "should return true for correct code", ->
code = """
var emptyVariable;
console.log(emptyVariable);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return false for incorrect code 1", ->
code = """
var emptyVariable = 'lol';
console.log(emptyVariable);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
it "should return false for incorrect code 2", ->
code = """
var emptyVariable;
console.log(emptyVariable)
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
it "should return false for incorrect code 3", ->
code = """
var emptyVariable
console.log(emptyVariable);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'Coding conventions', ->
lesson = JSLessonsList._collection.findOne({id: '1u'})
it "should return true for correct code", ->
code = """
var message = 'Conventions are good for you';
console.log(1 + 2);
console.log(4 <= 5);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return false for incorrect code", ->
code = """
var message= 'Conventions are good for you';
console.log(1+2);
console.log(4<= 5);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'arithmetic operators', ->
lesson = JSLessonsList._collection.findOne({id: '1i'})
it "should not return true for code console.log(5 % 3);", ->
code = """
console.log(5 % 3);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toEqual('Result should be 3. Your result is 2')
it "should not return true for code console.log(11 % 3)", ->
code = """
console.log(11 % 3)
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toEqual('Missing semicolon')
it "should return true for code console.log(11 % 4);", ->
code = """
console.log(11 % 4);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Comparison operators', ->
lesson = JSLessonsList._collection.findOne({id: '1s'})
it "should not return true - missing semicolon", ->
code = """
//Following expressions must be evaluated to true
console.log(42 < 5)
console.log(6 === "6");
console.log(1 != "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
it "should return true for correct code 1", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 == "6");
console.log(1 == "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 !== "6");
console.log(1 !== "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 == "6");
console.log(1 !== "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
//Following expressions must be evaluated to true
console.log(42 > 5);
console.log(6 !== "6");
console.log(1 == "1");
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Assignment operators', ->
lesson = JSLessonsList._collection.findOne({id: '1j'})
it "should return true for correct code", ->
code = """
var number = 5;
number *= 2;
console.log(number);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'String variables', ->
lesson = JSLessonsList._collection.findOne({id: '1e'})
it "should return true for correct code", ->
code = """
var name = 'PI:NAME:<NAME>END_PI';
console.log(name);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Integer variables', ->
lesson = JSLessonsList._collection.findOne({id: '1f'})
it "should return true for correct code", ->
code = """
var x = 5123;
var y = 6;
var z = 10;
console.log(x * y + z);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'String operators', ->
lesson = JSLessonsList._collection.findOne({id: '1k'})
it "should return true for correct code", ->
code = """
var text = 'Hello';
text += ' world';
console.log(text);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Float variables', ->
lesson = JSLessonsList._collection.findOne({id: '1g'})
it "should return true for correct code", ->
code = """
var pi = 3.14;
var r = 5;
var circumference = 2 * pi * r;
console.log(circumference);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Boolean variables', ->
lesson = JSLessonsList._collection.findOne({id: '1h'})
it "should return true for correct code 1", ->
code = """
var isCoderMan = false;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var isCoderMan = true;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
var isCoderMan = 20 == 30;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
var isCoderMan = 20 === 30;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 5", ->
code = """
var isCoderMan = 20 <= 30;
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should NOT return true for incorrect code", ->
code = """
var isCoderMan = '';
console.log(isCoderMan);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'Arrays', ->
lesson = JSLessonsList._collection.findOne({id: '1l'})
it "should return true for correct code", ->
code = """
var fruits = ['apple', 'orange', 'banana'];
console.log(fruits[1]);
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Conditions', ->
lesson = JSLessonsList._collection.findOne({id: '1m'})
it "should return true for correct code", ->
code = """
var age = 65;
if (age >= 18) {
console.log('You are an adult');
} else {
console.log('You are a child');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Switch', ->
lesson = JSLessonsList._collection.findOne({id: '1v'})
it "should return true for correct code", ->
code = """
var letter = 'b';
switch (letter) {
case 'a':
console.log('letter \"a\"');
break;
case 'b':
console.log('letter \"b\"');
break;
case 'c':
console.log('letter \"c\"');
break;
default:
console.log('Unknown letter');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Logical operators', ->
lesson = JSLessonsList._collection.findOne({id: '1n'})
it "should return true for correct code 1", ->
code = """
var isPokemon = true;
var isPikachu = true;
if (isPokemon && isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var isPokemon = false;
var isPikachu = true;
if (isPokemon || isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
var isPokemon = true;
var isPikachu = true;
if (isPokemon || isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
var isPokemon = true;
var isPikachu = false;
if (isPokemon || isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should NOT return true for bad code", ->
code = """
var isPokemon = false;
var isPikachu = true;
if (isPokemon && isPikachu) {
console.log('Pika pika... Pikachu!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).not.toBe(true)
describe 'Falsey and truthy', ->
lesson = JSLessonsList._collection.findOne({id: '1o'})
it "should return true for correct code 1", ->
code = """
//define falsey variable under this line:
var falseyVar = '';
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
//define falsey variable under this line:
var falseyVar = 0;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
//define falsey variable under this line:
var falseyVar = null;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
//define falsey variable under this line:
var falseyVar;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 5", ->
code = """
//define falsey variable under this line:
var falseyVar = NaN;
if (!falseyVar) {
console.log('You understand falsey values');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Loops', ->
lesson = JSLessonsList._collection.findOne({id: '1p'})
it "should return true for correct code 1", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
for (var i = 0; i < fruits.length; i++) {
console.log(fruits[i]);
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
for (var i = 0; i <= fruits.length - 1; i++) {
console.log(fruits[i]);
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Loops - while', ->
lesson = JSLessonsList._collection.findOne({id: '1t'})
it "should return true for correct code 1", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
//write while loop under this line:
var i = 0;
while (i < fruits.length) {
console.log(fruits[i]);
i++;
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var fruits = ['orange', 'banana', 'pear'];
//write while loop under this line:
var i = 0;
while (i <= fruits.length - 1) {
console.log(fruits[i]);
i++;
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Functions', ->
lesson = JSLessonsList._collection.findOne({id: '1q'})
it "should return true for correct code 1", ->
code = """
function sum(numbers) {
var sum = 0;
for (var i = 0; i < numbers.length; i++) {
sum += numbers[i];
}
return sum;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
function sum(numbers) {
var s = 0;
for (var i = 0; i < numbers.length; i++) {
s += numbers[i];
}
return s;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 3", ->
code = """
function sum(numbers) {
var s = 0;
for (var i = 0; i < numbers.length; i++) {
s = s + numbers[i];
}
return s;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 4", ->
code = """
function sum(numbers) {
var s = 0;
for (var i = 0; i <= numbers.length - 1; i++) {
s = numbers[i] + s;
}
return s;
}
console.log(sum([2, 3, 6]));
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Objects', ->
lesson = JSLessonsList._collection.findOne({id: '1r'})
it "should return true for correct code 1", ->
code = """
function Person(name, age) {
this.name = name;
this.age = age;
this.sayHello = function() {
console.log('Hello, my name is ' + this.name);
console.log('And my age is ' + this.age);
}
}
var peter = new Person('PI:NAME:<NAME>END_PI', 31);
peter.sayHello();
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
describe 'Errors', ->
lesson = JSLessonsList._collection.findOne({id: '1x'})
it "should return true for correct code 1", ->
code = """
var boat = 'Titanic';
var obstruction = 'glacier';
if (boat == 'Titanic' && obstruction === 'glacier') {
throw new Error('Captain, we have a problem!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
it "should return true for correct code 2", ->
code = """
var boat = 'Titanic';
var obstruction = 'glacier';
if ((boat == \"Titanic\") && (obstruction === 'glacier')) {
throw new Error('Captain, we have a problem!');
}
"""
result = JSLesson.checkAssignment(
lesson: lesson
code: code
)
expect(result).toBe(true)
, 2000)
|
[
{
"context": "module.exports =\n stories: [\n headline: \"Clinton Lawyer: Hillary Erased All Emails from Private Server\"\n ",
"end": 61,
"score": 0.998155951499939,
"start": 47,
"tag": "NAME",
"value": "Clinton Lawyer"
},
{
"context": " =\n stories: [\n headline: \"Clinton Lawyer: Hillary Erased All Emails from Private Server\"\n url:",
"end": 70,
"score": 0.6831725835800171,
"start": 64,
"tag": "NAME",
"value": "illary"
},
{
"context": "Ax\"\n url: 'http://example.com'\n deck: '\"Andreas, open that door! Open that door!\"'\n tag: 'Ge",
"end": 830,
"score": 0.9601198434829712,
"start": 823,
"tag": "NAME",
"value": "Andreas"
}
] | src/scripts/data.coffee | adampash/react-front-module | 0 | module.exports =
stories: [
headline: "Clinton Lawyer: Hillary Erased All Emails from Private Server"
url: 'http://gawker.com/clinton-lawyer-hillary-erased-all-emails-from-private-1694247035'
deck: '"At the end, I chose not to keep my private, personal emails."'
tag: 'HRC'
id: 123801
img: 'http://dummyimage.com/318x318/000/fff'
,
headline: "Freedom Song: A Conversation About the State of Black Liberation Music"
url: 'http://example.com'
deck: 'It\'s not about celebrating one charismatic leader but celebrating thousands of them.'
tag: 'Music'
id: 123802
img: 'http://dummyimage.com/318x318/000/fff'
,
headline: "Report: Germanwings Captain Tried to Smash Into Locked Cockpit With Ax"
url: 'http://example.com'
deck: '"Andreas, open that door! Open that door!"'
tag: 'Germanwings'
id: 123805
img: 'http://dummyimage.com/318x318/000/fff'
]
| 149074 | module.exports =
stories: [
headline: "<NAME>: H<NAME> Erased All Emails from Private Server"
url: 'http://gawker.com/clinton-lawyer-hillary-erased-all-emails-from-private-1694247035'
deck: '"At the end, I chose not to keep my private, personal emails."'
tag: 'HRC'
id: 123801
img: 'http://dummyimage.com/318x318/000/fff'
,
headline: "Freedom Song: A Conversation About the State of Black Liberation Music"
url: 'http://example.com'
deck: 'It\'s not about celebrating one charismatic leader but celebrating thousands of them.'
tag: 'Music'
id: 123802
img: 'http://dummyimage.com/318x318/000/fff'
,
headline: "Report: Germanwings Captain Tried to Smash Into Locked Cockpit With Ax"
url: 'http://example.com'
deck: '"<NAME>, open that door! Open that door!"'
tag: 'Germanwings'
id: 123805
img: 'http://dummyimage.com/318x318/000/fff'
]
| true | module.exports =
stories: [
headline: "PI:NAME:<NAME>END_PI: HPI:NAME:<NAME>END_PI Erased All Emails from Private Server"
url: 'http://gawker.com/clinton-lawyer-hillary-erased-all-emails-from-private-1694247035'
deck: '"At the end, I chose not to keep my private, personal emails."'
tag: 'HRC'
id: 123801
img: 'http://dummyimage.com/318x318/000/fff'
,
headline: "Freedom Song: A Conversation About the State of Black Liberation Music"
url: 'http://example.com'
deck: 'It\'s not about celebrating one charismatic leader but celebrating thousands of them.'
tag: 'Music'
id: 123802
img: 'http://dummyimage.com/318x318/000/fff'
,
headline: "Report: Germanwings Captain Tried to Smash Into Locked Cockpit With Ax"
url: 'http://example.com'
deck: '"PI:NAME:<NAME>END_PI, open that door! Open that door!"'
tag: 'Germanwings'
id: 123805
img: 'http://dummyimage.com/318x318/000/fff'
]
|
[
{
"context": "nal notes required for the script>\n#\n# Author:\n# Yuya Ochiai <yuya0321@gmail.com>\n\npath = require 'path'\npacka",
"end": 688,
"score": 0.9998704195022583,
"start": 677,
"tag": "NAME",
"value": "Yuya Ochiai"
},
{
"context": "ired for the script>\n#\n# Author:\n# Yuya Ochiai <yuya0321@gmail.com>\n\npath = require 'path'\npackage_json = require pa",
"end": 708,
"score": 0.9999235272407532,
"start": 690,
"tag": "EMAIL",
"value": "yuya0321@gmail.com"
},
{
"context": "user: process.env.HUBOT_CHINACHU_USER,\n password: process.env.HUBOT_CHINACHU_PASSWORD,\n userAgent: process.env",
"end": 1031,
"score": 0.6739955544471741,
"start": 1020,
"tag": "PASSWORD",
"value": "process.env"
},
{
"context": ".env.HUBOT_CHINACHU_USER,\n password: process.env.HUBOT_CHINACHU_PASSWORD,\n userAgent: process.env.HUBOT_CHINACHU_USERAGEN",
"end": 1055,
"score": 0.9824338555335999,
"start": 1032,
"tag": "PASSWORD",
"value": "HUBOT_CHINACHU_PASSWORD"
}
] | src/chinachu.coffee | yuya-oc/hubot-chinachu | 0 | # Description
# A Hubot script for Chinachu
#
# Configuration:
# HUBOT_CHINACHU_URL
# HUBOT_CHINACHU_USER
# HUBOT_CHINACHU_PASSWORD
# HUBOT_CHINACHU_USERAGENT = "hubot-chinachu/#{package_version}"
#
# Commands:
# hubot chinachu now - Reply current broadcasting and recording programs
# hubot chinachu reserves - Reply reserved programs
# hubot chinachu reserve <programId> - Reserve the specified program manually
# hubot chinachu unreserve <programId> - Unreserve the reserved program manually
# hubot chinachu search <keyword> - Search programs with the keyword (full title, detail)
#
# Notes:
# <optional notes required for the script>
#
# Author:
# Yuya Ochiai <yuya0321@gmail.com>
path = require 'path'
package_json = require path.join __dirname, '../package.json'
process.env.HUBOT_CHINACHU_USERAGENT ||= "hubot-chinachu/#{package_json.version}"
chinachu = (require '../chinachu/index').remote({
url: process.env.HUBOT_CHINACHU_URL,
user: process.env.HUBOT_CHINACHU_USER,
password: process.env.HUBOT_CHINACHU_PASSWORD,
userAgent: process.env.HUBOT_CHINACHU_USERAGENT
});
format_program_data = (data) ->
zp2 = (num) -> ("0" + num).slice -2
start = new Date data.start
startStr = "#{zp2 (start.getMonth()+1)}/#{zp2 start.getDate()} #{zp2 start.getHours()}:#{zp2 start.getMinutes()}"
end = new Date data.end
endStr = "#{zp2 end.getHours()}:#{zp2 end.getMinutes()}"
return "#{data.channel.name} #{startStr}-#{endStr} - #{data.title} (#{data.id})"
module.exports = (robot) ->
robot.respond /chinachu\s+now$/i, (msg) ->
chinachu.recording.get()
.then (data) ->
if data.length isnt 0
message = 'Recording:\n'
message += data.map(format_program_data).join('\n')
msg.send message
return chinachu.schedule.broadcasting.get();
.then (data) ->
if data.length isnt 0
message = 'Broadcasting:\n'
message += data.map(format_program_data).join('\n')
msg.send message
.catch (err) ->
msg.send err.message
robot.respond /chinachu\s+reserves$/i, (msg) ->
chinachu.reserves.get()
.then (data) ->
if data.length isnt 0
message = data.map(format_program_data).join('\n')
msg.send message
else
msg.send "No reserves"
.catch (err) ->
msg.send err.message
robot.respond /chinachu\s+reserve\s+([^\s]+)$/im, (msg) ->
id = msg.match[1].trim()
chinachu.program.put(id)
.then (data) ->
return chinachu.program.get(id)
.then (data) ->
msg.send "#{format_program_data(data)} has been reserved"
.catch (err) ->
msg.send chinachu.program.errorMessage(err)
robot.respond /chinachu\s+unreserve\s+([^\s]+)$/im, (msg) ->
id = msg.match[1].trim()
chinachu.reserves.delete(id)
.then (data) ->
return chinachu.program.get(id)
.then (data) ->
msg.send "#{format_program_data(data)} has been unreserved"
.catch (err) ->
msg.send chinachu.program.errorMessage(err)
robot.respond /chinachu\s+search\s+([^\s]+)$/im, (msg) ->
keyword = msg.match[1].trim()
chinachu.schedule.programs.get()
.then (data) ->
results = data.filter (program) ->
return program.fullTitle.indexOf(keyword) != -1 || program.detail.indexOf(keyword) != -1
if results.length is 0
msg.send "no results"
else
message = results.map(format_program_data).join('\n')
msg.send message
.catch (err) ->
msg.send err.message
| 105300 | # Description
# A Hubot script for Chinachu
#
# Configuration:
# HUBOT_CHINACHU_URL
# HUBOT_CHINACHU_USER
# HUBOT_CHINACHU_PASSWORD
# HUBOT_CHINACHU_USERAGENT = "hubot-chinachu/#{package_version}"
#
# Commands:
# hubot chinachu now - Reply current broadcasting and recording programs
# hubot chinachu reserves - Reply reserved programs
# hubot chinachu reserve <programId> - Reserve the specified program manually
# hubot chinachu unreserve <programId> - Unreserve the reserved program manually
# hubot chinachu search <keyword> - Search programs with the keyword (full title, detail)
#
# Notes:
# <optional notes required for the script>
#
# Author:
# <NAME> <<EMAIL>>
path = require 'path'
package_json = require path.join __dirname, '../package.json'
process.env.HUBOT_CHINACHU_USERAGENT ||= "hubot-chinachu/#{package_json.version}"
chinachu = (require '../chinachu/index').remote({
url: process.env.HUBOT_CHINACHU_URL,
user: process.env.HUBOT_CHINACHU_USER,
password: <PASSWORD>.<PASSWORD>,
userAgent: process.env.HUBOT_CHINACHU_USERAGENT
});
format_program_data = (data) ->
zp2 = (num) -> ("0" + num).slice -2
start = new Date data.start
startStr = "#{zp2 (start.getMonth()+1)}/#{zp2 start.getDate()} #{zp2 start.getHours()}:#{zp2 start.getMinutes()}"
end = new Date data.end
endStr = "#{zp2 end.getHours()}:#{zp2 end.getMinutes()}"
return "#{data.channel.name} #{startStr}-#{endStr} - #{data.title} (#{data.id})"
module.exports = (robot) ->
robot.respond /chinachu\s+now$/i, (msg) ->
chinachu.recording.get()
.then (data) ->
if data.length isnt 0
message = 'Recording:\n'
message += data.map(format_program_data).join('\n')
msg.send message
return chinachu.schedule.broadcasting.get();
.then (data) ->
if data.length isnt 0
message = 'Broadcasting:\n'
message += data.map(format_program_data).join('\n')
msg.send message
.catch (err) ->
msg.send err.message
robot.respond /chinachu\s+reserves$/i, (msg) ->
chinachu.reserves.get()
.then (data) ->
if data.length isnt 0
message = data.map(format_program_data).join('\n')
msg.send message
else
msg.send "No reserves"
.catch (err) ->
msg.send err.message
robot.respond /chinachu\s+reserve\s+([^\s]+)$/im, (msg) ->
id = msg.match[1].trim()
chinachu.program.put(id)
.then (data) ->
return chinachu.program.get(id)
.then (data) ->
msg.send "#{format_program_data(data)} has been reserved"
.catch (err) ->
msg.send chinachu.program.errorMessage(err)
robot.respond /chinachu\s+unreserve\s+([^\s]+)$/im, (msg) ->
id = msg.match[1].trim()
chinachu.reserves.delete(id)
.then (data) ->
return chinachu.program.get(id)
.then (data) ->
msg.send "#{format_program_data(data)} has been unreserved"
.catch (err) ->
msg.send chinachu.program.errorMessage(err)
robot.respond /chinachu\s+search\s+([^\s]+)$/im, (msg) ->
keyword = msg.match[1].trim()
chinachu.schedule.programs.get()
.then (data) ->
results = data.filter (program) ->
return program.fullTitle.indexOf(keyword) != -1 || program.detail.indexOf(keyword) != -1
if results.length is 0
msg.send "no results"
else
message = results.map(format_program_data).join('\n')
msg.send message
.catch (err) ->
msg.send err.message
| true | # Description
# A Hubot script for Chinachu
#
# Configuration:
# HUBOT_CHINACHU_URL
# HUBOT_CHINACHU_USER
# HUBOT_CHINACHU_PASSWORD
# HUBOT_CHINACHU_USERAGENT = "hubot-chinachu/#{package_version}"
#
# Commands:
# hubot chinachu now - Reply current broadcasting and recording programs
# hubot chinachu reserves - Reply reserved programs
# hubot chinachu reserve <programId> - Reserve the specified program manually
# hubot chinachu unreserve <programId> - Unreserve the reserved program manually
# hubot chinachu search <keyword> - Search programs with the keyword (full title, detail)
#
# Notes:
# <optional notes required for the script>
#
# Author:
# PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
path = require 'path'
package_json = require path.join __dirname, '../package.json'
process.env.HUBOT_CHINACHU_USERAGENT ||= "hubot-chinachu/#{package_json.version}"
chinachu = (require '../chinachu/index').remote({
url: process.env.HUBOT_CHINACHU_URL,
user: process.env.HUBOT_CHINACHU_USER,
password: PI:PASSWORD:<PASSWORD>END_PI.PI:PASSWORD:<PASSWORD>END_PI,
userAgent: process.env.HUBOT_CHINACHU_USERAGENT
});
format_program_data = (data) ->
zp2 = (num) -> ("0" + num).slice -2
start = new Date data.start
startStr = "#{zp2 (start.getMonth()+1)}/#{zp2 start.getDate()} #{zp2 start.getHours()}:#{zp2 start.getMinutes()}"
end = new Date data.end
endStr = "#{zp2 end.getHours()}:#{zp2 end.getMinutes()}"
return "#{data.channel.name} #{startStr}-#{endStr} - #{data.title} (#{data.id})"
module.exports = (robot) ->
robot.respond /chinachu\s+now$/i, (msg) ->
chinachu.recording.get()
.then (data) ->
if data.length isnt 0
message = 'Recording:\n'
message += data.map(format_program_data).join('\n')
msg.send message
return chinachu.schedule.broadcasting.get();
.then (data) ->
if data.length isnt 0
message = 'Broadcasting:\n'
message += data.map(format_program_data).join('\n')
msg.send message
.catch (err) ->
msg.send err.message
robot.respond /chinachu\s+reserves$/i, (msg) ->
chinachu.reserves.get()
.then (data) ->
if data.length isnt 0
message = data.map(format_program_data).join('\n')
msg.send message
else
msg.send "No reserves"
.catch (err) ->
msg.send err.message
robot.respond /chinachu\s+reserve\s+([^\s]+)$/im, (msg) ->
id = msg.match[1].trim()
chinachu.program.put(id)
.then (data) ->
return chinachu.program.get(id)
.then (data) ->
msg.send "#{format_program_data(data)} has been reserved"
.catch (err) ->
msg.send chinachu.program.errorMessage(err)
robot.respond /chinachu\s+unreserve\s+([^\s]+)$/im, (msg) ->
id = msg.match[1].trim()
chinachu.reserves.delete(id)
.then (data) ->
return chinachu.program.get(id)
.then (data) ->
msg.send "#{format_program_data(data)} has been unreserved"
.catch (err) ->
msg.send chinachu.program.errorMessage(err)
robot.respond /chinachu\s+search\s+([^\s]+)$/im, (msg) ->
keyword = msg.match[1].trim()
chinachu.schedule.programs.get()
.then (data) ->
results = data.filter (program) ->
return program.fullTitle.indexOf(keyword) != -1 || program.detail.indexOf(keyword) != -1
if results.length is 0
msg.send "no results"
else
message = results.map(format_program_data).join('\n')
msg.send message
.catch (err) ->
msg.send err.message
|
[
{
"context": "nom d'utilisateur ici\"\n \"add_bank_password\" : \"Mot de passe\"\n \"add_bank_password_placeholder\" : \"Entrez vo",
"end": 497,
"score": 0.9937903881072998,
"start": 485,
"tag": "PASSWORD",
"value": "Mot de passe"
}
] | client/app/locales/fr.coffee | einSelbst/cozy-pfm | 0 | module.exports =
#
# Menu - topbar
#
"menu_accounts" : "Comptes"
"menu_balance" : "Soldes"
"menu_search" : "Recherche"
"menu_add_bank": "Ajouter des comptes"
"overall_balance": "Solde total : "
#
# Add a new bank dialog
#
"add_bank_bank" : "Banque"
"add_bank_credentials" : "Identifiants"
"add_bank_login" : "Nom d'utilisateur"
"add_bank_login_placeholder" : "Entrez votre nom d'utilisateur ici"
"add_bank_password" : "Mot de passe"
"add_bank_password_placeholder" : "Entrez votre mot de passe ici"
"add_bank_security_notice" : "Information concernant la sécurité"
# the actual text of the security notice
"add_bank_security_notice_text" : "Votre nom d'utilisateur et votre mot de passe sont chiffrés dans la base de données. En conséquence, seules les applications possdéant la permission d'accéder au 'BankAccess' pourront voir ces informations déchiffrés. Soyez sûr que la sécurité est la priorité de cette application."
# buttons
"add_bank_cancel" : "cancel"
"add_bank_ok" : "Verify & Save"
#
# Balance
#
"balance_please_choose_account" : "Veuillez sélectionner un compte dans le menu de gauche pour afficher ses opérations."
"balance_banks_empty" : "Il n'y a pas de comptes bancaires dans votre Cozy pour l'instant. Ajoutez-en un dès maintenant !"
# table headers
"header_date" : "Date"
"header_title": "Titre"
"header_amount" : "Montant"
"balance_last_checked" : "Dernière vérification"
"balance_recheck_now" : "Vérifier maintenant."
#
# Search
#
"search_date_from" : "Depuis"
"search_date_to" : "Jusqu'à"
"search_amount_from" : "De"
"search_amount_to" : "A"
"search_text" : "Le titre contient"
#
# Accounts
#
"accounts_delete_bank" : "supprimer cette banque de Cozy"
"accounts_delete_bank_title" : "Une confirmation est nécessaire"
"accounts_delete_bank_prompt" : "Êtes-vous sûr ? Cette opération est irréverisible et supprimera TOUTES les données relatives à cette banque de votre Cozy."
"accounts_delete_bank_confirm" : "supprimer définitivement"
"accounts_delete_account" : "supprimer ce compte de Cozy"
"accounts_delete_account_title" : "Une confirmation est nécessaire"
"accounts_delete_account_prompt" : "Êtes-vous sûr ? Cette opération est irréverisible et supprimera TOUTES les données relatives à ce compte de votre Cozy."
"accounts_delete_account_confirm" : "supprimer définitivement"
# Alerts/Reporting
"accounts_alerts_title": "Rapports et alertes"
"accounts_alerts_title_periodic": "Rapports périodiques"
"accounts_alerts_periodic_add": "ajouter au rapport périodique"
"accounts_alerts_title_balance": "Alertes sur le solde"
"accounts_alerts_balance_add": "ajouter une nouvelle alerte sur le solde du compte"
"accounts_alerts_title_transaction": "ALertes sur les transactions"
"accounts_alerts_transaction_add": "ajouter une nouvelle alerte sur les transactions"
"accounts_alerts_report_text_1" : "Ajouter à"
"accounts_alerts_report_text_2" : "rapport par email."
"accounts_alerts_balance_text_1" : "Lorsque le solde est"
"accounts_alerts_balance_text_2" : "que"
"accounts_alerts_transaction_text_1" : "Lorsque le montant d'une transaction est"
"accounts_alerts_transaction_text_2" : "que"
"accounts_alerts_daily" : "quotidien"
"accounts_alerts_monthly" : "mensuel"
"accounts_alerts_weekly" : "hebdomadaire"
"accounts_alerts_lower" : "plus petit"
"accounts_alerts_highier" : "plus grand"
"accounts_alerts_save" : "enregistrer"
"accounts_alerts_cancel" : "annuler"
"accounts_alerts_delete" : "supprimer"
#
# Errors/Alerts
#
"alert_sure_delete_bank" : "Vous êtes sur le point de supprimer toutes les données lié à cette banque. Cette opération est irréversible. Êtes-vous sûr ?"
"alert_sure_delete_account" : "Vous êtes sur le point de supprimer toutes les données lié à ce compte. Cette opération est irréversible. Êtes-vous sûr ?"
"error_loading_accounts" : "Une erreur est survenue lors du charzgement de vos comptes bancaires. Veuillez rafraîchir la page ou rééessayer plus tard."
"fatal_error" : "Une erreur inconnue a eu lieu, veuillez rafraîchir la page."
"error_check_credentials_btn" : "Echec de la connexion au serveur. Cliquez pour réessayer."
"error_check_credentials" : "Nous n'avons pas vu nous connecter au serveur de votre banque. Veuillez vérifier que vos identifiants sont corrects et réessayer à nouveau."
"access already exists" : "Vous essayez d'ajouter un accès bancaire déjà existant."
"access already exists button" : "Cet accès bancaire existe déjà."
#
# Misc
#
"loading" : "chargement en cours..."
"verifying" : "vérification en cours..."
"cancel" : "annuler"
"removing" : "suppression en cours..."
"error" : "erreur..."
"sent" : "envoyé avec succès..."
"error_refresh" : "Une erreur est survenue, veuillez recharger la page et réessayer."
| 144315 | module.exports =
#
# Menu - topbar
#
"menu_accounts" : "Comptes"
"menu_balance" : "Soldes"
"menu_search" : "Recherche"
"menu_add_bank": "Ajouter des comptes"
"overall_balance": "Solde total : "
#
# Add a new bank dialog
#
"add_bank_bank" : "Banque"
"add_bank_credentials" : "Identifiants"
"add_bank_login" : "Nom d'utilisateur"
"add_bank_login_placeholder" : "Entrez votre nom d'utilisateur ici"
"add_bank_password" : "<PASSWORD>"
"add_bank_password_placeholder" : "Entrez votre mot de passe ici"
"add_bank_security_notice" : "Information concernant la sécurité"
# the actual text of the security notice
"add_bank_security_notice_text" : "Votre nom d'utilisateur et votre mot de passe sont chiffrés dans la base de données. En conséquence, seules les applications possdéant la permission d'accéder au 'BankAccess' pourront voir ces informations déchiffrés. Soyez sûr que la sécurité est la priorité de cette application."
# buttons
"add_bank_cancel" : "cancel"
"add_bank_ok" : "Verify & Save"
#
# Balance
#
"balance_please_choose_account" : "Veuillez sélectionner un compte dans le menu de gauche pour afficher ses opérations."
"balance_banks_empty" : "Il n'y a pas de comptes bancaires dans votre Cozy pour l'instant. Ajoutez-en un dès maintenant !"
# table headers
"header_date" : "Date"
"header_title": "Titre"
"header_amount" : "Montant"
"balance_last_checked" : "Dernière vérification"
"balance_recheck_now" : "Vérifier maintenant."
#
# Search
#
"search_date_from" : "Depuis"
"search_date_to" : "Jusqu'à"
"search_amount_from" : "De"
"search_amount_to" : "A"
"search_text" : "Le titre contient"
#
# Accounts
#
"accounts_delete_bank" : "supprimer cette banque de Cozy"
"accounts_delete_bank_title" : "Une confirmation est nécessaire"
"accounts_delete_bank_prompt" : "Êtes-vous sûr ? Cette opération est irréverisible et supprimera TOUTES les données relatives à cette banque de votre Cozy."
"accounts_delete_bank_confirm" : "supprimer définitivement"
"accounts_delete_account" : "supprimer ce compte de Cozy"
"accounts_delete_account_title" : "Une confirmation est nécessaire"
"accounts_delete_account_prompt" : "Êtes-vous sûr ? Cette opération est irréverisible et supprimera TOUTES les données relatives à ce compte de votre Cozy."
"accounts_delete_account_confirm" : "supprimer définitivement"
# Alerts/Reporting
"accounts_alerts_title": "Rapports et alertes"
"accounts_alerts_title_periodic": "Rapports périodiques"
"accounts_alerts_periodic_add": "ajouter au rapport périodique"
"accounts_alerts_title_balance": "Alertes sur le solde"
"accounts_alerts_balance_add": "ajouter une nouvelle alerte sur le solde du compte"
"accounts_alerts_title_transaction": "ALertes sur les transactions"
"accounts_alerts_transaction_add": "ajouter une nouvelle alerte sur les transactions"
"accounts_alerts_report_text_1" : "Ajouter à"
"accounts_alerts_report_text_2" : "rapport par email."
"accounts_alerts_balance_text_1" : "Lorsque le solde est"
"accounts_alerts_balance_text_2" : "que"
"accounts_alerts_transaction_text_1" : "Lorsque le montant d'une transaction est"
"accounts_alerts_transaction_text_2" : "que"
"accounts_alerts_daily" : "quotidien"
"accounts_alerts_monthly" : "mensuel"
"accounts_alerts_weekly" : "hebdomadaire"
"accounts_alerts_lower" : "plus petit"
"accounts_alerts_highier" : "plus grand"
"accounts_alerts_save" : "enregistrer"
"accounts_alerts_cancel" : "annuler"
"accounts_alerts_delete" : "supprimer"
#
# Errors/Alerts
#
"alert_sure_delete_bank" : "Vous êtes sur le point de supprimer toutes les données lié à cette banque. Cette opération est irréversible. Êtes-vous sûr ?"
"alert_sure_delete_account" : "Vous êtes sur le point de supprimer toutes les données lié à ce compte. Cette opération est irréversible. Êtes-vous sûr ?"
"error_loading_accounts" : "Une erreur est survenue lors du charzgement de vos comptes bancaires. Veuillez rafraîchir la page ou rééessayer plus tard."
"fatal_error" : "Une erreur inconnue a eu lieu, veuillez rafraîchir la page."
"error_check_credentials_btn" : "Echec de la connexion au serveur. Cliquez pour réessayer."
"error_check_credentials" : "Nous n'avons pas vu nous connecter au serveur de votre banque. Veuillez vérifier que vos identifiants sont corrects et réessayer à nouveau."
"access already exists" : "Vous essayez d'ajouter un accès bancaire déjà existant."
"access already exists button" : "Cet accès bancaire existe déjà."
#
# Misc
#
"loading" : "chargement en cours..."
"verifying" : "vérification en cours..."
"cancel" : "annuler"
"removing" : "suppression en cours..."
"error" : "erreur..."
"sent" : "envoyé avec succès..."
"error_refresh" : "Une erreur est survenue, veuillez recharger la page et réessayer."
| true | module.exports =
#
# Menu - topbar
#
"menu_accounts" : "Comptes"
"menu_balance" : "Soldes"
"menu_search" : "Recherche"
"menu_add_bank": "Ajouter des comptes"
"overall_balance": "Solde total : "
#
# Add a new bank dialog
#
"add_bank_bank" : "Banque"
"add_bank_credentials" : "Identifiants"
"add_bank_login" : "Nom d'utilisateur"
"add_bank_login_placeholder" : "Entrez votre nom d'utilisateur ici"
"add_bank_password" : "PI:PASSWORD:<PASSWORD>END_PI"
"add_bank_password_placeholder" : "Entrez votre mot de passe ici"
"add_bank_security_notice" : "Information concernant la sécurité"
# the actual text of the security notice
"add_bank_security_notice_text" : "Votre nom d'utilisateur et votre mot de passe sont chiffrés dans la base de données. En conséquence, seules les applications possdéant la permission d'accéder au 'BankAccess' pourront voir ces informations déchiffrés. Soyez sûr que la sécurité est la priorité de cette application."
# buttons
"add_bank_cancel" : "cancel"
"add_bank_ok" : "Verify & Save"
#
# Balance
#
"balance_please_choose_account" : "Veuillez sélectionner un compte dans le menu de gauche pour afficher ses opérations."
"balance_banks_empty" : "Il n'y a pas de comptes bancaires dans votre Cozy pour l'instant. Ajoutez-en un dès maintenant !"
# table headers
"header_date" : "Date"
"header_title": "Titre"
"header_amount" : "Montant"
"balance_last_checked" : "Dernière vérification"
"balance_recheck_now" : "Vérifier maintenant."
#
# Search
#
"search_date_from" : "Depuis"
"search_date_to" : "Jusqu'à"
"search_amount_from" : "De"
"search_amount_to" : "A"
"search_text" : "Le titre contient"
#
# Accounts
#
"accounts_delete_bank" : "supprimer cette banque de Cozy"
"accounts_delete_bank_title" : "Une confirmation est nécessaire"
"accounts_delete_bank_prompt" : "Êtes-vous sûr ? Cette opération est irréverisible et supprimera TOUTES les données relatives à cette banque de votre Cozy."
"accounts_delete_bank_confirm" : "supprimer définitivement"
"accounts_delete_account" : "supprimer ce compte de Cozy"
"accounts_delete_account_title" : "Une confirmation est nécessaire"
"accounts_delete_account_prompt" : "Êtes-vous sûr ? Cette opération est irréverisible et supprimera TOUTES les données relatives à ce compte de votre Cozy."
"accounts_delete_account_confirm" : "supprimer définitivement"
# Alerts/Reporting
"accounts_alerts_title": "Rapports et alertes"
"accounts_alerts_title_periodic": "Rapports périodiques"
"accounts_alerts_periodic_add": "ajouter au rapport périodique"
"accounts_alerts_title_balance": "Alertes sur le solde"
"accounts_alerts_balance_add": "ajouter une nouvelle alerte sur le solde du compte"
"accounts_alerts_title_transaction": "ALertes sur les transactions"
"accounts_alerts_transaction_add": "ajouter une nouvelle alerte sur les transactions"
"accounts_alerts_report_text_1" : "Ajouter à"
"accounts_alerts_report_text_2" : "rapport par email."
"accounts_alerts_balance_text_1" : "Lorsque le solde est"
"accounts_alerts_balance_text_2" : "que"
"accounts_alerts_transaction_text_1" : "Lorsque le montant d'une transaction est"
"accounts_alerts_transaction_text_2" : "que"
"accounts_alerts_daily" : "quotidien"
"accounts_alerts_monthly" : "mensuel"
"accounts_alerts_weekly" : "hebdomadaire"
"accounts_alerts_lower" : "plus petit"
"accounts_alerts_highier" : "plus grand"
"accounts_alerts_save" : "enregistrer"
"accounts_alerts_cancel" : "annuler"
"accounts_alerts_delete" : "supprimer"
#
# Errors/Alerts
#
"alert_sure_delete_bank" : "Vous êtes sur le point de supprimer toutes les données lié à cette banque. Cette opération est irréversible. Êtes-vous sûr ?"
"alert_sure_delete_account" : "Vous êtes sur le point de supprimer toutes les données lié à ce compte. Cette opération est irréversible. Êtes-vous sûr ?"
"error_loading_accounts" : "Une erreur est survenue lors du charzgement de vos comptes bancaires. Veuillez rafraîchir la page ou rééessayer plus tard."
"fatal_error" : "Une erreur inconnue a eu lieu, veuillez rafraîchir la page."
"error_check_credentials_btn" : "Echec de la connexion au serveur. Cliquez pour réessayer."
"error_check_credentials" : "Nous n'avons pas vu nous connecter au serveur de votre banque. Veuillez vérifier que vos identifiants sont corrects et réessayer à nouveau."
"access already exists" : "Vous essayez d'ajouter un accès bancaire déjà existant."
"access already exists button" : "Cet accès bancaire existe déjà."
#
# Misc
#
"loading" : "chargement en cours..."
"verifying" : "vérification en cours..."
"cancel" : "annuler"
"removing" : "suppression en cours..."
"error" : "erreur..."
"sent" : "envoyé avec succès..."
"error_refresh" : "Une erreur est survenue, veuillez recharger la page et réessayer."
|
[
{
"context": "JSON\n 'my.host.org': \n username: 'richard'\n password: 'p@s$w0rd'\n 'my.secon",
"end": 406,
"score": 0.9994513392448425,
"start": 399,
"tag": "USERNAME",
"value": "richard"
},
{
"context": " username: 'richard'\n password: 'p@s$w0rd'\n 'my.second.host.org':\n username",
"end": 437,
"score": 0.9993476867675781,
"start": 429,
"tag": "PASSWORD",
"value": "p@s$w0rd"
},
{
"context": " 'my.second.host.org':\n username: 'george'\n password: 'p@s$w0rd'\n\n describe 're",
"end": 496,
"score": 0.9987741708755493,
"start": 490,
"tag": "USERNAME",
"value": "george"
},
{
"context": " username: 'george'\n password: 'p@s$w0rd'\n\n describe 'read', ->\n host = null\n\n ",
"end": 527,
"score": 0.9993525743484497,
"start": 519,
"tag": "PASSWORD",
"value": "p@s$w0rd"
},
{
"context": " auth.add('https://nonexistant.org', { username: 'superman', password: '$super-pa$sw0rd'})\n\n it 'sh",
"end": 2187,
"score": 0.9996426105499268,
"start": 2179,
"tag": "USERNAME",
"value": "superman"
},
{
"context": "onexistant.org', { username: 'superman', password: '$super-pa$sw0rd'})\n\n it 'should create a new host with c",
"end": 2216,
"score": 0.9993860721588135,
"start": 2200,
"tag": "PASSWORD",
"value": "'$super-pa$sw0rd"
},
{
"context": " expect(host.auth()).to.deep.equal({ username: 'superman', password: '$super-pa$sw0rd'})\n\n describe",
"end": 2410,
"score": 0.999610960483551,
"start": 2402,
"tag": "USERNAME",
"value": "superman"
},
{
"context": ")).to.deep.equal({ username: 'superman', password: '$super-pa$sw0rd'})\n\n describe 'with full object parameter'",
"end": 2439,
"score": 0.9993956089019775,
"start": 2423,
"tag": "PASSWORD",
"value": "'$super-pa$sw0rd"
},
{
"context": "uth.add({ 'https://nonexistant.org': { username: 'superman', password: '$super-pa$sw0rd'} })\n\n it '",
"end": 2586,
"score": 0.9996525049209595,
"start": 2578,
"tag": "USERNAME",
"value": "superman"
},
{
"context": "onexistant.org': { username: 'superman', password: '$super-pa$sw0rd'} })\n\n it 'should create a new host with",
"end": 2615,
"score": 0.9994168877601624,
"start": 2599,
"tag": "PASSWORD",
"value": "'$super-pa$sw0rd"
},
{
"context": " expect(host.auth()).to.deep.equal({ username: 'superman', password: '$super-pa$sw0rd'})\n\n describe 'r",
"end": 2811,
"score": 0.999610424041748,
"start": 2803,
"tag": "USERNAME",
"value": "superman"
},
{
"context": ")).to.deep.equal({ username: 'superman', password: '$super-pa$sw0rd'})\n\n describe 'remove', ->\n host = null\n",
"end": 2840,
"score": 0.9992271661758423,
"start": 2824,
"tag": "PASSWORD",
"value": "'$super-pa$sw0rd"
},
{
"context": "e given host', ->\n expect(host.username('superman')).to.be.equal('superman')\n expect(host.",
"end": 4165,
"score": 0.9996023178100586,
"start": 4157,
"tag": "USERNAME",
"value": "superman"
},
{
"context": " expect(host.username('superman')).to.be.equal('superman')\n expect(host.auth()).to.deep.equal\n ",
"end": 4190,
"score": 0.9995681047439575,
"start": 4182,
"tag": "USERNAME",
"value": "superman"
},
{
"context": "host.auth()).to.deep.equal\n username: 'superman'\n password: 'p@s$w0rd'\n\n it 'sh",
"end": 4268,
"score": 0.999637246131897,
"start": 4260,
"tag": "USERNAME",
"value": "superman"
},
{
"context": " username: 'superman'\n password: 'p@s$w0rd'\n\n it 'should update the password for the ",
"end": 4301,
"score": 0.999374508857727,
"start": 4293,
"tag": "PASSWORD",
"value": "p@s$w0rd"
},
{
"context": "e given host', ->\n expect(host.password('my_n€w_svp3r_p@s$w0rd')).to.be.equal('my_n€w_svp3r_p@s",
"end": 4403,
"score": 0.8322839140892029,
"start": 4399,
"tag": "PASSWORD",
"value": "my_n"
},
{
"context": "en host', ->\n expect(host.password('my_n€w_svp3r_p@s$w0rd')).to.be.equal('my_n€w_svp3r_p@s$w",
"end": 4405,
"score": 0.5301342606544495,
"start": 4404,
"tag": "PASSWORD",
"value": "w"
},
{
"context": "st', ->\n expect(host.password('my_n€w_svp3r_p@s$w0rd')).to.be.equal('my_n€w_svp3r_p@s$w0rd')\n",
"end": 4411,
"score": 0.8459300994873047,
"start": 4409,
"tag": "PASSWORD",
"value": "3r"
},
{
"context": ", ->\n expect(host.password('my_n€w_svp3r_p@s$w0rd')).to.be.equal('my_n€w_svp3r_p@s$w0rd')\n ",
"end": 4420,
"score": 0.8277061581611633,
"start": 4412,
"tag": "PASSWORD",
"value": "p@s$w0rd"
},
{
"context": "t.password('my_n€w_svp3r_p@s$w0rd')).to.be.equal('my_n€w_svp3r_p@s$w0rd')\n expect(host.auth()).",
"end": 4441,
"score": 0.7085488438606262,
"start": 4437,
"tag": "PASSWORD",
"value": "my_n"
},
{
"context": "word('my_n€w_svp3r_p@s$w0rd')).to.be.equal('my_n€w_svp3r_p@s$w0rd')\n expect(host.auth()).to.deep.",
"end": 4449,
"score": 0.6400386691093445,
"start": 4444,
"tag": "PASSWORD",
"value": "svp3r"
},
{
"context": "y_n€w_svp3r_p@s$w0rd')).to.be.equal('my_n€w_svp3r_p@s$w0rd')\n expect(host.auth()).to.deep.equal\n ",
"end": 4458,
"score": 0.7952336668968201,
"start": 4450,
"tag": "PASSWORD",
"value": "p@s$w0rd"
},
{
"context": "host.auth()).to.deep.equal\n username: 'richard'\n password: 'my_n€w_svp3r_p@s$w0rd'\n\n ",
"end": 4535,
"score": 0.9996522665023804,
"start": 4528,
"tag": "USERNAME",
"value": "richard"
},
{
"context": " username: 'richard'\n password: 'my_n€w_svp3r_p@s$w0rd'\n\n describe 'update both username and passwo",
"end": 4581,
"score": 0.9993899464607239,
"start": 4560,
"tag": "PASSWORD",
"value": "my_n€w_svp3r_p@s$w0rd"
},
{
"context": "_p@s$w0rd')).to.deep.equal\n username: 'superman'\n password: 'my_n€w_svp3r_p@s$w0rd'\n\n ",
"end": 4824,
"score": 0.9996269941329956,
"start": 4816,
"tag": "USERNAME",
"value": "superman"
},
{
"context": " username: 'superman'\n password: 'my_n€w_svp3r_p@s$w0rd'\n\n it 'should update the auth for the give",
"end": 4870,
"score": 0.9993734359741211,
"start": 4849,
"tag": "PASSWORD",
"value": "my_n€w_svp3r_p@s$w0rd"
},
{
"context": " .to.deep.equal\n username: 'superman'\n password: 'my_n€w_svp3r_p@s$w0rd'\n",
"end": 5108,
"score": 0.9996210336685181,
"start": 5100,
"tag": "USERNAME",
"value": "superman"
},
{
"context": " username: 'superman'\n password: 'my_n€w_svp3r_p@s$w0rd'\n\n describe 'update both username and passwo",
"end": 5156,
"score": 0.9993630647659302,
"start": 5135,
"tag": "PASSWORD",
"value": "my_n€w_svp3r_p@s$w0rd"
},
{
"context": "_p@s$w0rd')).to.deep.equal\n username: 'superman'\n password: 'my_n€w_svp3r_p@s$w0rd'\n\n ",
"end": 5398,
"score": 0.9996274709701538,
"start": 5390,
"tag": "USERNAME",
"value": "superman"
},
{
"context": " username: 'superman'\n password: 'my_n€w_svp3r_p@s$w0rd'\n\n it 'should update the auth for the give",
"end": 5444,
"score": 0.9993489384651184,
"start": 5423,
"tag": "PASSWORD",
"value": "my_n€w_svp3r_p@s$w0rd"
},
{
"context": "xpect(host.auth('superman', { value: 'my_n€w_svp3r_p@s$w0rd', cipher: 'plain' } ))\n .to.deep.equal",
"end": 5598,
"score": 0.9974254965782166,
"start": 5590,
"tag": "PASSWORD",
"value": "p@s$w0rd"
},
{
"context": " .to.deep.equal\n username: 'superman'\n password: 'my_n€w_svp3r_p@s$w0rd'\n",
"end": 5682,
"score": 0.9996471405029297,
"start": 5674,
"tag": "USERNAME",
"value": "superman"
},
{
"context": " username: 'superman'\n password: 'my_n€w_svp3r_p@s$w0rd'\n\n",
"end": 5730,
"score": 0.999440610408783,
"start": 5709,
"tag": "PASSWORD",
"value": "my_n€w_svp3r_p@s$w0rd"
}
] | test/crudHostSpec.coffee | h2non/node-authrc | 1 | { expect } = require 'chai'
fs = require 'fs'
Authrc = require '../lib/authrc'
describe 'create/read/update/remove config', ->
authRcPath = "#{__dirname}/fixtures/tmp/.authrc"
auth = null
writeJSON = (data) ->
fs.writeFileSync authRcPath, JSON.stringify(data, null, 4)
describe 'playing with hosts data', ->
before ->
writeJSON
'my.host.org':
username: 'richard'
password: 'p@s$w0rd'
'my.second.host.org':
username: 'george'
password: 'p@s$w0rd'
describe 'read', ->
host = null
before ->
auth = new Authrc(authRcPath)
it 'should find the file and has some data', ->
expect(auth.exists()).to.be.true
describe 'existant host', ->
beforeEach ->
host = auth.host('https://my.second.host.org')
it 'should find the host from Authrc class', ->
expect(auth.hostExists('https://my.second.host.org')).to.be.true
it 'should find the host from Host class', ->
expect(host.exists()).to.be.true
describe 'existant host', ->
beforeEach ->
host = auth.host('https://nonexistant.org')
it 'should not find the host from Authrc class', ->
expect(auth.hostExists('https://nonexistant.org')).to.be.false
it 'should not find the host from Host class', ->
expect(host.exists()).to.be.false
describe 'create', ->
host = null
before ->
auth = new Authrc(authRcPath)
beforeEach ->
host = auth.host('https://nonexistant.org')
it 'should find the file and has some data', ->
expect(auth.exists()).to.be.true
it 'should not find the host', ->
expect(auth.hostExists('https://nonexistant.org')).to.be.false
expect(host.exists()).to.be.false
describe 'create new host', ->
it 'should create a new host with empty auth credentials', ->
auth.add('https://nonexistant.org')
expect(host.auth()).to.be.equal(null)
describe 'with auth object', ->
before ->
auth.add('https://nonexistant.org', { username: 'superman', password: '$super-pa$sw0rd'})
it 'should create a new host with credentials object', ->
expect(host.auth()).to.not.be.equal(null)
expect(host.auth()).to.deep.equal({ username: 'superman', password: '$super-pa$sw0rd'})
describe 'with full object parameter', ->
before ->
auth.add({ 'https://nonexistant.org': { username: 'superman', password: '$super-pa$sw0rd'} })
it 'should create a new host with credentials object', ->
expect(host.auth()).to.not.be.equal(null)
expect(host.auth()).to.deep.equal({ username: 'superman', password: '$super-pa$sw0rd'})
describe 'remove', ->
host = null
beforeEach ->
auth = new Authrc(authRcPath)
beforeEach ->
host = auth.host('https://my.host.org')
it 'should find the host', ->
expect(auth.hostExists('https://my.host.org')).to.be.true
expect(host.exists()).to.be.true
describe 'existant host', ->
it 'should remove properly from Authrc class', ->
expect(auth.remove('my.host.org').hostExists('https://my.host.org')).to.be.false
it 'should remove properly from Host class', ->
expect(host.remove().exists()).to.be.false
describe 'passing the Host object', ->
it 'should remove properly from Authrc class', ->
expect(auth.remove(host).hostExists('https://my.host.org')).to.be.false
describe 'update', ->
host = null
beforeEach ->
auth = new Authrc(authRcPath)
beforeEach ->
host = auth.host('https://my.host.org')
it 'should find the file and has some data', ->
expect(auth.exists()).to.be.true
it 'should find the host', ->
expect(host.exists()).to.be.true
describe 'update username and password separetly', ->
it 'should update the username for the given host', ->
expect(host.username('superman')).to.be.equal('superman')
expect(host.auth()).to.deep.equal
username: 'superman'
password: 'p@s$w0rd'
it 'should update the password for the given host', ->
expect(host.password('my_n€w_svp3r_p@s$w0rd')).to.be.equal('my_n€w_svp3r_p@s$w0rd')
expect(host.auth()).to.deep.equal
username: 'richard'
password: 'my_n€w_svp3r_p@s$w0rd'
describe 'update both username and password', ->
it 'should update the auth for the given host using strings', ->
expect(host.auth('superman', 'my_n€w_svp3r_p@s$w0rd')).to.deep.equal
username: 'superman'
password: 'my_n€w_svp3r_p@s$w0rd'
it 'should update the auth for the given host using password object', ->
expect(host.auth('superman', { value: 'my_n€w_svp3r_p@s$w0rd', cipher: 'plain' } ))
.to.deep.equal
username: 'superman'
password: 'my_n€w_svp3r_p@s$w0rd'
describe 'update both username and password', ->
it 'should update the auth for the given host using strings', ->
expect(host.auth('superman', 'my_n€w_svp3r_p@s$w0rd')).to.deep.equal
username: 'superman'
password: 'my_n€w_svp3r_p@s$w0rd'
it 'should update the auth for the given host using password object', ->
expect(host.auth('superman', { value: 'my_n€w_svp3r_p@s$w0rd', cipher: 'plain' } ))
.to.deep.equal
username: 'superman'
password: 'my_n€w_svp3r_p@s$w0rd'
| 112373 | { expect } = require 'chai'
fs = require 'fs'
Authrc = require '../lib/authrc'
describe 'create/read/update/remove config', ->
authRcPath = "#{__dirname}/fixtures/tmp/.authrc"
auth = null
writeJSON = (data) ->
fs.writeFileSync authRcPath, JSON.stringify(data, null, 4)
describe 'playing with hosts data', ->
before ->
writeJSON
'my.host.org':
username: 'richard'
password: '<PASSWORD>'
'my.second.host.org':
username: 'george'
password: '<PASSWORD>'
describe 'read', ->
host = null
before ->
auth = new Authrc(authRcPath)
it 'should find the file and has some data', ->
expect(auth.exists()).to.be.true
describe 'existant host', ->
beforeEach ->
host = auth.host('https://my.second.host.org')
it 'should find the host from Authrc class', ->
expect(auth.hostExists('https://my.second.host.org')).to.be.true
it 'should find the host from Host class', ->
expect(host.exists()).to.be.true
describe 'existant host', ->
beforeEach ->
host = auth.host('https://nonexistant.org')
it 'should not find the host from Authrc class', ->
expect(auth.hostExists('https://nonexistant.org')).to.be.false
it 'should not find the host from Host class', ->
expect(host.exists()).to.be.false
describe 'create', ->
host = null
before ->
auth = new Authrc(authRcPath)
beforeEach ->
host = auth.host('https://nonexistant.org')
it 'should find the file and has some data', ->
expect(auth.exists()).to.be.true
it 'should not find the host', ->
expect(auth.hostExists('https://nonexistant.org')).to.be.false
expect(host.exists()).to.be.false
describe 'create new host', ->
it 'should create a new host with empty auth credentials', ->
auth.add('https://nonexistant.org')
expect(host.auth()).to.be.equal(null)
describe 'with auth object', ->
before ->
auth.add('https://nonexistant.org', { username: 'superman', password: <PASSWORD>'})
it 'should create a new host with credentials object', ->
expect(host.auth()).to.not.be.equal(null)
expect(host.auth()).to.deep.equal({ username: 'superman', password: <PASSWORD>'})
describe 'with full object parameter', ->
before ->
auth.add({ 'https://nonexistant.org': { username: 'superman', password: <PASSWORD>'} })
it 'should create a new host with credentials object', ->
expect(host.auth()).to.not.be.equal(null)
expect(host.auth()).to.deep.equal({ username: 'superman', password: <PASSWORD>'})
describe 'remove', ->
host = null
beforeEach ->
auth = new Authrc(authRcPath)
beforeEach ->
host = auth.host('https://my.host.org')
it 'should find the host', ->
expect(auth.hostExists('https://my.host.org')).to.be.true
expect(host.exists()).to.be.true
describe 'existant host', ->
it 'should remove properly from Authrc class', ->
expect(auth.remove('my.host.org').hostExists('https://my.host.org')).to.be.false
it 'should remove properly from Host class', ->
expect(host.remove().exists()).to.be.false
describe 'passing the Host object', ->
it 'should remove properly from Authrc class', ->
expect(auth.remove(host).hostExists('https://my.host.org')).to.be.false
describe 'update', ->
host = null
beforeEach ->
auth = new Authrc(authRcPath)
beforeEach ->
host = auth.host('https://my.host.org')
it 'should find the file and has some data', ->
expect(auth.exists()).to.be.true
it 'should find the host', ->
expect(host.exists()).to.be.true
describe 'update username and password separetly', ->
it 'should update the username for the given host', ->
expect(host.username('superman')).to.be.equal('superman')
expect(host.auth()).to.deep.equal
username: 'superman'
password: '<PASSWORD>'
it 'should update the password for the given host', ->
expect(host.password('<PASSWORD>€<PASSWORD>_svp<PASSWORD>_<PASSWORD>')).to.be.equal('<PASSWORD>€w_<PASSWORD>_<PASSWORD>')
expect(host.auth()).to.deep.equal
username: 'richard'
password: '<PASSWORD>'
describe 'update both username and password', ->
it 'should update the auth for the given host using strings', ->
expect(host.auth('superman', 'my_n€w_svp3r_p@s$w0rd')).to.deep.equal
username: 'superman'
password: '<PASSWORD>'
it 'should update the auth for the given host using password object', ->
expect(host.auth('superman', { value: 'my_n€w_svp3r_p@s$w0rd', cipher: 'plain' } ))
.to.deep.equal
username: 'superman'
password: '<PASSWORD>'
describe 'update both username and password', ->
it 'should update the auth for the given host using strings', ->
expect(host.auth('superman', 'my_n€w_svp3r_p@s$w0rd')).to.deep.equal
username: 'superman'
password: '<PASSWORD>'
it 'should update the auth for the given host using password object', ->
expect(host.auth('superman', { value: 'my_n€w_svp3r_<PASSWORD>', cipher: 'plain' } ))
.to.deep.equal
username: 'superman'
password: '<PASSWORD>'
| true | { expect } = require 'chai'
fs = require 'fs'
Authrc = require '../lib/authrc'
describe 'create/read/update/remove config', ->
authRcPath = "#{__dirname}/fixtures/tmp/.authrc"
auth = null
writeJSON = (data) ->
fs.writeFileSync authRcPath, JSON.stringify(data, null, 4)
describe 'playing with hosts data', ->
before ->
writeJSON
'my.host.org':
username: 'richard'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
'my.second.host.org':
username: 'george'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
describe 'read', ->
host = null
before ->
auth = new Authrc(authRcPath)
it 'should find the file and has some data', ->
expect(auth.exists()).to.be.true
describe 'existant host', ->
beforeEach ->
host = auth.host('https://my.second.host.org')
it 'should find the host from Authrc class', ->
expect(auth.hostExists('https://my.second.host.org')).to.be.true
it 'should find the host from Host class', ->
expect(host.exists()).to.be.true
describe 'existant host', ->
beforeEach ->
host = auth.host('https://nonexistant.org')
it 'should not find the host from Authrc class', ->
expect(auth.hostExists('https://nonexistant.org')).to.be.false
it 'should not find the host from Host class', ->
expect(host.exists()).to.be.false
describe 'create', ->
host = null
before ->
auth = new Authrc(authRcPath)
beforeEach ->
host = auth.host('https://nonexistant.org')
it 'should find the file and has some data', ->
expect(auth.exists()).to.be.true
it 'should not find the host', ->
expect(auth.hostExists('https://nonexistant.org')).to.be.false
expect(host.exists()).to.be.false
describe 'create new host', ->
it 'should create a new host with empty auth credentials', ->
auth.add('https://nonexistant.org')
expect(host.auth()).to.be.equal(null)
describe 'with auth object', ->
before ->
auth.add('https://nonexistant.org', { username: 'superman', password: PI:PASSWORD:<PASSWORD>END_PI'})
it 'should create a new host with credentials object', ->
expect(host.auth()).to.not.be.equal(null)
expect(host.auth()).to.deep.equal({ username: 'superman', password: PI:PASSWORD:<PASSWORD>END_PI'})
describe 'with full object parameter', ->
before ->
auth.add({ 'https://nonexistant.org': { username: 'superman', password: PI:PASSWORD:<PASSWORD>END_PI'} })
it 'should create a new host with credentials object', ->
expect(host.auth()).to.not.be.equal(null)
expect(host.auth()).to.deep.equal({ username: 'superman', password: PI:PASSWORD:<PASSWORD>END_PI'})
describe 'remove', ->
host = null
beforeEach ->
auth = new Authrc(authRcPath)
beforeEach ->
host = auth.host('https://my.host.org')
it 'should find the host', ->
expect(auth.hostExists('https://my.host.org')).to.be.true
expect(host.exists()).to.be.true
describe 'existant host', ->
it 'should remove properly from Authrc class', ->
expect(auth.remove('my.host.org').hostExists('https://my.host.org')).to.be.false
it 'should remove properly from Host class', ->
expect(host.remove().exists()).to.be.false
describe 'passing the Host object', ->
it 'should remove properly from Authrc class', ->
expect(auth.remove(host).hostExists('https://my.host.org')).to.be.false
describe 'update', ->
host = null
beforeEach ->
auth = new Authrc(authRcPath)
beforeEach ->
host = auth.host('https://my.host.org')
it 'should find the file and has some data', ->
expect(auth.exists()).to.be.true
it 'should find the host', ->
expect(host.exists()).to.be.true
describe 'update username and password separetly', ->
it 'should update the username for the given host', ->
expect(host.username('superman')).to.be.equal('superman')
expect(host.auth()).to.deep.equal
username: 'superman'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
it 'should update the password for the given host', ->
expect(host.password('PI:PASSWORD:<PASSWORD>END_PI€PI:PASSWORD:<PASSWORD>END_PI_svpPI:PASSWORD:<PASSWORD>END_PI_PI:PASSWORD:<PASSWORD>END_PI')).to.be.equal('PI:PASSWORD:<PASSWORD>END_PI€w_PI:PASSWORD:<PASSWORD>END_PI_PI:PASSWORD:<PASSWORD>END_PI')
expect(host.auth()).to.deep.equal
username: 'richard'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
describe 'update both username and password', ->
it 'should update the auth for the given host using strings', ->
expect(host.auth('superman', 'my_n€w_svp3r_p@s$w0rd')).to.deep.equal
username: 'superman'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
it 'should update the auth for the given host using password object', ->
expect(host.auth('superman', { value: 'my_n€w_svp3r_p@s$w0rd', cipher: 'plain' } ))
.to.deep.equal
username: 'superman'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
describe 'update both username and password', ->
it 'should update the auth for the given host using strings', ->
expect(host.auth('superman', 'my_n€w_svp3r_p@s$w0rd')).to.deep.equal
username: 'superman'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
it 'should update the auth for the given host using password object', ->
expect(host.auth('superman', { value: 'my_n€w_svp3r_PI:PASSWORD:<PASSWORD>END_PI', cipher: 'plain' } ))
.to.deep.equal
username: 'superman'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
|
[
{
"context": "butesFor('tags')\n\n store = new @Store(name: \"Goodburger\")\n yummy = store.get('tags').build(name: \"Yummy\"",
"end": 5947,
"score": 0.506186306476593,
"start": 5941,
"tag": "NAME",
"value": "burger"
}
] | tests/batman/storage_adapter/rails_storage_test.coffee | nickjs/batman.js | 3 | helpers = window.restStorageHelpers
QUnit.module "Batman.RailsStorage",
setup: ->
@oldRequest = Batman.Request
@oldExpectedForUrl = helpers.MockRequest.getExpectedForUrl
helpers.MockRequest.getExpectedForUrl = (url) ->
@expects[url.slice(0,-5)] || [] # cut off the .json so the fixtures from the test suite work fine
Batman.Request = helpers.MockRequest
helpers.MockRequest.reset()
class @Store extends Batman.Model
@encode 'id', 'name'
@storeAdapter = new Batman.RailsStorage(@Store)
@Store.persist @storeAdapter
class @Product extends Batman.Model
@encode 'id', 'name', 'cost'
@productAdapter = new Batman.RailsStorage(@Product)
@Product.persist @productAdapter
@adapter = @productAdapter # for restStorageHelpers
teardown: ->
Batman.Request = @oldRequest
helpers.MockRequest.getExpectedForUrl = @oldExpectedForUrl
helpers.testOptionsGeneration('.json')
helpers.run()
asyncTest 'creating in storage: should callback with the record with errors on it if server side validation fails', ->
helpers.MockRequest.expect
url: '/products'
method: 'POST'
, error:
status: 422
response: JSON.stringify
name: ["can't be test", "must be valid"]
product = new @Product(name: "test")
@productAdapter.perform 'create', product, {}, (err, record) =>
ok err instanceof Batman.ErrorsSet
ok record
equal record.get('errors').length, 2
QUnit.start()
asyncTest 'creating in storage: should callback with the record with errors on it if server side validation fails in recent versions of Rails', ->
helpers.MockRequest.expect
url: '/products'
method: 'POST'
, error:
status: 422
response: JSON.stringify
errors:
name: ["can't be test", "must be valid"]
product = new @Product(name: "test")
@productAdapter.perform 'create', product, {}, (err, record) =>
ok err instanceof Batman.ErrorsSet
ok record
equal record.get('errors').length, 2
QUnit.start()
asyncTest 'hasMany encodesNestedAttributesFor uses {key}_attributes and removes _destroy', 4, ->
@Store.hasMany('products', saveInline: true, autoload: false, namespace: @)
@Store.encodesNestedAttributesFor('products')
store = new @Store(name: "Goodburger")
burger = store.get('products').build(name: "The Goodburger")
fries = store.get('products').build(name: "French Fries")
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = env.options.data.store
ok storeJSON.products_attributes, "The _attributes key is added"
ok !storeJSON.products, "The original key is removed"
deepEqual storeJSON.products_attributes[0], {store_id: undefined, name: "The Goodburger"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
fries.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('products').has(fries), "_destroy items are removed"
QUnit.start()
asyncTest 'hasOne encodesNestedAttributesFor uses {key}_attributes and removes _destroy', 4, ->
@Store.hasOne('product', saveInline: true, autoload: false, namespace: @)
@Store.encodesNestedAttributesFor('product')
store = new @Store(name: "Goodburger")
burger = new @Product(name: "The Goodburger")
store.set('product', burger)
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = env.options.data.store
ok storeJSON.product_attributes, "The _attributes key is added"
ok !storeJSON.product, "The original key is removed"
deepEqual storeJSON.product_attributes, {store_id: undefined, name: "The Goodburger"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
burger.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('product.target'), "_destroy items are removed"
QUnit.start()
asyncTest 'encodesNestedAttributesFor works with serializeAsForm is false', 4, ->
@Store.hasMany('products', saveInline: true, autoload: false, namespace: @)
@Store.encodesNestedAttributesFor('products')
@storeAdapter.serializeAsForm = false
store = new @Store(name: "Goodburger")
burger = store.get('products').build(name: "The Goodburger")
fries = store.get('products').build(name: "French Fries")
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = JSON.parse(env.options.data).store
ok storeJSON.products_attributes, "The _attributes key is added"
ok !storeJSON.products, "The original key is removed"
# store_id is undefined, so JSON.stringify omits it
deepEqual storeJSON.products_attributes[0], {name: "The Goodburger"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
fries.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('products').has(fries), "_destroy items are removed"
QUnit.start()
asyncTest 'encodesNestedAttributesFor works with serializeAsForm is false', 4, ->
class @Tag extends Batman.Model
@belongsTo 'taggable', polymorphic: true
@encode 'name'
@Store.hasMany('tags', as: 'taggable', polymorphic: true, saveInline: true, namespace: @)
@Store.encodesNestedAttributesFor('tags')
store = new @Store(name: "Goodburger")
yummy = store.get('tags').build(name: "Yummy")
greasy = store.get('tags').build(name: "Greasy")
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = env.options.data.store
ok storeJSON.tags_attributes, "The _attributes key is added"
ok !storeJSON.tags, "The original key is removed"
deepEqual storeJSON.tags_attributes[0], {name: "Yummy", taggable_id: undefined, taggable_type: "store"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
greasy.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('tags').has(greasy), "_destroy items are removed"
QUnit.start() | 7305 | helpers = window.restStorageHelpers
QUnit.module "Batman.RailsStorage",
setup: ->
@oldRequest = Batman.Request
@oldExpectedForUrl = helpers.MockRequest.getExpectedForUrl
helpers.MockRequest.getExpectedForUrl = (url) ->
@expects[url.slice(0,-5)] || [] # cut off the .json so the fixtures from the test suite work fine
Batman.Request = helpers.MockRequest
helpers.MockRequest.reset()
class @Store extends Batman.Model
@encode 'id', 'name'
@storeAdapter = new Batman.RailsStorage(@Store)
@Store.persist @storeAdapter
class @Product extends Batman.Model
@encode 'id', 'name', 'cost'
@productAdapter = new Batman.RailsStorage(@Product)
@Product.persist @productAdapter
@adapter = @productAdapter # for restStorageHelpers
teardown: ->
Batman.Request = @oldRequest
helpers.MockRequest.getExpectedForUrl = @oldExpectedForUrl
helpers.testOptionsGeneration('.json')
helpers.run()
asyncTest 'creating in storage: should callback with the record with errors on it if server side validation fails', ->
helpers.MockRequest.expect
url: '/products'
method: 'POST'
, error:
status: 422
response: JSON.stringify
name: ["can't be test", "must be valid"]
product = new @Product(name: "test")
@productAdapter.perform 'create', product, {}, (err, record) =>
ok err instanceof Batman.ErrorsSet
ok record
equal record.get('errors').length, 2
QUnit.start()
asyncTest 'creating in storage: should callback with the record with errors on it if server side validation fails in recent versions of Rails', ->
helpers.MockRequest.expect
url: '/products'
method: 'POST'
, error:
status: 422
response: JSON.stringify
errors:
name: ["can't be test", "must be valid"]
product = new @Product(name: "test")
@productAdapter.perform 'create', product, {}, (err, record) =>
ok err instanceof Batman.ErrorsSet
ok record
equal record.get('errors').length, 2
QUnit.start()
asyncTest 'hasMany encodesNestedAttributesFor uses {key}_attributes and removes _destroy', 4, ->
@Store.hasMany('products', saveInline: true, autoload: false, namespace: @)
@Store.encodesNestedAttributesFor('products')
store = new @Store(name: "Goodburger")
burger = store.get('products').build(name: "The Goodburger")
fries = store.get('products').build(name: "French Fries")
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = env.options.data.store
ok storeJSON.products_attributes, "The _attributes key is added"
ok !storeJSON.products, "The original key is removed"
deepEqual storeJSON.products_attributes[0], {store_id: undefined, name: "The Goodburger"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
fries.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('products').has(fries), "_destroy items are removed"
QUnit.start()
asyncTest 'hasOne encodesNestedAttributesFor uses {key}_attributes and removes _destroy', 4, ->
@Store.hasOne('product', saveInline: true, autoload: false, namespace: @)
@Store.encodesNestedAttributesFor('product')
store = new @Store(name: "Goodburger")
burger = new @Product(name: "The Goodburger")
store.set('product', burger)
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = env.options.data.store
ok storeJSON.product_attributes, "The _attributes key is added"
ok !storeJSON.product, "The original key is removed"
deepEqual storeJSON.product_attributes, {store_id: undefined, name: "The Goodburger"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
burger.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('product.target'), "_destroy items are removed"
QUnit.start()
asyncTest 'encodesNestedAttributesFor works with serializeAsForm is false', 4, ->
@Store.hasMany('products', saveInline: true, autoload: false, namespace: @)
@Store.encodesNestedAttributesFor('products')
@storeAdapter.serializeAsForm = false
store = new @Store(name: "Goodburger")
burger = store.get('products').build(name: "The Goodburger")
fries = store.get('products').build(name: "French Fries")
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = JSON.parse(env.options.data).store
ok storeJSON.products_attributes, "The _attributes key is added"
ok !storeJSON.products, "The original key is removed"
# store_id is undefined, so JSON.stringify omits it
deepEqual storeJSON.products_attributes[0], {name: "The Goodburger"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
fries.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('products').has(fries), "_destroy items are removed"
QUnit.start()
asyncTest 'encodesNestedAttributesFor works with serializeAsForm is false', 4, ->
class @Tag extends Batman.Model
@belongsTo 'taggable', polymorphic: true
@encode 'name'
@Store.hasMany('tags', as: 'taggable', polymorphic: true, saveInline: true, namespace: @)
@Store.encodesNestedAttributesFor('tags')
store = new @Store(name: "Good<NAME>")
yummy = store.get('tags').build(name: "Yummy")
greasy = store.get('tags').build(name: "Greasy")
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = env.options.data.store
ok storeJSON.tags_attributes, "The _attributes key is added"
ok !storeJSON.tags, "The original key is removed"
deepEqual storeJSON.tags_attributes[0], {name: "Yummy", taggable_id: undefined, taggable_type: "store"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
greasy.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('tags').has(greasy), "_destroy items are removed"
QUnit.start() | true | helpers = window.restStorageHelpers
QUnit.module "Batman.RailsStorage",
setup: ->
@oldRequest = Batman.Request
@oldExpectedForUrl = helpers.MockRequest.getExpectedForUrl
helpers.MockRequest.getExpectedForUrl = (url) ->
@expects[url.slice(0,-5)] || [] # cut off the .json so the fixtures from the test suite work fine
Batman.Request = helpers.MockRequest
helpers.MockRequest.reset()
class @Store extends Batman.Model
@encode 'id', 'name'
@storeAdapter = new Batman.RailsStorage(@Store)
@Store.persist @storeAdapter
class @Product extends Batman.Model
@encode 'id', 'name', 'cost'
@productAdapter = new Batman.RailsStorage(@Product)
@Product.persist @productAdapter
@adapter = @productAdapter # for restStorageHelpers
teardown: ->
Batman.Request = @oldRequest
helpers.MockRequest.getExpectedForUrl = @oldExpectedForUrl
helpers.testOptionsGeneration('.json')
helpers.run()
asyncTest 'creating in storage: should callback with the record with errors on it if server side validation fails', ->
helpers.MockRequest.expect
url: '/products'
method: 'POST'
, error:
status: 422
response: JSON.stringify
name: ["can't be test", "must be valid"]
product = new @Product(name: "test")
@productAdapter.perform 'create', product, {}, (err, record) =>
ok err instanceof Batman.ErrorsSet
ok record
equal record.get('errors').length, 2
QUnit.start()
asyncTest 'creating in storage: should callback with the record with errors on it if server side validation fails in recent versions of Rails', ->
helpers.MockRequest.expect
url: '/products'
method: 'POST'
, error:
status: 422
response: JSON.stringify
errors:
name: ["can't be test", "must be valid"]
product = new @Product(name: "test")
@productAdapter.perform 'create', product, {}, (err, record) =>
ok err instanceof Batman.ErrorsSet
ok record
equal record.get('errors').length, 2
QUnit.start()
asyncTest 'hasMany encodesNestedAttributesFor uses {key}_attributes and removes _destroy', 4, ->
@Store.hasMany('products', saveInline: true, autoload: false, namespace: @)
@Store.encodesNestedAttributesFor('products')
store = new @Store(name: "Goodburger")
burger = store.get('products').build(name: "The Goodburger")
fries = store.get('products').build(name: "French Fries")
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = env.options.data.store
ok storeJSON.products_attributes, "The _attributes key is added"
ok !storeJSON.products, "The original key is removed"
deepEqual storeJSON.products_attributes[0], {store_id: undefined, name: "The Goodburger"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
fries.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('products').has(fries), "_destroy items are removed"
QUnit.start()
asyncTest 'hasOne encodesNestedAttributesFor uses {key}_attributes and removes _destroy', 4, ->
@Store.hasOne('product', saveInline: true, autoload: false, namespace: @)
@Store.encodesNestedAttributesFor('product')
store = new @Store(name: "Goodburger")
burger = new @Product(name: "The Goodburger")
store.set('product', burger)
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = env.options.data.store
ok storeJSON.product_attributes, "The _attributes key is added"
ok !storeJSON.product, "The original key is removed"
deepEqual storeJSON.product_attributes, {store_id: undefined, name: "The Goodburger"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
burger.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('product.target'), "_destroy items are removed"
QUnit.start()
asyncTest 'encodesNestedAttributesFor works with serializeAsForm is false', 4, ->
@Store.hasMany('products', saveInline: true, autoload: false, namespace: @)
@Store.encodesNestedAttributesFor('products')
@storeAdapter.serializeAsForm = false
store = new @Store(name: "Goodburger")
burger = store.get('products').build(name: "The Goodburger")
fries = store.get('products').build(name: "French Fries")
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = JSON.parse(env.options.data).store
ok storeJSON.products_attributes, "The _attributes key is added"
ok !storeJSON.products, "The original key is removed"
# store_id is undefined, so JSON.stringify omits it
deepEqual storeJSON.products_attributes[0], {name: "The Goodburger"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
fries.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('products').has(fries), "_destroy items are removed"
QUnit.start()
asyncTest 'encodesNestedAttributesFor works with serializeAsForm is false', 4, ->
class @Tag extends Batman.Model
@belongsTo 'taggable', polymorphic: true
@encode 'name'
@Store.hasMany('tags', as: 'taggable', polymorphic: true, saveInline: true, namespace: @)
@Store.encodesNestedAttributesFor('tags')
store = new @Store(name: "GoodPI:NAME:<NAME>END_PI")
yummy = store.get('tags').build(name: "Yummy")
greasy = store.get('tags').build(name: "Greasy")
JSONResponse = store.toJSON()
helpers.MockRequest.expect
url: "/stores"
method: "POST"
, success: JSONResponse
helpers.MockRequest.expect
url: "/stores/1"
method: "PUT"
, success: JSONResponse
@storeAdapter.before 'create', (env, next) =>
storeJSON = env.options.data.store
ok storeJSON.tags_attributes, "The _attributes key is added"
ok !storeJSON.tags, "The original key is removed"
deepEqual storeJSON.tags_attributes[0], {name: "Yummy", taggable_id: undefined, taggable_type: "store"}, "the child is serialized"
next()
store.save (e, r) =>
throw e if e
store.set('id', 1)
greasy.set("_destroy", 1)
store.save =>
throw e if e
ok !store.get('tags').has(greasy), "_destroy items are removed"
QUnit.start() |
[
{
"context": "('password')\n .set( (password)->\n @_password = password\n @salt = @makeSalt()\n @hashed_password = @e",
"end": 502,
"score": 0.9964790344238281,
"start": 494,
"tag": "PASSWORD",
"value": "password"
}
] | src/models/user.coffee | yi/coffee-nodejs-passport-boilerplate | 1 |
# Module dependencies.
mongoose = require('mongoose')
Schema = mongoose.Schema
crypto = require('crypto')
_ = require('underscore')
authTypes = ['github', 'twitter', 'facebook', 'google']
# User Schema
UserSchema = new Schema({
name: String,
email: String,
username: String,
provider: String,
hashed_password: String,
salt: String,
facebook: {},
twitter: {},
github: {},
google: {}
})
# Virtuals
UserSchema
.virtual('password')
.set( (password)->
@_password = password
@salt = @makeSalt()
@hashed_password = @encryptPassword(password)
)
.get( ()-> return this._password )
# Validations
validatePresenceOf = (value)->
return value && value.length
# the below 4 validations only apply if you are signing up traditionally
UserSchema.path('name').validate (name)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return name.length
, 'Name cannot be blank'
UserSchema.path('email').validate (email)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return email.length
, 'Email cannot be blank'
UserSchema.path('username').validate (username)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return username.length
, 'Username cannot be blank'
UserSchema.path('hashed_password').validate (hashed_password)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return hashed_password.length
, 'Password cannot be blank'
# Pre-save hook
UserSchema.pre 'save', (next)->
return next() if (!@isNew)
if not validatePresenceOf(@password) and authTypes.indexOf(this.provider) is -1
next(new Error('Invalid password'))
else
next()
# Methods
UserSchema.methods =
# Authenticate - check if the passwords are the same
#
# @param {String} plainText
# @return {Boolean}
# @api public
authenticate: (plainText)-> return @encryptPassword(plainText) is @hashed_password
# Make salt
#
# @return {String}
# @api public
makeSalt: ()-> return Math.round((new Date().valueOf() * Math.random())) + ''
# Encrypt password
#
# @param {String} password
# @return {String}
# @api public
encryptPassword: (password)->
return '' unless password
return crypto.createHmac('sha1', @salt).update(password).digest('hex')
mongoose.model('User', UserSchema)
| 209805 |
# Module dependencies.
mongoose = require('mongoose')
Schema = mongoose.Schema
crypto = require('crypto')
_ = require('underscore')
authTypes = ['github', 'twitter', 'facebook', 'google']
# User Schema
UserSchema = new Schema({
name: String,
email: String,
username: String,
provider: String,
hashed_password: String,
salt: String,
facebook: {},
twitter: {},
github: {},
google: {}
})
# Virtuals
UserSchema
.virtual('password')
.set( (password)->
@_password = <PASSWORD>
@salt = @makeSalt()
@hashed_password = @encryptPassword(password)
)
.get( ()-> return this._password )
# Validations
validatePresenceOf = (value)->
return value && value.length
# the below 4 validations only apply if you are signing up traditionally
UserSchema.path('name').validate (name)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return name.length
, 'Name cannot be blank'
UserSchema.path('email').validate (email)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return email.length
, 'Email cannot be blank'
UserSchema.path('username').validate (username)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return username.length
, 'Username cannot be blank'
UserSchema.path('hashed_password').validate (hashed_password)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return hashed_password.length
, 'Password cannot be blank'
# Pre-save hook
UserSchema.pre 'save', (next)->
return next() if (!@isNew)
if not validatePresenceOf(@password) and authTypes.indexOf(this.provider) is -1
next(new Error('Invalid password'))
else
next()
# Methods
UserSchema.methods =
# Authenticate - check if the passwords are the same
#
# @param {String} plainText
# @return {Boolean}
# @api public
authenticate: (plainText)-> return @encryptPassword(plainText) is @hashed_password
# Make salt
#
# @return {String}
# @api public
makeSalt: ()-> return Math.round((new Date().valueOf() * Math.random())) + ''
# Encrypt password
#
# @param {String} password
# @return {String}
# @api public
encryptPassword: (password)->
return '' unless password
return crypto.createHmac('sha1', @salt).update(password).digest('hex')
mongoose.model('User', UserSchema)
| true |
# Module dependencies.
mongoose = require('mongoose')
Schema = mongoose.Schema
crypto = require('crypto')
_ = require('underscore')
authTypes = ['github', 'twitter', 'facebook', 'google']
# User Schema
UserSchema = new Schema({
name: String,
email: String,
username: String,
provider: String,
hashed_password: String,
salt: String,
facebook: {},
twitter: {},
github: {},
google: {}
})
# Virtuals
UserSchema
.virtual('password')
.set( (password)->
@_password = PI:PASSWORD:<PASSWORD>END_PI
@salt = @makeSalt()
@hashed_password = @encryptPassword(password)
)
.get( ()-> return this._password )
# Validations
validatePresenceOf = (value)->
return value && value.length
# the below 4 validations only apply if you are signing up traditionally
UserSchema.path('name').validate (name)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return name.length
, 'Name cannot be blank'
UserSchema.path('email').validate (email)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return email.length
, 'Email cannot be blank'
UserSchema.path('username').validate (username)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return username.length
, 'Username cannot be blank'
UserSchema.path('hashed_password').validate (hashed_password)->
# if you are authenticating by any of the oauth strategies, don't validate
return true if authTypes.indexOf(this.provider) isnt -1
return hashed_password.length
, 'Password cannot be blank'
# Pre-save hook
UserSchema.pre 'save', (next)->
return next() if (!@isNew)
if not validatePresenceOf(@password) and authTypes.indexOf(this.provider) is -1
next(new Error('Invalid password'))
else
next()
# Methods
UserSchema.methods =
# Authenticate - check if the passwords are the same
#
# @param {String} plainText
# @return {Boolean}
# @api public
authenticate: (plainText)-> return @encryptPassword(plainText) is @hashed_password
# Make salt
#
# @return {String}
# @api public
makeSalt: ()-> return Math.round((new Date().valueOf() * Math.random())) + ''
# Encrypt password
#
# @param {String} password
# @return {String}
# @api public
encryptPassword: (password)->
return '' unless password
return crypto.createHmac('sha1', @salt).update(password).digest('hex')
mongoose.model('User', UserSchema)
|
[
{
"context": "t Password')\n\t\t\t\n\t\t\ts3.auth key, secret\n\t\t\tcreds = username + ':' + key + ':' + secret\n\t\t\t\n\t\t\tsessionStorage.",
"end": 556,
"score": 0.8904454708099365,
"start": 548,
"tag": "USERNAME",
"value": "username"
},
{
"context": "t = s3.bucket(bucketName)\n\t\t\n\t\tusernameSha = sha1(username)\n\t\tpasswordSha = sha1(password)\n\t\t\n\t\tcypher = aes",
"end": 1203,
"score": 0.6678573489189148,
"start": 1195,
"tag": "USERNAME",
"value": "username"
},
{
"context": "\n\t\t\n\t\tusernameSha = sha1(username)\n\t\tpasswordSha = sha1(password)\n\t\t\n\t\tcypher = aes.encrypt([ key, secre",
"end": 1224,
"score": 0.9198341965675354,
"start": 1221,
"tag": "PASSWORD",
"value": "sha"
},
{
"context": "usernameSha = sha1(username)\n\t\tpasswordSha = sha1(password)\n\t\t\n\t\tcypher = aes.encrypt([ key, secret ].join('",
"end": 1234,
"score": 0.8033685684204102,
"start": 1226,
"tag": "PASSWORD",
"value": "password"
}
] | src/app/auth.coffee | roobin/StaticSite | 1 |
define ['lib/crypto', 'lib/promises', 'lib/s3'], (crypto, promises, s3) ->
{sha1, aes} = crypto
path = 'auth/'
bucketName = location.pathname.split('/')[1]
login: (username, password, remember) ->
deferred = new promises.Deferred()
usernameSha = sha1(username)
passwordSha = sha1(password)
$.get(path + usernameSha).then (cypher) ->
[key, secret] = aes.decrypt(cypher, passwordSha).split(':')
unless key and secret
return deferred.fail new Error('Incorrect Password')
s3.auth key, secret
creds = username + ':' + key + ':' + secret
sessionStorage.setItem 'creds', creds
localStorage.setItem 'creds', creds if remember
deferred.fulfill()
, ->
deferred.fail new Error('Incorrect Username')
deferred.promise
authorize: ->
creds = sessionStorage.getItem 'creds'
unless creds
creds = localStorage.getItem 'creds'
sessionStorage.setItem 'creds', creds if creds
return false unless creds
[username, key, secret] = creds.split(':')
s3.auth key, secret
username
register: (key, secret, username, password) ->
s3.auth key, secret
bucket = s3.bucket(bucketName)
usernameSha = sha1(username)
passwordSha = sha1(password)
cypher = aes.encrypt([ key, secret ].join(':'), passwordSha)
bucket.put 'admin/auth/' + usernameSha, cypher, acl: 'public-read'
| 144608 |
define ['lib/crypto', 'lib/promises', 'lib/s3'], (crypto, promises, s3) ->
{sha1, aes} = crypto
path = 'auth/'
bucketName = location.pathname.split('/')[1]
login: (username, password, remember) ->
deferred = new promises.Deferred()
usernameSha = sha1(username)
passwordSha = sha1(password)
$.get(path + usernameSha).then (cypher) ->
[key, secret] = aes.decrypt(cypher, passwordSha).split(':')
unless key and secret
return deferred.fail new Error('Incorrect Password')
s3.auth key, secret
creds = username + ':' + key + ':' + secret
sessionStorage.setItem 'creds', creds
localStorage.setItem 'creds', creds if remember
deferred.fulfill()
, ->
deferred.fail new Error('Incorrect Username')
deferred.promise
authorize: ->
creds = sessionStorage.getItem 'creds'
unless creds
creds = localStorage.getItem 'creds'
sessionStorage.setItem 'creds', creds if creds
return false unless creds
[username, key, secret] = creds.split(':')
s3.auth key, secret
username
register: (key, secret, username, password) ->
s3.auth key, secret
bucket = s3.bucket(bucketName)
usernameSha = sha1(username)
passwordSha = <PASSWORD>1(<PASSWORD>)
cypher = aes.encrypt([ key, secret ].join(':'), passwordSha)
bucket.put 'admin/auth/' + usernameSha, cypher, acl: 'public-read'
| true |
define ['lib/crypto', 'lib/promises', 'lib/s3'], (crypto, promises, s3) ->
{sha1, aes} = crypto
path = 'auth/'
bucketName = location.pathname.split('/')[1]
login: (username, password, remember) ->
deferred = new promises.Deferred()
usernameSha = sha1(username)
passwordSha = sha1(password)
$.get(path + usernameSha).then (cypher) ->
[key, secret] = aes.decrypt(cypher, passwordSha).split(':')
unless key and secret
return deferred.fail new Error('Incorrect Password')
s3.auth key, secret
creds = username + ':' + key + ':' + secret
sessionStorage.setItem 'creds', creds
localStorage.setItem 'creds', creds if remember
deferred.fulfill()
, ->
deferred.fail new Error('Incorrect Username')
deferred.promise
authorize: ->
creds = sessionStorage.getItem 'creds'
unless creds
creds = localStorage.getItem 'creds'
sessionStorage.setItem 'creds', creds if creds
return false unless creds
[username, key, secret] = creds.split(':')
s3.auth key, secret
username
register: (key, secret, username, password) ->
s3.auth key, secret
bucket = s3.bucket(bucketName)
usernameSha = sha1(username)
passwordSha = PI:PASSWORD:<PASSWORD>END_PI1(PI:PASSWORD:<PASSWORD>END_PI)
cypher = aes.encrypt([ key, secret ].join(':'), passwordSha)
bucket.put 'admin/auth/' + usernameSha, cypher, acl: 'public-read'
|
[
{
"context": "mberName\", ->\n\n beforeEach ->\n @last_name = \"Smith\"\n @input_name = \"Ben #{@last_name}\"\n @obj ",
"end": 96,
"score": 0.9997866153717041,
"start": 91,
"tag": "NAME",
"value": "Smith"
},
{
"context": "h ->\n @last_name = \"Smith\"\n @input_name = \"Ben #{@last_name}\"\n @obj = new MemberName(@",
"end": 120,
"score": 0.999680757522583,
"start": 117,
"tag": "NAME",
"value": "Ben"
},
{
"context": ">\n @last_name = \"Smith\"\n @input_name = \"Ben #{@last_name}\"\n @obj = new MemberName(@input_name)\n\n",
"end": 133,
"score": 0.7344083786010742,
"start": 121,
"tag": "NAME",
"value": "#{@last_name"
},
{
"context": "e\", ->\n beforeEach ->\n @local_name = \"Dep. Joe Bob\"\n @obj.full_name = @local_name\n\n beforeEa",
"end": 751,
"score": 0.9995865821838379,
"start": 744,
"tag": "NAME",
"value": "Joe Bob"
},
{
"context": "ocal_name\n\n beforeEach ->\n @local_last = \"Bob\"\n @local_name = \"Dep. Joe #{@local_last}\"\n ",
"end": 831,
"score": 0.9990124702453613,
"start": 828,
"tag": "NAME",
"value": "Bob"
},
{
"context": " @local_last = \"Bob\"\n @local_name = \"Dep. Joe #{@local_last}\"\n @obj.full_name = @local_nam",
"end": 862,
"score": 0.9971451759338379,
"start": 859,
"tag": "NAME",
"value": "Joe"
},
{
"context": " @local_last = \"Bob\"\n @local_name = \"Dep. Joe #{@local_last}\"\n @obj.full_name = @local_name\n\n ",
"end": 862,
"score": 0.9100882411003113,
"start": 862,
"tag": "NAME",
"value": ""
},
{
"context": "LinkName\", ->\n\n beforeEach ->\n @input_name = \"Ben Smith\"\n @test_link = \"<a href='/x/y/z'>#{@input_nam",
"end": 1176,
"score": 0.9996505975723267,
"start": 1167,
"tag": "NAME",
"value": "Ben Smith"
},
{
"context": "he link\", ->\n local_link = \"<a href='/a/b/c'>Joe Bob</a>\"\n @obj.link = local_link\n (expect @",
"end": 1538,
"score": 0.9936030507087708,
"start": 1531,
"tag": "NAME",
"value": "Joe Bob"
},
{
"context": "cal_link\n (expect @obj.full_name()).toEqual \"Joe Bob\"\n (expect @obj.last_name()).toEqual \"Bob\"\n\n ",
"end": 1665,
"score": 0.9997085928916931,
"start": 1658,
"tag": "NAME",
"value": "Joe Bob"
},
{
"context": "Joe Bob\"\n (expect @obj.last_name()).toEqual \"Bob\"\n\n describe \"#full_name\", ->\n\n it \"returns th",
"end": 1711,
"score": 0.9994477033615112,
"start": 1708,
"tag": "NAME",
"value": "Bob"
},
{
"context": "ame\", ->\n (expect @obj.last_name()).toEqual(\"Smith\")\n\n describe \"when using periods in the name\", -",
"end": 1941,
"score": 0.9995459318161011,
"start": 1936,
"tag": "NAME",
"value": "Smith"
},
{
"context": " name\", ->\n beforeEach ->\n @local_last = \"Bob\"\n @local_name = \"Dep. Joe #{@local_last}\"\n ",
"end": 2035,
"score": 0.9970448613166809,
"start": 2032,
"tag": "NAME",
"value": "Bob"
},
{
"context": "->\n @local_last = \"Bob\"\n @local_name = \"Dep. Joe #{@local_last}\"\n @local_link = \"<a href='/a/",
"end": 2066,
"score": 0.9948548674583435,
"start": 2058,
"tag": "NAME",
"value": "Dep. Joe"
},
{
"context": " @local_last = \"Bob\"\n @local_name = \"Dep. Joe #{@local_last}\"\n @local_link = \"<a href='/a/b/c'",
"end": 2066,
"score": 0.8102450370788574,
"start": 2066,
"tag": "NAME",
"value": ""
}
] | spec/javascripts/mobile1/member_spec.js.coffee | andyl/BAMRU-Private | 1 | #= require tablesorter_util
describe "MemberName", ->
beforeEach ->
@last_name = "Smith"
@input_name = "Ben #{@last_name}"
@obj = new MemberName(@input_name)
describe "basic object generation", ->
it "generates an object", ->
expect(@obj).toBeDefined()
it "returns the input name", ->
(expect @obj.full_name).toEqual(@input_name)
it "updates the input name", ->
local_name = "New Name"
@obj.full_name = local_name
(expect @obj.full_name).toEqual(local_name)
describe "#last_name", ->
it "returns the last name", ->
(expect @obj.last_name()).toEqual(@last_name)
describe "when using periods in the name", ->
beforeEach ->
@local_name = "Dep. Joe Bob"
@obj.full_name = @local_name
beforeEach ->
@local_last = "Bob"
@local_name = "Dep. Joe #{@local_last}"
@obj.full_name = @local_name
it "returns the correct full_name", ->
(expect @obj.full_name).toEqual(@local_name)
it "returns the correct last_name", ->
(expect @obj.last_name()).toEqual(@local_last)
describe "LinkName", ->
beforeEach ->
@input_name = "Ben Smith"
@test_link = "<a href='/x/y/z'>#{@input_name}</a>"
@obj = new LinkName(@test_link)
describe "basic object generation", ->
it "generates an object", ->
(expect @obj).toBeDefined()
it "returns the link", ->
(expect @obj.link).toEqual(@test_link)
it "updates the link", ->
local_link = "<a href='/a/b/c'>Joe Bob</a>"
@obj.link = local_link
(expect @obj.link).toEqual local_link
(expect @obj.full_name()).toEqual "Joe Bob"
(expect @obj.last_name()).toEqual "Bob"
describe "#full_name", ->
it "returns the full name", ->
(expect @obj.full_name()).toEqual @input_name
describe "#last_name", ->
it "returns the last name", ->
(expect @obj.last_name()).toEqual("Smith")
describe "when using periods in the name", ->
beforeEach ->
@local_last = "Bob"
@local_name = "Dep. Joe #{@local_last}"
@local_link = "<a href='/a/b/c'>#{@local_name}</a>"
@obj.link = @local_link
it "works with the link parameter", ->
(expect @obj.link).toEqual(@local_link)
it "returns the correct full_name", ->
(expect @obj.full_name()).toEqual(@local_name)
it "returns the correct last_name", ->
(expect @obj.last_name()).toEqual(@local_last)
describe "RoleScore", ->
beforeEach ->
@test_string = "Bd T OL"
@obj = new RoleScore(@test_string)
describe "basic object generation", ->
it "generates an object", ->
(expect @obj).toBeDefined()
describe ".input", ->
it "has an input string", ->
(expect @obj.input).toEqual(@test_string)
it "allows the input string to be reset", ->
local_string = "New String"
@obj.input = local_string
(expect @obj.input).toEqual local_string
describe "#to_lower", ->
it "converts the input string to a lower-case string", ->
(expect @obj.to_lower()).toEqual @test_string.toLowerCase()
describe "#input_array", ->
it "has the right number of values", ->
(expect @obj.input_array().length).toEqual 3
it "returns lower-case strings for all values", ->
local_string = @obj.input_array()[0]
(expect local_string).toMatch(/^[a-z]+$/)
it "returns a correct value for a regex sample string match", ->
(expect "Abc").toNotMatch(/^[a-z]+$/)
describe "#score_one", ->
describe "when @input has a single input value", ->
it "scores S", ->
@obj.input = "S"
(expect @obj.score_one()).toEqual(-10)
it "scores A", ->
@obj.input = "A"
(expect @obj.score_one()).toEqual(-5)
describe "when using a single input value as a parameter", ->
it "scores A", -> (expect @obj.score_one("a")).toEqual(-5)
it "scores S", -> (expect @obj.score_one("s")).toEqual(-10)
it "scores R", -> (expect @obj.score_one("r")).toEqual(-25)
it "scores T", -> (expect @obj.score_one("t")).toEqual(-50)
it "scores FM", -> (expect @obj.score_one("fm")).toEqual(-100)
it "scores TM", -> (expect @obj.score_one("tm")).toEqual(-250)
it "scores OL", -> (expect @obj.score_one("ol")).toEqual(-500)
it "scores Bd", -> (expect @obj.score_one("bd")).toEqual(-1000)
it "scored unknown", -> (expect @obj.score_one("un")).toEqual(0)
describe "#score_array", ->
it "returns a valid array", ->
@obj.input = "TM OL"
(expect @obj.score_array()).toEqual([-250, -500])
describe "#score", ->
it "returns a valid score", ->
@obj.input = "TM OL"
(expect @obj.score()).toEqual(-750)
| 44175 | #= require tablesorter_util
describe "MemberName", ->
beforeEach ->
@last_name = "<NAME>"
@input_name = "<NAME> <NAME>}"
@obj = new MemberName(@input_name)
describe "basic object generation", ->
it "generates an object", ->
expect(@obj).toBeDefined()
it "returns the input name", ->
(expect @obj.full_name).toEqual(@input_name)
it "updates the input name", ->
local_name = "New Name"
@obj.full_name = local_name
(expect @obj.full_name).toEqual(local_name)
describe "#last_name", ->
it "returns the last name", ->
(expect @obj.last_name()).toEqual(@last_name)
describe "when using periods in the name", ->
beforeEach ->
@local_name = "Dep. <NAME>"
@obj.full_name = @local_name
beforeEach ->
@local_last = "<NAME>"
@local_name = "Dep. <NAME> <NAME> #{@local_last}"
@obj.full_name = @local_name
it "returns the correct full_name", ->
(expect @obj.full_name).toEqual(@local_name)
it "returns the correct last_name", ->
(expect @obj.last_name()).toEqual(@local_last)
describe "LinkName", ->
beforeEach ->
@input_name = "<NAME>"
@test_link = "<a href='/x/y/z'>#{@input_name}</a>"
@obj = new LinkName(@test_link)
describe "basic object generation", ->
it "generates an object", ->
(expect @obj).toBeDefined()
it "returns the link", ->
(expect @obj.link).toEqual(@test_link)
it "updates the link", ->
local_link = "<a href='/a/b/c'><NAME></a>"
@obj.link = local_link
(expect @obj.link).toEqual local_link
(expect @obj.full_name()).toEqual "<NAME>"
(expect @obj.last_name()).toEqual "<NAME>"
describe "#full_name", ->
it "returns the full name", ->
(expect @obj.full_name()).toEqual @input_name
describe "#last_name", ->
it "returns the last name", ->
(expect @obj.last_name()).toEqual("<NAME>")
describe "when using periods in the name", ->
beforeEach ->
@local_last = "<NAME>"
@local_name = "<NAME> <NAME> #{@local_last}"
@local_link = "<a href='/a/b/c'>#{@local_name}</a>"
@obj.link = @local_link
it "works with the link parameter", ->
(expect @obj.link).toEqual(@local_link)
it "returns the correct full_name", ->
(expect @obj.full_name()).toEqual(@local_name)
it "returns the correct last_name", ->
(expect @obj.last_name()).toEqual(@local_last)
describe "RoleScore", ->
beforeEach ->
@test_string = "Bd T OL"
@obj = new RoleScore(@test_string)
describe "basic object generation", ->
it "generates an object", ->
(expect @obj).toBeDefined()
describe ".input", ->
it "has an input string", ->
(expect @obj.input).toEqual(@test_string)
it "allows the input string to be reset", ->
local_string = "New String"
@obj.input = local_string
(expect @obj.input).toEqual local_string
describe "#to_lower", ->
it "converts the input string to a lower-case string", ->
(expect @obj.to_lower()).toEqual @test_string.toLowerCase()
describe "#input_array", ->
it "has the right number of values", ->
(expect @obj.input_array().length).toEqual 3
it "returns lower-case strings for all values", ->
local_string = @obj.input_array()[0]
(expect local_string).toMatch(/^[a-z]+$/)
it "returns a correct value for a regex sample string match", ->
(expect "Abc").toNotMatch(/^[a-z]+$/)
describe "#score_one", ->
describe "when @input has a single input value", ->
it "scores S", ->
@obj.input = "S"
(expect @obj.score_one()).toEqual(-10)
it "scores A", ->
@obj.input = "A"
(expect @obj.score_one()).toEqual(-5)
describe "when using a single input value as a parameter", ->
it "scores A", -> (expect @obj.score_one("a")).toEqual(-5)
it "scores S", -> (expect @obj.score_one("s")).toEqual(-10)
it "scores R", -> (expect @obj.score_one("r")).toEqual(-25)
it "scores T", -> (expect @obj.score_one("t")).toEqual(-50)
it "scores FM", -> (expect @obj.score_one("fm")).toEqual(-100)
it "scores TM", -> (expect @obj.score_one("tm")).toEqual(-250)
it "scores OL", -> (expect @obj.score_one("ol")).toEqual(-500)
it "scores Bd", -> (expect @obj.score_one("bd")).toEqual(-1000)
it "scored unknown", -> (expect @obj.score_one("un")).toEqual(0)
describe "#score_array", ->
it "returns a valid array", ->
@obj.input = "TM OL"
(expect @obj.score_array()).toEqual([-250, -500])
describe "#score", ->
it "returns a valid score", ->
@obj.input = "TM OL"
(expect @obj.score()).toEqual(-750)
| true | #= require tablesorter_util
describe "MemberName", ->
beforeEach ->
@last_name = "PI:NAME:<NAME>END_PI"
@input_name = "PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI}"
@obj = new MemberName(@input_name)
describe "basic object generation", ->
it "generates an object", ->
expect(@obj).toBeDefined()
it "returns the input name", ->
(expect @obj.full_name).toEqual(@input_name)
it "updates the input name", ->
local_name = "New Name"
@obj.full_name = local_name
(expect @obj.full_name).toEqual(local_name)
describe "#last_name", ->
it "returns the last name", ->
(expect @obj.last_name()).toEqual(@last_name)
describe "when using periods in the name", ->
beforeEach ->
@local_name = "Dep. PI:NAME:<NAME>END_PI"
@obj.full_name = @local_name
beforeEach ->
@local_last = "PI:NAME:<NAME>END_PI"
@local_name = "Dep. PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI #{@local_last}"
@obj.full_name = @local_name
it "returns the correct full_name", ->
(expect @obj.full_name).toEqual(@local_name)
it "returns the correct last_name", ->
(expect @obj.last_name()).toEqual(@local_last)
describe "LinkName", ->
beforeEach ->
@input_name = "PI:NAME:<NAME>END_PI"
@test_link = "<a href='/x/y/z'>#{@input_name}</a>"
@obj = new LinkName(@test_link)
describe "basic object generation", ->
it "generates an object", ->
(expect @obj).toBeDefined()
it "returns the link", ->
(expect @obj.link).toEqual(@test_link)
it "updates the link", ->
local_link = "<a href='/a/b/c'>PI:NAME:<NAME>END_PI</a>"
@obj.link = local_link
(expect @obj.link).toEqual local_link
(expect @obj.full_name()).toEqual "PI:NAME:<NAME>END_PI"
(expect @obj.last_name()).toEqual "PI:NAME:<NAME>END_PI"
describe "#full_name", ->
it "returns the full name", ->
(expect @obj.full_name()).toEqual @input_name
describe "#last_name", ->
it "returns the last name", ->
(expect @obj.last_name()).toEqual("PI:NAME:<NAME>END_PI")
describe "when using periods in the name", ->
beforeEach ->
@local_last = "PI:NAME:<NAME>END_PI"
@local_name = "PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI #{@local_last}"
@local_link = "<a href='/a/b/c'>#{@local_name}</a>"
@obj.link = @local_link
it "works with the link parameter", ->
(expect @obj.link).toEqual(@local_link)
it "returns the correct full_name", ->
(expect @obj.full_name()).toEqual(@local_name)
it "returns the correct last_name", ->
(expect @obj.last_name()).toEqual(@local_last)
describe "RoleScore", ->
beforeEach ->
@test_string = "Bd T OL"
@obj = new RoleScore(@test_string)
describe "basic object generation", ->
it "generates an object", ->
(expect @obj).toBeDefined()
describe ".input", ->
it "has an input string", ->
(expect @obj.input).toEqual(@test_string)
it "allows the input string to be reset", ->
local_string = "New String"
@obj.input = local_string
(expect @obj.input).toEqual local_string
describe "#to_lower", ->
it "converts the input string to a lower-case string", ->
(expect @obj.to_lower()).toEqual @test_string.toLowerCase()
describe "#input_array", ->
it "has the right number of values", ->
(expect @obj.input_array().length).toEqual 3
it "returns lower-case strings for all values", ->
local_string = @obj.input_array()[0]
(expect local_string).toMatch(/^[a-z]+$/)
it "returns a correct value for a regex sample string match", ->
(expect "Abc").toNotMatch(/^[a-z]+$/)
describe "#score_one", ->
describe "when @input has a single input value", ->
it "scores S", ->
@obj.input = "S"
(expect @obj.score_one()).toEqual(-10)
it "scores A", ->
@obj.input = "A"
(expect @obj.score_one()).toEqual(-5)
describe "when using a single input value as a parameter", ->
it "scores A", -> (expect @obj.score_one("a")).toEqual(-5)
it "scores S", -> (expect @obj.score_one("s")).toEqual(-10)
it "scores R", -> (expect @obj.score_one("r")).toEqual(-25)
it "scores T", -> (expect @obj.score_one("t")).toEqual(-50)
it "scores FM", -> (expect @obj.score_one("fm")).toEqual(-100)
it "scores TM", -> (expect @obj.score_one("tm")).toEqual(-250)
it "scores OL", -> (expect @obj.score_one("ol")).toEqual(-500)
it "scores Bd", -> (expect @obj.score_one("bd")).toEqual(-1000)
it "scored unknown", -> (expect @obj.score_one("un")).toEqual(0)
describe "#score_array", ->
it "returns a valid array", ->
@obj.input = "TM OL"
(expect @obj.score_array()).toEqual([-250, -500])
describe "#score", ->
it "returns a valid score", ->
@obj.input = "TM OL"
(expect @obj.score()).toEqual(-750)
|
[
{
"context": "eate url with key', ->\n\t\t\tGoogleMapsLoader.KEY = 'abcdefghijkl'\n\t\t\texpect(GoogleMapsLoader.createUrl()).to.be.eq",
"end": 1845,
"score": 0.996525764465332,
"start": 1833,
"tag": "KEY",
"value": "abcdefghijkl"
},
{
"context": "teUrl()).to.be.equal(baseUrl + '?sensor=false&key=abcdefghijkl&callback=' + cb)\n\n\t\tit 'should create url with on",
"end": 1940,
"score": 0.9923206567764282,
"start": 1928,
"tag": "KEY",
"value": "abcdefghijkl"
}
] | node_modules/google-maps/test/src/GoogleMaps.coffee | vladimir050486/eventi | 0 | baseUrl = GoogleMapsLoader.URL
cb = GoogleMapsLoader.WINDOW_CALLBACK_NAME
describe 'GoogleMaps', ->
afterEach( (done) ->
GoogleMapsLoader.release( ->
done()
)
)
describe '#load()', ->
it 'should throw an error if promise style is used', ->
expect( -> GoogleMapsLoader.load().then()).to.throw(Error, 'Using promises is not supported anymore. Please take a look in new documentation and use callback instead.')
it 'should load google api object', (done) ->
GoogleMapsLoader.load( (google) ->
expect(google).to.be.a('object')
expect(google).to.have.keys(['maps'])
done()
)
it 'should load google api only for first time and then use stored object', (done) ->
count = 0
GoogleMapsLoader.onLoad( -> count++ )
GoogleMapsLoader.load()
GoogleMapsLoader.load()
GoogleMapsLoader.load()
GoogleMapsLoader.load( ->
expect(count).to.be.equal(1)
done()
)
describe '#release()', ->
it 'should restore google maps package to original state and remove google api object completely and load it again', (done) ->
GoogleMapsLoader.load( ->
GoogleMapsLoader.release( ->
expect(GoogleMapsLoader.google).to.be.null
expect(window.google).to.be.undefined
GoogleMapsLoader.load( (google) ->
expect(google).to.be.a('object')
expect(google).to.have.keys(['maps'])
done()
)
)
)
describe '#createUrl()', ->
it 'should create url with sensor support', ->
GoogleMapsLoader.SENSOR = true
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=true&callback=' + cb)
it 'should create url without sensor support', ->
GoogleMapsLoader.SENSOR = false
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&callback=' + cb)
it 'should create url with key', ->
GoogleMapsLoader.KEY = 'abcdefghijkl'
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&key=abcdefghijkl&callback=' + cb)
it 'should create url with one library', ->
GoogleMapsLoader.LIBRARIES = ['hello']
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&libraries=hello&callback=' + cb)
it 'should create url with more libraries', ->
GoogleMapsLoader.LIBRARIES = ['hello', 'day']
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&libraries=hello,day&callback=' + cb)
it 'should create url with client and version', ->
GoogleMapsLoader.CLIENT = 'buf'
GoogleMapsLoader.VERSION = '999'
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&client=buf&v=999&callback=' + cb)
| 83715 | baseUrl = GoogleMapsLoader.URL
cb = GoogleMapsLoader.WINDOW_CALLBACK_NAME
describe 'GoogleMaps', ->
afterEach( (done) ->
GoogleMapsLoader.release( ->
done()
)
)
describe '#load()', ->
it 'should throw an error if promise style is used', ->
expect( -> GoogleMapsLoader.load().then()).to.throw(Error, 'Using promises is not supported anymore. Please take a look in new documentation and use callback instead.')
it 'should load google api object', (done) ->
GoogleMapsLoader.load( (google) ->
expect(google).to.be.a('object')
expect(google).to.have.keys(['maps'])
done()
)
it 'should load google api only for first time and then use stored object', (done) ->
count = 0
GoogleMapsLoader.onLoad( -> count++ )
GoogleMapsLoader.load()
GoogleMapsLoader.load()
GoogleMapsLoader.load()
GoogleMapsLoader.load( ->
expect(count).to.be.equal(1)
done()
)
describe '#release()', ->
it 'should restore google maps package to original state and remove google api object completely and load it again', (done) ->
GoogleMapsLoader.load( ->
GoogleMapsLoader.release( ->
expect(GoogleMapsLoader.google).to.be.null
expect(window.google).to.be.undefined
GoogleMapsLoader.load( (google) ->
expect(google).to.be.a('object')
expect(google).to.have.keys(['maps'])
done()
)
)
)
describe '#createUrl()', ->
it 'should create url with sensor support', ->
GoogleMapsLoader.SENSOR = true
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=true&callback=' + cb)
it 'should create url without sensor support', ->
GoogleMapsLoader.SENSOR = false
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&callback=' + cb)
it 'should create url with key', ->
GoogleMapsLoader.KEY = '<KEY>'
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&key=<KEY>&callback=' + cb)
it 'should create url with one library', ->
GoogleMapsLoader.LIBRARIES = ['hello']
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&libraries=hello&callback=' + cb)
it 'should create url with more libraries', ->
GoogleMapsLoader.LIBRARIES = ['hello', 'day']
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&libraries=hello,day&callback=' + cb)
it 'should create url with client and version', ->
GoogleMapsLoader.CLIENT = 'buf'
GoogleMapsLoader.VERSION = '999'
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&client=buf&v=999&callback=' + cb)
| true | baseUrl = GoogleMapsLoader.URL
cb = GoogleMapsLoader.WINDOW_CALLBACK_NAME
describe 'GoogleMaps', ->
afterEach( (done) ->
GoogleMapsLoader.release( ->
done()
)
)
describe '#load()', ->
it 'should throw an error if promise style is used', ->
expect( -> GoogleMapsLoader.load().then()).to.throw(Error, 'Using promises is not supported anymore. Please take a look in new documentation and use callback instead.')
it 'should load google api object', (done) ->
GoogleMapsLoader.load( (google) ->
expect(google).to.be.a('object')
expect(google).to.have.keys(['maps'])
done()
)
it 'should load google api only for first time and then use stored object', (done) ->
count = 0
GoogleMapsLoader.onLoad( -> count++ )
GoogleMapsLoader.load()
GoogleMapsLoader.load()
GoogleMapsLoader.load()
GoogleMapsLoader.load( ->
expect(count).to.be.equal(1)
done()
)
describe '#release()', ->
it 'should restore google maps package to original state and remove google api object completely and load it again', (done) ->
GoogleMapsLoader.load( ->
GoogleMapsLoader.release( ->
expect(GoogleMapsLoader.google).to.be.null
expect(window.google).to.be.undefined
GoogleMapsLoader.load( (google) ->
expect(google).to.be.a('object')
expect(google).to.have.keys(['maps'])
done()
)
)
)
describe '#createUrl()', ->
it 'should create url with sensor support', ->
GoogleMapsLoader.SENSOR = true
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=true&callback=' + cb)
it 'should create url without sensor support', ->
GoogleMapsLoader.SENSOR = false
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&callback=' + cb)
it 'should create url with key', ->
GoogleMapsLoader.KEY = 'PI:KEY:<KEY>END_PI'
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&key=PI:KEY:<KEY>END_PI&callback=' + cb)
it 'should create url with one library', ->
GoogleMapsLoader.LIBRARIES = ['hello']
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&libraries=hello&callback=' + cb)
it 'should create url with more libraries', ->
GoogleMapsLoader.LIBRARIES = ['hello', 'day']
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&libraries=hello,day&callback=' + cb)
it 'should create url with client and version', ->
GoogleMapsLoader.CLIENT = 'buf'
GoogleMapsLoader.VERSION = '999'
expect(GoogleMapsLoader.createUrl()).to.be.equal(baseUrl + '?sensor=false&client=buf&v=999&callback=' + cb)
|
[
{
"context": "dent.locations.forEach (location) ->\n key = \"#{location.latitude},#{location.longitude}\"\n incidentsByLatLng[key] = (incidentsByLatL",
"end": 6549,
"score": 0.9931038618087769,
"start": 6505,
"tag": "KEY",
"value": "\"#{location.latitude},#{location.longitude}\""
}
] | client/controllers/events/eventAffectedAreas.coffee | ecohealthalliance/eidr-connect | 1 | import EventIncidents from '/imports/collections/eventIncidents'
import { formatLocation } from '/imports/utils'
import MapHelpers from '/imports/ui/mapMarkers.coffee'
import Constants from '/imports/constants'
{
LocationTree,
convertAllIncidentsToDifferentials
differentialIncidentsToSubIntervals,
extendSubIntervalsWithValues,
createSupplementalIncidents
} = require('incident-resolution')
Template.eventAffectedAreas.onCreated ->
@maxCount = new ReactiveVar()
@choroplethLayer = new ReactiveVar('cases')
@markerLayer = new ReactiveVar()
@worldGeoJSONRV = new ReactiveVar()
@loading = new ReactiveVar(false)
@tooManyIncidents = new ReactiveVar(false)
HTTP.get '/world.geo.json', (error, resp) =>
if error
console.error error
return
@worldGeoJSONRV.set(resp.data)
Template.eventAffectedAreas.onRendered ->
@$('[data-toggle=tooltip]').tooltip
placement: 'bottom'
delay: 300
bounds = L.latLngBounds(L.latLng(-85, -180), L.latLng(85, 180))
leMap = L.map('map', maxBounds: bounds).setView([10, -0], 3)
L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png',
attribution: """Map tiles by <a href="http://cartodb.com/attributions#basemaps">CartoDB</a>,
under <a href="https://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.
Data by <a href="http://www.openstreetmap.org/">OpenStreetMap</a>, under ODbL.
<br>
CRS:
<a href="http://wiki.openstreetmap.org/wiki/EPSG:3857" >
EPSG:3857
</a>,
Projection: Spherical Mercator""",
subdomains: 'abcd',
type: 'osm'
noWrap: true
minZoom: 2
maxZoom: 18
).addTo(leMap)
geoJsonLayer = null
ramp = chroma.scale(["#345e7e", "#f07381"]).colors(10)
@getColor = (val) ->
# return a color from the ramp based on a 0 to 1 value.
# If the value exceeds one the last stop is used.
ramp[Math.floor(ramp.length * Math.max(0, Math.min(val, 0.99)))]
zoomToFeature = (event) =>
leMap.fitBounds(event.target.getBounds())
highlightFeature = (event) =>
layer = event.target
layer.setStyle
weight: 1
fillColor: '#2CBA74'
color: '#2CBA74'
dashArray: ''
fillOpacity: 0.75
if not L.Browser.ie and not L.Browser.opera
layer.bringToFront()
resetHighlight = (event) =>
geoJsonLayer.resetStyle(event.target)
updateGeoJSONLayer = (worldGeoJSON, incidentType, incidents) =>
if geoJsonLayer
leMap.removeLayer(geoJsonLayer)
mapableIncidents = incidents.fetch().filter (i) ->
i.locations.every (l) -> l.featureCode
if incidentType and worldGeoJSON
baseIncidents = []
constrainingIncidents = []
mapableIncidents.map (incident) ->
if incident.constraining
constrainingIncidents.push incident
else
baseIncidents.push incident
supplementalIncidents = createSupplementalIncidents(baseIncidents, constrainingIncidents)
differentialIncidents = convertAllIncidentsToDifferentials(
baseIncidents
).concat(supplementalIncidents)
differentialIncidents = _.where(
differentialIncidents, type: incidentType
)
subIntervals = differentialIncidentsToSubIntervals(differentialIncidents)
if subIntervals.length > Constants.MAX_SUBINTERVALS
@tooManyIncidents.set(true)
@maxCount.set(0)
return
else
@tooManyIncidents.set(false)
extendSubIntervalsWithValues(differentialIncidents, subIntervals)
for subInterval in subIntervals
subInterval.incidents = subInterval.incidentIds.map (id) ->
differentialIncidents[id]
subIntervals = subIntervals.filter (subI) ->
# Filter out sub-intervals that don't have country level resolution or better.
subI.locationId != "6295630"
locationTree = LocationTree.from(subIntervals.map (x) -> x.location)
topLocations = locationTree.children.map (x) -> x.value
locToSubintervals = {}
for topLocation in topLocations
locToSubintervals[topLocation.id] = []
for topLocation in topLocations
for subInterval in subIntervals
loc = subInterval.location
if LocationTree.locationContains(topLocation, loc)
locToSubintervals[topLocation.id].push(subInterval)
countryCodeToCount = {}
_.pairs(locToSubintervals).map ([key, locSubIntervals]) ->
location = locationTree.getLocationById(key)
groupedLocSubIntervals = _.groupBy(locSubIntervals, 'start')
maxSubintervals = []
for group, subIntervalGroup of groupedLocSubIntervals
maxSubintervals.push(_.max(subIntervalGroup, (x) -> x.value))
maxSubintervals = _.sortBy(maxSubintervals, (x) -> x.start)
total = 0
formattedData = maxSubintervals.forEach (subInt) ->
rate = subInt.value / ((subInt.end - subInt.start) / 1000 / 60 / 60 / 24)
total += subInt.value
prevTotal = countryCodeToCount[location.countryCode] or 0
countryCodeToCount[location.countryCode] = prevTotal + total
maxCount = _.max(_.values(countryCodeToCount))
@maxCount.set maxCount
geoJsonLayer = L.geoJson(
features: worldGeoJSON.features
type: "FeatureCollection"
,
style: (feature) =>
count = countryCodeToCount[feature.properties.iso_a2]
fillColor = @getColor(count / maxCount)
opacity = 0.75
unless fillColor
opacity = 0
fillColor: fillColor
weight: 1
opacity: 1
color: '#DDDDDD'
dashArray: '3'
fillOpacity: opacity
onEachFeature: (feature, layer) ->
layer.on
mouseover: highlightFeature
mouseout: resetHighlight
click: zoomToFeature
).addTo(leMap)
@autorun =>
worldGeoJSON = @worldGeoJSONRV.get()
incidentType = @choroplethLayer.get()
incidents = EventIncidents.find(@data.filterQuery.get())
@loading.set(true)
# Allow UI to update (loading indicator and clicked nav item)
# before updating map
setTimeout =>
updateGeoJSONLayer(worldGeoJSON, incidentType, incidents)
@loading.set(false)
, 200
markerLayerGroup = null
@autorun =>
if markerLayerGroup
leMap.removeLayer(markerLayerGroup)
incidentsByLatLng = {}
EventIncidents.find(@data.filterQuery.get()).map (incident) ->
incident.locations.forEach (location) ->
key = "#{location.latitude},#{location.longitude}"
incidentsByLatLng[key] = (incidentsByLatLng[key] or []).concat(incident)
for key, incidents of incidentsByLatLng
incidentsByLatLng[key] = _.uniq(incidents, false, (x) -> x._id)
if @markerLayer.get()
markerLayerGroup = L.layerGroup()
for key, incidents of incidentsByLatLng
L.marker(key.split(',').map(parseFloat),
icon: L.divIcon
className: 'map-marker-container'
iconSize: null
html: MapHelpers.getMarkerHtml([ rgbColor: [ 244, 143, 103 ] ])
).bindPopup(Blaze.toHTMLWithData(
Template.affectedAreasMarkerPopup,
incidents: incidents
), closeButton: false)
.addTo(markerLayerGroup)
markerLayerGroup.addTo(leMap)
@autorun =>
# Update selected tab based on type filters
selectedIncidentTypes = @data.selectedIncidentTypes.get()
if 'cases' in selectedIncidentTypes and 'deaths' not in selectedIncidentTypes
@choroplethLayer.set('cases')
else if 'cases' not in selectedIncidentTypes and 'deaths' in selectedIncidentTypes
@choroplethLayer.set('deaths')
Template.eventAffectedAreas.helpers
tooManyIncidents: ->
Template.instance().tooManyIncidents.get()
legendValues: ->
maxCount = Template.instance().maxCount.get()
_.range(1, 1 + (maxCount or 0), maxCount / 5).map (value) ->
value: value.toFixed(0)
color: Template.instance().getColor(value / maxCount)
choroplethLayerIs: (name) ->
choroplethLayer = Template.instance().choroplethLayer.get()
if (not choroplethLayer and name == '') or choroplethLayer == name
'active'
markerLayerIs: (name) ->
markerLayer = Template.instance().markerLayer.get()
if (not markerLayer and name == '') or markerLayer == name
'active'
isLoading: ->
Template.instance().loading.get()
disableCases: ->
'cases' not in Template.instance().data.selectedIncidentTypes.get()
disableDeaths: ->
'deaths' not in Template.instance().data.selectedIncidentTypes.get()
Template.eventAffectedAreas.events
'click .cases-layer a': (event, instance) ->
$('.tooltip').remove()
instance.choroplethLayer.set('cases')
'click .deaths-layer a': (event, instance) ->
$('.tooltip').remove()
instance.choroplethLayer.set('deaths')
'click .choropleth-layer-off a': (event, instance) ->
instance.maxCount.set(null)
instance.choroplethLayer.set(null)
'click .marker-layer a': (event, instance) ->
instance.markerLayer.set('incidentLocations')
'click .marker-layer-off a': (event, instance) ->
instance.markerLayer.set(null)
'click .view-incident': (event, instance) ->
incidentId = $(event.currentTarget).data('id')
if incidentId
Modal.show 'incidentModal',
incident: EventIncidents.findOne(incidentId)
| 100527 | import EventIncidents from '/imports/collections/eventIncidents'
import { formatLocation } from '/imports/utils'
import MapHelpers from '/imports/ui/mapMarkers.coffee'
import Constants from '/imports/constants'
{
LocationTree,
convertAllIncidentsToDifferentials
differentialIncidentsToSubIntervals,
extendSubIntervalsWithValues,
createSupplementalIncidents
} = require('incident-resolution')
Template.eventAffectedAreas.onCreated ->
@maxCount = new ReactiveVar()
@choroplethLayer = new ReactiveVar('cases')
@markerLayer = new ReactiveVar()
@worldGeoJSONRV = new ReactiveVar()
@loading = new ReactiveVar(false)
@tooManyIncidents = new ReactiveVar(false)
HTTP.get '/world.geo.json', (error, resp) =>
if error
console.error error
return
@worldGeoJSONRV.set(resp.data)
Template.eventAffectedAreas.onRendered ->
@$('[data-toggle=tooltip]').tooltip
placement: 'bottom'
delay: 300
bounds = L.latLngBounds(L.latLng(-85, -180), L.latLng(85, 180))
leMap = L.map('map', maxBounds: bounds).setView([10, -0], 3)
L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png',
attribution: """Map tiles by <a href="http://cartodb.com/attributions#basemaps">CartoDB</a>,
under <a href="https://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.
Data by <a href="http://www.openstreetmap.org/">OpenStreetMap</a>, under ODbL.
<br>
CRS:
<a href="http://wiki.openstreetmap.org/wiki/EPSG:3857" >
EPSG:3857
</a>,
Projection: Spherical Mercator""",
subdomains: 'abcd',
type: 'osm'
noWrap: true
minZoom: 2
maxZoom: 18
).addTo(leMap)
geoJsonLayer = null
ramp = chroma.scale(["#345e7e", "#f07381"]).colors(10)
@getColor = (val) ->
# return a color from the ramp based on a 0 to 1 value.
# If the value exceeds one the last stop is used.
ramp[Math.floor(ramp.length * Math.max(0, Math.min(val, 0.99)))]
zoomToFeature = (event) =>
leMap.fitBounds(event.target.getBounds())
highlightFeature = (event) =>
layer = event.target
layer.setStyle
weight: 1
fillColor: '#2CBA74'
color: '#2CBA74'
dashArray: ''
fillOpacity: 0.75
if not L.Browser.ie and not L.Browser.opera
layer.bringToFront()
resetHighlight = (event) =>
geoJsonLayer.resetStyle(event.target)
updateGeoJSONLayer = (worldGeoJSON, incidentType, incidents) =>
if geoJsonLayer
leMap.removeLayer(geoJsonLayer)
mapableIncidents = incidents.fetch().filter (i) ->
i.locations.every (l) -> l.featureCode
if incidentType and worldGeoJSON
baseIncidents = []
constrainingIncidents = []
mapableIncidents.map (incident) ->
if incident.constraining
constrainingIncidents.push incident
else
baseIncidents.push incident
supplementalIncidents = createSupplementalIncidents(baseIncidents, constrainingIncidents)
differentialIncidents = convertAllIncidentsToDifferentials(
baseIncidents
).concat(supplementalIncidents)
differentialIncidents = _.where(
differentialIncidents, type: incidentType
)
subIntervals = differentialIncidentsToSubIntervals(differentialIncidents)
if subIntervals.length > Constants.MAX_SUBINTERVALS
@tooManyIncidents.set(true)
@maxCount.set(0)
return
else
@tooManyIncidents.set(false)
extendSubIntervalsWithValues(differentialIncidents, subIntervals)
for subInterval in subIntervals
subInterval.incidents = subInterval.incidentIds.map (id) ->
differentialIncidents[id]
subIntervals = subIntervals.filter (subI) ->
# Filter out sub-intervals that don't have country level resolution or better.
subI.locationId != "6295630"
locationTree = LocationTree.from(subIntervals.map (x) -> x.location)
topLocations = locationTree.children.map (x) -> x.value
locToSubintervals = {}
for topLocation in topLocations
locToSubintervals[topLocation.id] = []
for topLocation in topLocations
for subInterval in subIntervals
loc = subInterval.location
if LocationTree.locationContains(topLocation, loc)
locToSubintervals[topLocation.id].push(subInterval)
countryCodeToCount = {}
_.pairs(locToSubintervals).map ([key, locSubIntervals]) ->
location = locationTree.getLocationById(key)
groupedLocSubIntervals = _.groupBy(locSubIntervals, 'start')
maxSubintervals = []
for group, subIntervalGroup of groupedLocSubIntervals
maxSubintervals.push(_.max(subIntervalGroup, (x) -> x.value))
maxSubintervals = _.sortBy(maxSubintervals, (x) -> x.start)
total = 0
formattedData = maxSubintervals.forEach (subInt) ->
rate = subInt.value / ((subInt.end - subInt.start) / 1000 / 60 / 60 / 24)
total += subInt.value
prevTotal = countryCodeToCount[location.countryCode] or 0
countryCodeToCount[location.countryCode] = prevTotal + total
maxCount = _.max(_.values(countryCodeToCount))
@maxCount.set maxCount
geoJsonLayer = L.geoJson(
features: worldGeoJSON.features
type: "FeatureCollection"
,
style: (feature) =>
count = countryCodeToCount[feature.properties.iso_a2]
fillColor = @getColor(count / maxCount)
opacity = 0.75
unless fillColor
opacity = 0
fillColor: fillColor
weight: 1
opacity: 1
color: '#DDDDDD'
dashArray: '3'
fillOpacity: opacity
onEachFeature: (feature, layer) ->
layer.on
mouseover: highlightFeature
mouseout: resetHighlight
click: zoomToFeature
).addTo(leMap)
@autorun =>
worldGeoJSON = @worldGeoJSONRV.get()
incidentType = @choroplethLayer.get()
incidents = EventIncidents.find(@data.filterQuery.get())
@loading.set(true)
# Allow UI to update (loading indicator and clicked nav item)
# before updating map
setTimeout =>
updateGeoJSONLayer(worldGeoJSON, incidentType, incidents)
@loading.set(false)
, 200
markerLayerGroup = null
@autorun =>
if markerLayerGroup
leMap.removeLayer(markerLayerGroup)
incidentsByLatLng = {}
EventIncidents.find(@data.filterQuery.get()).map (incident) ->
incident.locations.forEach (location) ->
key = <KEY>
incidentsByLatLng[key] = (incidentsByLatLng[key] or []).concat(incident)
for key, incidents of incidentsByLatLng
incidentsByLatLng[key] = _.uniq(incidents, false, (x) -> x._id)
if @markerLayer.get()
markerLayerGroup = L.layerGroup()
for key, incidents of incidentsByLatLng
L.marker(key.split(',').map(parseFloat),
icon: L.divIcon
className: 'map-marker-container'
iconSize: null
html: MapHelpers.getMarkerHtml([ rgbColor: [ 244, 143, 103 ] ])
).bindPopup(Blaze.toHTMLWithData(
Template.affectedAreasMarkerPopup,
incidents: incidents
), closeButton: false)
.addTo(markerLayerGroup)
markerLayerGroup.addTo(leMap)
@autorun =>
# Update selected tab based on type filters
selectedIncidentTypes = @data.selectedIncidentTypes.get()
if 'cases' in selectedIncidentTypes and 'deaths' not in selectedIncidentTypes
@choroplethLayer.set('cases')
else if 'cases' not in selectedIncidentTypes and 'deaths' in selectedIncidentTypes
@choroplethLayer.set('deaths')
Template.eventAffectedAreas.helpers
tooManyIncidents: ->
Template.instance().tooManyIncidents.get()
legendValues: ->
maxCount = Template.instance().maxCount.get()
_.range(1, 1 + (maxCount or 0), maxCount / 5).map (value) ->
value: value.toFixed(0)
color: Template.instance().getColor(value / maxCount)
choroplethLayerIs: (name) ->
choroplethLayer = Template.instance().choroplethLayer.get()
if (not choroplethLayer and name == '') or choroplethLayer == name
'active'
markerLayerIs: (name) ->
markerLayer = Template.instance().markerLayer.get()
if (not markerLayer and name == '') or markerLayer == name
'active'
isLoading: ->
Template.instance().loading.get()
disableCases: ->
'cases' not in Template.instance().data.selectedIncidentTypes.get()
disableDeaths: ->
'deaths' not in Template.instance().data.selectedIncidentTypes.get()
Template.eventAffectedAreas.events
'click .cases-layer a': (event, instance) ->
$('.tooltip').remove()
instance.choroplethLayer.set('cases')
'click .deaths-layer a': (event, instance) ->
$('.tooltip').remove()
instance.choroplethLayer.set('deaths')
'click .choropleth-layer-off a': (event, instance) ->
instance.maxCount.set(null)
instance.choroplethLayer.set(null)
'click .marker-layer a': (event, instance) ->
instance.markerLayer.set('incidentLocations')
'click .marker-layer-off a': (event, instance) ->
instance.markerLayer.set(null)
'click .view-incident': (event, instance) ->
incidentId = $(event.currentTarget).data('id')
if incidentId
Modal.show 'incidentModal',
incident: EventIncidents.findOne(incidentId)
| true | import EventIncidents from '/imports/collections/eventIncidents'
import { formatLocation } from '/imports/utils'
import MapHelpers from '/imports/ui/mapMarkers.coffee'
import Constants from '/imports/constants'
{
LocationTree,
convertAllIncidentsToDifferentials
differentialIncidentsToSubIntervals,
extendSubIntervalsWithValues,
createSupplementalIncidents
} = require('incident-resolution')
Template.eventAffectedAreas.onCreated ->
@maxCount = new ReactiveVar()
@choroplethLayer = new ReactiveVar('cases')
@markerLayer = new ReactiveVar()
@worldGeoJSONRV = new ReactiveVar()
@loading = new ReactiveVar(false)
@tooManyIncidents = new ReactiveVar(false)
HTTP.get '/world.geo.json', (error, resp) =>
if error
console.error error
return
@worldGeoJSONRV.set(resp.data)
Template.eventAffectedAreas.onRendered ->
@$('[data-toggle=tooltip]').tooltip
placement: 'bottom'
delay: 300
bounds = L.latLngBounds(L.latLng(-85, -180), L.latLng(85, 180))
leMap = L.map('map', maxBounds: bounds).setView([10, -0], 3)
L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png',
attribution: """Map tiles by <a href="http://cartodb.com/attributions#basemaps">CartoDB</a>,
under <a href="https://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.
Data by <a href="http://www.openstreetmap.org/">OpenStreetMap</a>, under ODbL.
<br>
CRS:
<a href="http://wiki.openstreetmap.org/wiki/EPSG:3857" >
EPSG:3857
</a>,
Projection: Spherical Mercator""",
subdomains: 'abcd',
type: 'osm'
noWrap: true
minZoom: 2
maxZoom: 18
).addTo(leMap)
geoJsonLayer = null
ramp = chroma.scale(["#345e7e", "#f07381"]).colors(10)
@getColor = (val) ->
# return a color from the ramp based on a 0 to 1 value.
# If the value exceeds one the last stop is used.
ramp[Math.floor(ramp.length * Math.max(0, Math.min(val, 0.99)))]
zoomToFeature = (event) =>
leMap.fitBounds(event.target.getBounds())
highlightFeature = (event) =>
layer = event.target
layer.setStyle
weight: 1
fillColor: '#2CBA74'
color: '#2CBA74'
dashArray: ''
fillOpacity: 0.75
if not L.Browser.ie and not L.Browser.opera
layer.bringToFront()
resetHighlight = (event) =>
geoJsonLayer.resetStyle(event.target)
updateGeoJSONLayer = (worldGeoJSON, incidentType, incidents) =>
if geoJsonLayer
leMap.removeLayer(geoJsonLayer)
mapableIncidents = incidents.fetch().filter (i) ->
i.locations.every (l) -> l.featureCode
if incidentType and worldGeoJSON
baseIncidents = []
constrainingIncidents = []
mapableIncidents.map (incident) ->
if incident.constraining
constrainingIncidents.push incident
else
baseIncidents.push incident
supplementalIncidents = createSupplementalIncidents(baseIncidents, constrainingIncidents)
differentialIncidents = convertAllIncidentsToDifferentials(
baseIncidents
).concat(supplementalIncidents)
differentialIncidents = _.where(
differentialIncidents, type: incidentType
)
subIntervals = differentialIncidentsToSubIntervals(differentialIncidents)
if subIntervals.length > Constants.MAX_SUBINTERVALS
@tooManyIncidents.set(true)
@maxCount.set(0)
return
else
@tooManyIncidents.set(false)
extendSubIntervalsWithValues(differentialIncidents, subIntervals)
for subInterval in subIntervals
subInterval.incidents = subInterval.incidentIds.map (id) ->
differentialIncidents[id]
subIntervals = subIntervals.filter (subI) ->
# Filter out sub-intervals that don't have country level resolution or better.
subI.locationId != "6295630"
locationTree = LocationTree.from(subIntervals.map (x) -> x.location)
topLocations = locationTree.children.map (x) -> x.value
locToSubintervals = {}
for topLocation in topLocations
locToSubintervals[topLocation.id] = []
for topLocation in topLocations
for subInterval in subIntervals
loc = subInterval.location
if LocationTree.locationContains(topLocation, loc)
locToSubintervals[topLocation.id].push(subInterval)
countryCodeToCount = {}
_.pairs(locToSubintervals).map ([key, locSubIntervals]) ->
location = locationTree.getLocationById(key)
groupedLocSubIntervals = _.groupBy(locSubIntervals, 'start')
maxSubintervals = []
for group, subIntervalGroup of groupedLocSubIntervals
maxSubintervals.push(_.max(subIntervalGroup, (x) -> x.value))
maxSubintervals = _.sortBy(maxSubintervals, (x) -> x.start)
total = 0
formattedData = maxSubintervals.forEach (subInt) ->
rate = subInt.value / ((subInt.end - subInt.start) / 1000 / 60 / 60 / 24)
total += subInt.value
prevTotal = countryCodeToCount[location.countryCode] or 0
countryCodeToCount[location.countryCode] = prevTotal + total
maxCount = _.max(_.values(countryCodeToCount))
@maxCount.set maxCount
geoJsonLayer = L.geoJson(
features: worldGeoJSON.features
type: "FeatureCollection"
,
style: (feature) =>
count = countryCodeToCount[feature.properties.iso_a2]
fillColor = @getColor(count / maxCount)
opacity = 0.75
unless fillColor
opacity = 0
fillColor: fillColor
weight: 1
opacity: 1
color: '#DDDDDD'
dashArray: '3'
fillOpacity: opacity
onEachFeature: (feature, layer) ->
layer.on
mouseover: highlightFeature
mouseout: resetHighlight
click: zoomToFeature
).addTo(leMap)
@autorun =>
worldGeoJSON = @worldGeoJSONRV.get()
incidentType = @choroplethLayer.get()
incidents = EventIncidents.find(@data.filterQuery.get())
@loading.set(true)
# Allow UI to update (loading indicator and clicked nav item)
# before updating map
setTimeout =>
updateGeoJSONLayer(worldGeoJSON, incidentType, incidents)
@loading.set(false)
, 200
markerLayerGroup = null
@autorun =>
if markerLayerGroup
leMap.removeLayer(markerLayerGroup)
incidentsByLatLng = {}
EventIncidents.find(@data.filterQuery.get()).map (incident) ->
incident.locations.forEach (location) ->
key = PI:KEY:<KEY>END_PI
incidentsByLatLng[key] = (incidentsByLatLng[key] or []).concat(incident)
for key, incidents of incidentsByLatLng
incidentsByLatLng[key] = _.uniq(incidents, false, (x) -> x._id)
if @markerLayer.get()
markerLayerGroup = L.layerGroup()
for key, incidents of incidentsByLatLng
L.marker(key.split(',').map(parseFloat),
icon: L.divIcon
className: 'map-marker-container'
iconSize: null
html: MapHelpers.getMarkerHtml([ rgbColor: [ 244, 143, 103 ] ])
).bindPopup(Blaze.toHTMLWithData(
Template.affectedAreasMarkerPopup,
incidents: incidents
), closeButton: false)
.addTo(markerLayerGroup)
markerLayerGroup.addTo(leMap)
@autorun =>
# Update selected tab based on type filters
selectedIncidentTypes = @data.selectedIncidentTypes.get()
if 'cases' in selectedIncidentTypes and 'deaths' not in selectedIncidentTypes
@choroplethLayer.set('cases')
else if 'cases' not in selectedIncidentTypes and 'deaths' in selectedIncidentTypes
@choroplethLayer.set('deaths')
Template.eventAffectedAreas.helpers
tooManyIncidents: ->
Template.instance().tooManyIncidents.get()
legendValues: ->
maxCount = Template.instance().maxCount.get()
_.range(1, 1 + (maxCount or 0), maxCount / 5).map (value) ->
value: value.toFixed(0)
color: Template.instance().getColor(value / maxCount)
choroplethLayerIs: (name) ->
choroplethLayer = Template.instance().choroplethLayer.get()
if (not choroplethLayer and name == '') or choroplethLayer == name
'active'
markerLayerIs: (name) ->
markerLayer = Template.instance().markerLayer.get()
if (not markerLayer and name == '') or markerLayer == name
'active'
isLoading: ->
Template.instance().loading.get()
disableCases: ->
'cases' not in Template.instance().data.selectedIncidentTypes.get()
disableDeaths: ->
'deaths' not in Template.instance().data.selectedIncidentTypes.get()
Template.eventAffectedAreas.events
'click .cases-layer a': (event, instance) ->
$('.tooltip').remove()
instance.choroplethLayer.set('cases')
'click .deaths-layer a': (event, instance) ->
$('.tooltip').remove()
instance.choroplethLayer.set('deaths')
'click .choropleth-layer-off a': (event, instance) ->
instance.maxCount.set(null)
instance.choroplethLayer.set(null)
'click .marker-layer a': (event, instance) ->
instance.markerLayer.set('incidentLocations')
'click .marker-layer-off a': (event, instance) ->
instance.markerLayer.set(null)
'click .view-incident': (event, instance) ->
incidentId = $(event.currentTarget).data('id')
if incidentId
Modal.show 'incidentModal',
incident: EventIncidents.findOne(incidentId)
|
[
{
"context": "ent timeline for HR Candidates\\Employee \r\n@author: Youri Noel Nelson (Yourinium)\r\n###\r\n\r\n# This data can be substitute",
"end": 148,
"score": 0.9998072385787964,
"start": 131,
"tag": "NAME",
"value": "Youri Noel Nelson"
}
] | Dryad_Timeline_V2_0_0.coffee | yourinoelnelson/BubbleTime | 0 | ###
Name: Dryad Timeline - Version 2.0.0
Date: 03/11/2016
Purpose: Display event timeline for HR Candidates\Employee
@author: Youri Noel Nelson (Yourinium)
###
# This data can be substituted in Skuid with dates = MyModel.data
dates =
date:
Event_Date__c:'2014-11-17'
Event_Type__c:'Confirmed Start'
In_Approval_Process__c:false
Approved__c:false
NOT_Approved__c: false
date:
Event_Date__c:'2015-11-17'
Event_Type__c:'Promotion'
In_Approval_Process__c:false
Approved__c:false
NOT_Approved__c: false
# The system date is used on the timeline to place the [NOW] mention
today = new Date
today.setHours(0,0,0,0)
# Days of the week for the Bubble display
weekday = [
"Sunday"
"Monday"
"Tuesday"
"Wednesday"
"Thursday"
"Friday"
"Saturday"
]
# Months of the year for the Bubble display
month =[
"January"
"February"
"March"
"April"
"May"
"June"
"July"
"August"
"September"
"October"
"November"
"December"
]
BubbleTime = (config) ->
obj = this
obj.config =
### id: string (MANDATORY)
This is the bubble time container's id
###
#id: config.id
### dates: array of object with following variables (MANDATORY)
Event_Date__c : date YYYY-MM-DD
Event_Type__c: string
In_Approval_Process__c : boolean
Approved__c : boolean
NOT_Approved__c: boolean
This is where the bulk of the information is stored to be used int eh creation of the bubble time
###
#dates: config.dates
### branchCap: integer
The length cap for any given line connecting two bubbles
after which the branch will be compressed to save space.
###
branchCap: lookup 'branchCap' , config , 300
### dotdotRadius: integer
| o o o |
The size of the 3 dots when compressing a branch
###
dotdotRadius: lookup 'dotdotRadius', config , 3
### dotdotWall: integer
| o o o |
The size of the line on either size of the 3 dots
###
dotdotWall: lookup 'dotdotWall', config , 20
### dotdotSpace: integer
| o o o |
The width between the 2 lines, the 3 dots
will be evenly distributed between these lines
###
dotdotSpace: lookup 'dotdotSpace', config , 42
### lineHeight: integer
Sets the height of the line in between bubbles
###
lineHeight: lookup 'lineHeight', config, 5
### pointInnerRadius: integer
Sets the radius of event point innner radius
###
pointInnerRadius: lookup 'pointInnerRadius', config, 5
### pointOuterRadius: integer
Sets the radius of event point outer radius
###
pointOuterRadius: lookup 'pointInnerRadius', config, 8
obj.drawNowBox()
obj.drawLine(150, "#004165")
obj.drawPoint("number_0","event1", "#004165", true)
return
###
Prototype functions used in the graphical display of the bubble time
###
###
Function to draw the event circle
eventID : String; Ex: "number_0"
className: String; Ex: "event1" or "event2". Will place a bubble above the
outerRing: boolean; Determines whether the point has an outer ring
line and another below.
###
BubbleTime.prototype.drawPoint = (eventID, className , color, outerRing) ->
obj = this
$(".Timeline").append "<div class= #{className} id = #{eventID}>"
point = d3.select "##{eventID}"
.append "svg"
.attr "width", obj.config.pointOuterRadius*2.75
.attr "height", obj.config.pointOuterRadius*3
#Inner Circle
point.append "circle"
.attr "cx", obj.config.pointOuterRadius*1.375
.attr "cy", obj.config.pointOuterRadius*1.625
.attr "r", obj.config.pointInnerRadius
.style "fill", color
if outerRing
#Outer Circle
point.append "circle"
.attr "cx", obj.config.pointOuterRadius*1.375
.attr "cy", obj.config.pointOuterRadius*1.625
.attr "r", obj.config.pointOuterRadius
.style "fill", "none"
.style "stroke-width", 2
.style "stroke", color
return
###Function to draw the NOW rectangle ###
BubbleTime.prototype.drawNowBox = ->
$(".Timeline").append "<div class='now'>"
$(".now").append "NOW"
return
###Function to draw the NOW rectangle ###
BubbleTime.prototype.drawBubble = () ->
return
###
Function to draw the lines between bubbles
Length: integer
Color: String; Ex:"red" or "#F56F23"
###
BubbleTime.prototype.drawLine = (length, color) ->
obj = this
if length <= obj.config.branchCap
line = d3.select ".Timeline"
.append "svg"
.attr "width", length
.attr "height", obj.config.lineHeight
.append "line"
.attr "x1", 0
.attr "y1", 0
.attr "y2", 0
.attr "x2", length
.style "stroke", color
.style "stroke-width", obj.config.lineHeight
else
###
If the length of the branch is greater than the cap
we compress by doing one line, 3 dots another line
###
branchCompress = (obj.config.branchCap - obj.config.dotdotSpace) / 2
dotxDist = (obj.config.dotdotSpace - 2) / 4
dotyDist = obj.config.dotdotWall / 2
line = d3.select ".Timeline"
.append "svg"
.attr "width", branchCompress
.attr "height", obj.config.lineHeight
.append "line"
.attr "x1", 0
.attr "y1", 0
.attr "y2", 0
.attr "x2", branchCompress
.style "stroke", color
.style "stroke-width", obj.config.lineHeight
dotdot = d3.select ".Timeline"
.append "svg"
.attr "width", obj.config.dotdotSpace
.attr "height", obj.config.dotdotWall
dotdot.append "line"
.attr "x1", 1
.attr "y1", 0
.attr "x2", 1
.attr "y2", obj.config.dotdotWall
.style "stroke", color
.style "stroke-width", 2
dotdot.append "circle"
.attr "cx", dotxDist + 1
.attr "cy", dotyDist
.attr "r", obj.config.dotdotRadius
.style "fill", color
dotdot.append "circle"
.attr "cx", dotxDist*2 + 1
.attr "cy", dotyDist
.attr "r", obj.config.dotdotRadius
.style "fill", color
dotdot.append "circle"
.attr "cx", dotxDist*3 + 1
.attr "cy", dotyDist
.attr "r", obj.config.dotdotRadius
.style "fill", color
dotdot.append "line"
.attr "x1", obj.config.dotdotSpace - 1
.attr "y1", 0
.attr "x2", obj.config.dotdotSpace - 1
.attr "y2", obj.config.dotdotWall
.style "stroke", color
.style "stroke-width", 2
line2 = d3.select ".Timeline"
.append "svg"
.attr "width", length
.attr "height", obj.config.lineHeight
.append "line"
.attr "x1", 0
.attr "y1", 0
.attr "y2", 0
.style "stroke", color
.style "stroke-width", obj.config.lineHeight
.attr "x2", branchCompress
return
###
Utility functions below
###
### Ensure the proper formatting/display of the dates' digits###
twoDigitDate = (input) ->
input = "0 #{input}" if input < 10
return input
### Parses a date in yyyy-mm-dd format###
parseDate = (input) ->
parts = input.match(/(\d+)/g)
new Date(parts[0], parts[1]-1, parts[2])
### Calculates the number of days between two dates###
daySpan = (date1, date2) ->
dif = (date1.getTime() - date2.getTime()) / (24 * 60 * 60 * 1000)
#Making sure the output is a positive round number
days = Math.round Math.abs dif
return days
### Calculating the total number of days the BubbleTime will span over###
totalSpan = (firstDate, lastDate) ->
if parseDate(firsDate) < today
totalSpan = daySpan parseDate(firstDate) , today
else
totalSpan = daySpan parseDate(firstDate) , lastDate
return totalSpan
### Helper function that looks up the value of a variable in an object and if none
is found that returns a default value ###
lookup = (keyVar, obj, defval ) ->
val = defval
if keyVar?
if obj? and typeof obj is "object" and key in obj
val=obj[keyVar]
else val = defval
return val
display = new BubbleTime | 104716 | ###
Name: Dryad Timeline - Version 2.0.0
Date: 03/11/2016
Purpose: Display event timeline for HR Candidates\Employee
@author: <NAME> (Yourinium)
###
# This data can be substituted in Skuid with dates = MyModel.data
dates =
date:
Event_Date__c:'2014-11-17'
Event_Type__c:'Confirmed Start'
In_Approval_Process__c:false
Approved__c:false
NOT_Approved__c: false
date:
Event_Date__c:'2015-11-17'
Event_Type__c:'Promotion'
In_Approval_Process__c:false
Approved__c:false
NOT_Approved__c: false
# The system date is used on the timeline to place the [NOW] mention
today = new Date
today.setHours(0,0,0,0)
# Days of the week for the Bubble display
weekday = [
"Sunday"
"Monday"
"Tuesday"
"Wednesday"
"Thursday"
"Friday"
"Saturday"
]
# Months of the year for the Bubble display
month =[
"January"
"February"
"March"
"April"
"May"
"June"
"July"
"August"
"September"
"October"
"November"
"December"
]
BubbleTime = (config) ->
obj = this
obj.config =
### id: string (MANDATORY)
This is the bubble time container's id
###
#id: config.id
### dates: array of object with following variables (MANDATORY)
Event_Date__c : date YYYY-MM-DD
Event_Type__c: string
In_Approval_Process__c : boolean
Approved__c : boolean
NOT_Approved__c: boolean
This is where the bulk of the information is stored to be used int eh creation of the bubble time
###
#dates: config.dates
### branchCap: integer
The length cap for any given line connecting two bubbles
after which the branch will be compressed to save space.
###
branchCap: lookup 'branchCap' , config , 300
### dotdotRadius: integer
| o o o |
The size of the 3 dots when compressing a branch
###
dotdotRadius: lookup 'dotdotRadius', config , 3
### dotdotWall: integer
| o o o |
The size of the line on either size of the 3 dots
###
dotdotWall: lookup 'dotdotWall', config , 20
### dotdotSpace: integer
| o o o |
The width between the 2 lines, the 3 dots
will be evenly distributed between these lines
###
dotdotSpace: lookup 'dotdotSpace', config , 42
### lineHeight: integer
Sets the height of the line in between bubbles
###
lineHeight: lookup 'lineHeight', config, 5
### pointInnerRadius: integer
Sets the radius of event point innner radius
###
pointInnerRadius: lookup 'pointInnerRadius', config, 5
### pointOuterRadius: integer
Sets the radius of event point outer radius
###
pointOuterRadius: lookup 'pointInnerRadius', config, 8
obj.drawNowBox()
obj.drawLine(150, "#004165")
obj.drawPoint("number_0","event1", "#004165", true)
return
###
Prototype functions used in the graphical display of the bubble time
###
###
Function to draw the event circle
eventID : String; Ex: "number_0"
className: String; Ex: "event1" or "event2". Will place a bubble above the
outerRing: boolean; Determines whether the point has an outer ring
line and another below.
###
BubbleTime.prototype.drawPoint = (eventID, className , color, outerRing) ->
obj = this
$(".Timeline").append "<div class= #{className} id = #{eventID}>"
point = d3.select "##{eventID}"
.append "svg"
.attr "width", obj.config.pointOuterRadius*2.75
.attr "height", obj.config.pointOuterRadius*3
#Inner Circle
point.append "circle"
.attr "cx", obj.config.pointOuterRadius*1.375
.attr "cy", obj.config.pointOuterRadius*1.625
.attr "r", obj.config.pointInnerRadius
.style "fill", color
if outerRing
#Outer Circle
point.append "circle"
.attr "cx", obj.config.pointOuterRadius*1.375
.attr "cy", obj.config.pointOuterRadius*1.625
.attr "r", obj.config.pointOuterRadius
.style "fill", "none"
.style "stroke-width", 2
.style "stroke", color
return
###Function to draw the NOW rectangle ###
BubbleTime.prototype.drawNowBox = ->
$(".Timeline").append "<div class='now'>"
$(".now").append "NOW"
return
###Function to draw the NOW rectangle ###
BubbleTime.prototype.drawBubble = () ->
return
###
Function to draw the lines between bubbles
Length: integer
Color: String; Ex:"red" or "#F56F23"
###
BubbleTime.prototype.drawLine = (length, color) ->
obj = this
if length <= obj.config.branchCap
line = d3.select ".Timeline"
.append "svg"
.attr "width", length
.attr "height", obj.config.lineHeight
.append "line"
.attr "x1", 0
.attr "y1", 0
.attr "y2", 0
.attr "x2", length
.style "stroke", color
.style "stroke-width", obj.config.lineHeight
else
###
If the length of the branch is greater than the cap
we compress by doing one line, 3 dots another line
###
branchCompress = (obj.config.branchCap - obj.config.dotdotSpace) / 2
dotxDist = (obj.config.dotdotSpace - 2) / 4
dotyDist = obj.config.dotdotWall / 2
line = d3.select ".Timeline"
.append "svg"
.attr "width", branchCompress
.attr "height", obj.config.lineHeight
.append "line"
.attr "x1", 0
.attr "y1", 0
.attr "y2", 0
.attr "x2", branchCompress
.style "stroke", color
.style "stroke-width", obj.config.lineHeight
dotdot = d3.select ".Timeline"
.append "svg"
.attr "width", obj.config.dotdotSpace
.attr "height", obj.config.dotdotWall
dotdot.append "line"
.attr "x1", 1
.attr "y1", 0
.attr "x2", 1
.attr "y2", obj.config.dotdotWall
.style "stroke", color
.style "stroke-width", 2
dotdot.append "circle"
.attr "cx", dotxDist + 1
.attr "cy", dotyDist
.attr "r", obj.config.dotdotRadius
.style "fill", color
dotdot.append "circle"
.attr "cx", dotxDist*2 + 1
.attr "cy", dotyDist
.attr "r", obj.config.dotdotRadius
.style "fill", color
dotdot.append "circle"
.attr "cx", dotxDist*3 + 1
.attr "cy", dotyDist
.attr "r", obj.config.dotdotRadius
.style "fill", color
dotdot.append "line"
.attr "x1", obj.config.dotdotSpace - 1
.attr "y1", 0
.attr "x2", obj.config.dotdotSpace - 1
.attr "y2", obj.config.dotdotWall
.style "stroke", color
.style "stroke-width", 2
line2 = d3.select ".Timeline"
.append "svg"
.attr "width", length
.attr "height", obj.config.lineHeight
.append "line"
.attr "x1", 0
.attr "y1", 0
.attr "y2", 0
.style "stroke", color
.style "stroke-width", obj.config.lineHeight
.attr "x2", branchCompress
return
###
Utility functions below
###
### Ensure the proper formatting/display of the dates' digits###
twoDigitDate = (input) ->
input = "0 #{input}" if input < 10
return input
### Parses a date in yyyy-mm-dd format###
parseDate = (input) ->
parts = input.match(/(\d+)/g)
new Date(parts[0], parts[1]-1, parts[2])
### Calculates the number of days between two dates###
daySpan = (date1, date2) ->
dif = (date1.getTime() - date2.getTime()) / (24 * 60 * 60 * 1000)
#Making sure the output is a positive round number
days = Math.round Math.abs dif
return days
### Calculating the total number of days the BubbleTime will span over###
totalSpan = (firstDate, lastDate) ->
if parseDate(firsDate) < today
totalSpan = daySpan parseDate(firstDate) , today
else
totalSpan = daySpan parseDate(firstDate) , lastDate
return totalSpan
### Helper function that looks up the value of a variable in an object and if none
is found that returns a default value ###
lookup = (keyVar, obj, defval ) ->
val = defval
if keyVar?
if obj? and typeof obj is "object" and key in obj
val=obj[keyVar]
else val = defval
return val
display = new BubbleTime | true | ###
Name: Dryad Timeline - Version 2.0.0
Date: 03/11/2016
Purpose: Display event timeline for HR Candidates\Employee
@author: PI:NAME:<NAME>END_PI (Yourinium)
###
# This data can be substituted in Skuid with dates = MyModel.data
dates =
date:
Event_Date__c:'2014-11-17'
Event_Type__c:'Confirmed Start'
In_Approval_Process__c:false
Approved__c:false
NOT_Approved__c: false
date:
Event_Date__c:'2015-11-17'
Event_Type__c:'Promotion'
In_Approval_Process__c:false
Approved__c:false
NOT_Approved__c: false
# The system date is used on the timeline to place the [NOW] mention
today = new Date
today.setHours(0,0,0,0)
# Days of the week for the Bubble display
weekday = [
"Sunday"
"Monday"
"Tuesday"
"Wednesday"
"Thursday"
"Friday"
"Saturday"
]
# Months of the year for the Bubble display
month =[
"January"
"February"
"March"
"April"
"May"
"June"
"July"
"August"
"September"
"October"
"November"
"December"
]
BubbleTime = (config) ->
obj = this
obj.config =
### id: string (MANDATORY)
This is the bubble time container's id
###
#id: config.id
### dates: array of object with following variables (MANDATORY)
Event_Date__c : date YYYY-MM-DD
Event_Type__c: string
In_Approval_Process__c : boolean
Approved__c : boolean
NOT_Approved__c: boolean
This is where the bulk of the information is stored to be used int eh creation of the bubble time
###
#dates: config.dates
### branchCap: integer
The length cap for any given line connecting two bubbles
after which the branch will be compressed to save space.
###
branchCap: lookup 'branchCap' , config , 300
### dotdotRadius: integer
| o o o |
The size of the 3 dots when compressing a branch
###
dotdotRadius: lookup 'dotdotRadius', config , 3
### dotdotWall: integer
| o o o |
The size of the line on either size of the 3 dots
###
dotdotWall: lookup 'dotdotWall', config , 20
### dotdotSpace: integer
| o o o |
The width between the 2 lines, the 3 dots
will be evenly distributed between these lines
###
dotdotSpace: lookup 'dotdotSpace', config , 42
### lineHeight: integer
Sets the height of the line in between bubbles
###
lineHeight: lookup 'lineHeight', config, 5
### pointInnerRadius: integer
Sets the radius of event point innner radius
###
pointInnerRadius: lookup 'pointInnerRadius', config, 5
### pointOuterRadius: integer
Sets the radius of event point outer radius
###
pointOuterRadius: lookup 'pointInnerRadius', config, 8
obj.drawNowBox()
obj.drawLine(150, "#004165")
obj.drawPoint("number_0","event1", "#004165", true)
return
###
Prototype functions used in the graphical display of the bubble time
###
###
Function to draw the event circle
eventID : String; Ex: "number_0"
className: String; Ex: "event1" or "event2". Will place a bubble above the
outerRing: boolean; Determines whether the point has an outer ring
line and another below.
###
BubbleTime.prototype.drawPoint = (eventID, className , color, outerRing) ->
obj = this
$(".Timeline").append "<div class= #{className} id = #{eventID}>"
point = d3.select "##{eventID}"
.append "svg"
.attr "width", obj.config.pointOuterRadius*2.75
.attr "height", obj.config.pointOuterRadius*3
#Inner Circle
point.append "circle"
.attr "cx", obj.config.pointOuterRadius*1.375
.attr "cy", obj.config.pointOuterRadius*1.625
.attr "r", obj.config.pointInnerRadius
.style "fill", color
if outerRing
#Outer Circle
point.append "circle"
.attr "cx", obj.config.pointOuterRadius*1.375
.attr "cy", obj.config.pointOuterRadius*1.625
.attr "r", obj.config.pointOuterRadius
.style "fill", "none"
.style "stroke-width", 2
.style "stroke", color
return
###Function to draw the NOW rectangle ###
BubbleTime.prototype.drawNowBox = ->
$(".Timeline").append "<div class='now'>"
$(".now").append "NOW"
return
###Function to draw the NOW rectangle ###
BubbleTime.prototype.drawBubble = () ->
return
###
Function to draw the lines between bubbles
Length: integer
Color: String; Ex:"red" or "#F56F23"
###
BubbleTime.prototype.drawLine = (length, color) ->
obj = this
if length <= obj.config.branchCap
line = d3.select ".Timeline"
.append "svg"
.attr "width", length
.attr "height", obj.config.lineHeight
.append "line"
.attr "x1", 0
.attr "y1", 0
.attr "y2", 0
.attr "x2", length
.style "stroke", color
.style "stroke-width", obj.config.lineHeight
else
###
If the length of the branch is greater than the cap
we compress by doing one line, 3 dots another line
###
branchCompress = (obj.config.branchCap - obj.config.dotdotSpace) / 2
dotxDist = (obj.config.dotdotSpace - 2) / 4
dotyDist = obj.config.dotdotWall / 2
line = d3.select ".Timeline"
.append "svg"
.attr "width", branchCompress
.attr "height", obj.config.lineHeight
.append "line"
.attr "x1", 0
.attr "y1", 0
.attr "y2", 0
.attr "x2", branchCompress
.style "stroke", color
.style "stroke-width", obj.config.lineHeight
dotdot = d3.select ".Timeline"
.append "svg"
.attr "width", obj.config.dotdotSpace
.attr "height", obj.config.dotdotWall
dotdot.append "line"
.attr "x1", 1
.attr "y1", 0
.attr "x2", 1
.attr "y2", obj.config.dotdotWall
.style "stroke", color
.style "stroke-width", 2
dotdot.append "circle"
.attr "cx", dotxDist + 1
.attr "cy", dotyDist
.attr "r", obj.config.dotdotRadius
.style "fill", color
dotdot.append "circle"
.attr "cx", dotxDist*2 + 1
.attr "cy", dotyDist
.attr "r", obj.config.dotdotRadius
.style "fill", color
dotdot.append "circle"
.attr "cx", dotxDist*3 + 1
.attr "cy", dotyDist
.attr "r", obj.config.dotdotRadius
.style "fill", color
dotdot.append "line"
.attr "x1", obj.config.dotdotSpace - 1
.attr "y1", 0
.attr "x2", obj.config.dotdotSpace - 1
.attr "y2", obj.config.dotdotWall
.style "stroke", color
.style "stroke-width", 2
line2 = d3.select ".Timeline"
.append "svg"
.attr "width", length
.attr "height", obj.config.lineHeight
.append "line"
.attr "x1", 0
.attr "y1", 0
.attr "y2", 0
.style "stroke", color
.style "stroke-width", obj.config.lineHeight
.attr "x2", branchCompress
return
###
Utility functions below
###
### Ensure the proper formatting/display of the dates' digits###
twoDigitDate = (input) ->
input = "0 #{input}" if input < 10
return input
### Parses a date in yyyy-mm-dd format###
parseDate = (input) ->
parts = input.match(/(\d+)/g)
new Date(parts[0], parts[1]-1, parts[2])
### Calculates the number of days between two dates###
daySpan = (date1, date2) ->
dif = (date1.getTime() - date2.getTime()) / (24 * 60 * 60 * 1000)
#Making sure the output is a positive round number
days = Math.round Math.abs dif
return days
### Calculating the total number of days the BubbleTime will span over###
totalSpan = (firstDate, lastDate) ->
if parseDate(firsDate) < today
totalSpan = daySpan parseDate(firstDate) , today
else
totalSpan = daySpan parseDate(firstDate) , lastDate
return totalSpan
### Helper function that looks up the value of a variable in an object and if none
is found that returns a default value ###
lookup = (keyVar, obj, defval ) ->
val = defval
if keyVar?
if obj? and typeof obj is "object" and key in obj
val=obj[keyVar]
else val = defval
return val
display = new BubbleTime |
[
{
"context": "ormat \"DD-MM-YYYY H:mm\"\n user1 =\n email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: ",
"end": 628,
"score": 0.999929666519165,
"start": 608,
"tag": "EMAIL",
"value": "dorian@ethylocle.com"
},
{
"context": " email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'",
"end": 651,
"score": 0.999328076839447,
"start": 647,
"tag": "PASSWORD",
"value": "1234"
},
{
"context": "\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: ",
"end": 700,
"score": 0.9999318718910217,
"start": 679,
"tag": "EMAIL",
"value": "maoqiao@ethylocle.com"
},
{
"context": " email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n ",
"end": 723,
"score": 0.9993466138839722,
"start": 719,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dir",
"end": 770,
"score": 0.9999319911003113,
"start": 751,
"tag": "EMAIL",
"value": "robin@ethylocle.com"
},
{
"context": " email: 'robin@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dirname}/../../../db/tmp/u",
"end": 793,
"score": 0.9993317127227783,
"start": 789,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "ormat \"DD-MM-YYYY H:mm\"\n user1 =\n email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: ",
"end": 8289,
"score": 0.9999302625656128,
"start": 8269,
"tag": "EMAIL",
"value": "dorian@ethylocle.com"
},
{
"context": " email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'",
"end": 8312,
"score": 0.9993833899497986,
"start": 8308,
"tag": "PASSWORD",
"value": "1234"
},
{
"context": "\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: ",
"end": 8361,
"score": 0.9999313950538635,
"start": 8340,
"tag": "EMAIL",
"value": "maoqiao@ethylocle.com"
},
{
"context": " email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n ",
"end": 8384,
"score": 0.9994361400604248,
"start": 8380,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n password: '4321'\n user4 =\n email: ",
"end": 8431,
"score": 0.9999295473098755,
"start": 8412,
"tag": "EMAIL",
"value": "robin@ethylocle.com"
},
{
"context": " email: 'robin@ethylocle.com'\n password: '4321'\n user4 =\n email: 'pierre@ethylocle.com'\n",
"end": 8454,
"score": 0.9994183778762817,
"start": 8450,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n password: '4321'\n user4 =\n email: 'pierre@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dir",
"end": 8502,
"score": 0.9999306797981262,
"start": 8482,
"tag": "EMAIL",
"value": "pierre@ethylocle.com"
},
{
"context": " email: 'pierre@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dirname}/../../../db/tmp/u",
"end": 8525,
"score": 0.9993783235549927,
"start": 8521,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "'\n passenger_1: user2.id\n , (err) ->\n ",
"end": 11526,
"score": 0.715705156326294,
"start": 11521,
"tag": "USERNAME",
"value": "user2"
},
{
"context": " passenger_1: user4.id\n , (err) ->\n",
"end": 12372,
"score": 0.9003456830978394,
"start": 12364,
"tag": "USERNAME",
"value": "user4.id"
},
{
"context": "ormat \"DD-MM-YYYY H:mm\"\n user1 =\n email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: ",
"end": 16842,
"score": 0.9999321699142456,
"start": 16822,
"tag": "EMAIL",
"value": "dorian@ethylocle.com"
},
{
"context": " email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'",
"end": 16865,
"score": 0.9993262887001038,
"start": 16861,
"tag": "PASSWORD",
"value": "1234"
},
{
"context": "\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: ",
"end": 16914,
"score": 0.9999331831932068,
"start": 16893,
"tag": "EMAIL",
"value": "maoqiao@ethylocle.com"
},
{
"context": " email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n ",
"end": 16937,
"score": 0.999337375164032,
"start": 16933,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n password: '4321'\n user4 =\n email: ",
"end": 16984,
"score": 0.9999328255653381,
"start": 16965,
"tag": "EMAIL",
"value": "robin@ethylocle.com"
},
{
"context": " email: 'robin@ethylocle.com'\n password: '4321'\n user4 =\n email: 'pierre@ethylocle.com'\n",
"end": 17007,
"score": 0.9994058609008789,
"start": 17003,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n password: '4321'\n user4 =\n email: 'pierre@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dir",
"end": 17055,
"score": 0.9999316334724426,
"start": 17035,
"tag": "EMAIL",
"value": "pierre@ethylocle.com"
},
{
"context": " email: 'pierre@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dirname}/../../../db/tmp/u",
"end": 17078,
"score": 0.9993417859077454,
"start": 17074,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n this.timeout 10000\n user1 =\n email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: ",
"end": 24564,
"score": 0.999933123588562,
"start": 24544,
"tag": "EMAIL",
"value": "dorian@ethylocle.com"
},
{
"context": " email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'",
"end": 24587,
"score": 0.9993420243263245,
"start": 24583,
"tag": "PASSWORD",
"value": "1234"
},
{
"context": "\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: ",
"end": 24636,
"score": 0.9999340176582336,
"start": 24615,
"tag": "EMAIL",
"value": "maoqiao@ethylocle.com"
},
{
"context": " email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n ",
"end": 24659,
"score": 0.9992956519126892,
"start": 24655,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n password: '4321'\n user4 =\n email: ",
"end": 24706,
"score": 0.9999314546585083,
"start": 24687,
"tag": "EMAIL",
"value": "robin@ethylocle.com"
},
{
"context": " email: 'robin@ethylocle.com'\n password: '4321'\n user4 =\n email: 'pierre@ethylocle.com'\n",
"end": 24729,
"score": 0.9992759227752686,
"start": 24725,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n password: '4321'\n user4 =\n email: 'pierre@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dir",
"end": 24777,
"score": 0.9999310374259949,
"start": 24757,
"tag": "EMAIL",
"value": "pierre@ethylocle.com"
},
{
"context": " email: 'pierre@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dirname}/../../../db/tmp/u",
"end": 24800,
"score": 0.9992796182632446,
"start": 24796,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "ormat \"DD-MM-YYYY H:mm\"\n user1 =\n email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: ",
"end": 27183,
"score": 0.9999300837516785,
"start": 27163,
"tag": "EMAIL",
"value": "dorian@ethylocle.com"
},
{
"context": " email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'",
"end": 27206,
"score": 0.9994204044342041,
"start": 27202,
"tag": "PASSWORD",
"value": "1234"
},
{
"context": "\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: ",
"end": 27255,
"score": 0.9999313354492188,
"start": 27234,
"tag": "EMAIL",
"value": "maoqiao@ethylocle.com"
},
{
"context": " email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n ",
"end": 27278,
"score": 0.9994304776191711,
"start": 27274,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n password: '4321'\n user4 =\n email: ",
"end": 27325,
"score": 0.9999299645423889,
"start": 27306,
"tag": "EMAIL",
"value": "robin@ethylocle.com"
},
{
"context": " email: 'robin@ethylocle.com'\n password: '4321'\n user4 =\n email: 'pierre@ethylocle.com'\n",
"end": 27348,
"score": 0.9994311332702637,
"start": 27344,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n password: '4321'\n user4 =\n email: 'pierre@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dir",
"end": 27396,
"score": 0.9999316334724426,
"start": 27376,
"tag": "EMAIL",
"value": "pierre@ethylocle.com"
},
{
"context": " email: 'pierre@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dirname}/../../../db/tmp/u",
"end": 27419,
"score": 0.9994533061981201,
"start": 27415,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": " passenger_1: user2.id\n , (err) ->\n ",
"end": 30420,
"score": 0.559956967830658,
"start": 30419,
"tag": "USERNAME",
"value": "2"
},
{
"context": "ormat \"DD-MM-YYYY H:mm\"\n user1 =\n email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: ",
"end": 35739,
"score": 0.9999334812164307,
"start": 35719,
"tag": "EMAIL",
"value": "dorian@ethylocle.com"
},
{
"context": " email: 'dorian@ethylocle.com'\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'",
"end": 35762,
"score": 0.9993235468864441,
"start": 35758,
"tag": "PASSWORD",
"value": "1234"
},
{
"context": "\n password: '1234'\n user2 =\n email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: ",
"end": 35811,
"score": 0.9999339580535889,
"start": 35790,
"tag": "EMAIL",
"value": "maoqiao@ethylocle.com"
},
{
"context": " email: 'maoqiao@ethylocle.com'\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n ",
"end": 35834,
"score": 0.999302327632904,
"start": 35830,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n password: '4321'\n user3 =\n email: 'robin@ethylocle.com'\n password: '4321'\n user4 =\n email: ",
"end": 35881,
"score": 0.999934196472168,
"start": 35862,
"tag": "EMAIL",
"value": "robin@ethylocle.com"
},
{
"context": " email: 'robin@ethylocle.com'\n password: '4321'\n user4 =\n email: 'pierre@ethylocle.com'\n",
"end": 35904,
"score": 0.9992957711219788,
"start": 35900,
"tag": "PASSWORD",
"value": "4321"
},
{
"context": "\n password: '4321'\n user4 =\n email: 'pierre@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dir",
"end": 35952,
"score": 0.9999334216117859,
"start": 35932,
"tag": "EMAIL",
"value": "pierre@ethylocle.com"
},
{
"context": " email: 'pierre@ethylocle.com'\n password: '4321'\n client1 = db \"#{__dirname}/../../../db/tmp/u",
"end": 35975,
"score": 0.9992974400520325,
"start": 35971,
"tag": "PASSWORD",
"value": "4321"
}
] | lib/model/levelDB/test/rideSearch.coffee | dorianb/Web-application---Ethylocl- | 0 | rimraf = require 'rimraf'
should = require 'should'
db = require '../down'
rideSearch = require '../rideSearch'
geolib = require 'geolib'
moment = require 'moment'
describe 'Ride search', ->
###beforeEach (next) ->
rimraf "#{__dirname}/../../../db/tmp/ridesearch", ->
rimraf "#{__dirname}/../../../db/tmp/ride", ->
rimraf "#{__dirname}/../../../db/tmp/user", next
it 'Insert and get an element in ride search database', (next) ->
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
user1 =
email: 'dorian@ethylocle.com'
password: '1234'
user2 =
email: 'maoqiao@ethylocle.com'
password: '4321'
user3 =
email: 'robin@ethylocle.com'
password: '4321'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: 2
client2.rides.get '1', (err, ride) ->
return next err if err
distanceStart = geolib.getDistance {latitude: body.latStart, longitude: body.lonStart}, {latitude: ride.latStart, longitude: ride.lonStart}
distanceEnd = geolib.getDistance {latitude: body.latEnd, longitude: body.lonEnd}, {latitude: ride.latEnd, longitude: ride.lonEnd}
distanceStart.should.eql 0
distanceEnd.should.eql 0
distance = distanceStart + distanceEnd
distance.should.eql 0
client3 = db "#{__dirname}/../../../db/tmp/ridesearch"
client3.ridesearch.set user3.id, distance, ride.id, (err) ->
return next err if err
client3.ridesearch.get user3.id, distance, ride.id, (err, result) ->
result.distance.should.eql "#{distance}"
client2.rides.get '0', (err, ride) ->
return next err if err
client2.close()
distanceStart = geolib.getDistance {latitude: body.latStart, longitude: body.lonStart}, {latitude: ride.latStart, longitude: ride.lonStart}
distanceEnd = geolib.getDistance {latitude: body.latEnd, longitude: body.lonEnd}, {latitude: ride.latEnd, longitude: ride.lonEnd}
distanceStart.should.eql 338
distanceEnd.should.eql 2371
distance = distanceStart + distanceEnd
distance.should.eql 338+2371
client3.ridesearch.set user3.id, distance, ride.id, (err) ->
return next err if err
client3.ridesearch.get user3.id, distance, ride.id, (err, result) ->
result.distance.should.eql "#{distance}"
client3.close()
next()
it 'Get the best ride thanks to the ride search engine', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: 'dorian@ethylocle.com'
password: '1234'
user2 =
email: 'maoqiao@ethylocle.com'
password: '4321'
user3 =
email: 'robin@ethylocle.com'
password: '4321'
user4 =
email: 'pierre@ethylocle.com'
password: '4321'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", 2, body, (err, rides) ->
should.not.exists err
rides.length.should.eql 3
for k, v of rides
console.log v
next()
it 'Test the ride search engine without entry values', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: 'dorian@ethylocle.com'
password: '1234'
user2 =
email: 'maoqiao@ethylocle.com'
password: '4321'
user3 =
email: 'robin@ethylocle.com'
password: '4321'
user4 =
email: 'pierre@ethylocle.com'
password: '4321'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
rideSearch "#{__dirname}/../../../db/tmp", '2', {}, (err, rides) ->
should.not.exists err
rides.should.eql []
next()
it 'Test the ride search engine without rides', (next) ->
this.timeout 10000
user1 =
email: 'dorian@ethylocle.com'
password: '1234'
user2 =
email: 'maoqiao@ethylocle.com'
password: '4321'
user3 =
email: 'robin@ethylocle.com'
password: '4321'
user4 =
email: 'pierre@ethylocle.com'
password: '4321'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", '2', body, (err, rides) ->
should.not.exists err
rides.should.eql []
next()
it 'Test the ride search engine with an out of date ride', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: 'dorian@ethylocle.com'
password: '1234'
user2 =
email: 'maoqiao@ethylocle.com'
password: '4321'
user3 =
email: 'robin@ethylocle.com'
password: '4321'
user4 =
email: 'pierre@ethylocle.com'
password: '4321'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(35, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", 2, body, (err, rides) ->
should.not.exists err
rides.length.should.eql 2
for k, v of rides
console.log v
next()
it 'Test the ride search engine with an overloaded ride', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: 'dorian@ethylocle.com'
password: '1234'
user2 =
email: 'maoqiao@ethylocle.com'
password: '4321'
user3 =
email: 'robin@ethylocle.com'
password: '4321'
user4 =
email: 'pierre@ethylocle.com'
password: '4321'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '3'
passenger_1: user2.id
passenger_2: user2.id
passenger_3: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '3'
ride.passenger_1.should.eql '1'
ride.passenger_2.should.eql '1'
ride.passenger_3.should.eql '1'
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", '2', body, (err, rides) ->
should.not.exists err
rides.length.should.eql 2
next()###
| 147613 | rimraf = require 'rimraf'
should = require 'should'
db = require '../down'
rideSearch = require '../rideSearch'
geolib = require 'geolib'
moment = require 'moment'
describe 'Ride search', ->
###beforeEach (next) ->
rimraf "#{__dirname}/../../../db/tmp/ridesearch", ->
rimraf "#{__dirname}/../../../db/tmp/ride", ->
rimraf "#{__dirname}/../../../db/tmp/user", next
it 'Insert and get an element in ride search database', (next) ->
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
user1 =
email: '<EMAIL>'
password: '<PASSWORD>'
user2 =
email: '<EMAIL>'
password: '<PASSWORD>'
user3 =
email: '<EMAIL>'
password: '<PASSWORD>'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: 2
client2.rides.get '1', (err, ride) ->
return next err if err
distanceStart = geolib.getDistance {latitude: body.latStart, longitude: body.lonStart}, {latitude: ride.latStart, longitude: ride.lonStart}
distanceEnd = geolib.getDistance {latitude: body.latEnd, longitude: body.lonEnd}, {latitude: ride.latEnd, longitude: ride.lonEnd}
distanceStart.should.eql 0
distanceEnd.should.eql 0
distance = distanceStart + distanceEnd
distance.should.eql 0
client3 = db "#{__dirname}/../../../db/tmp/ridesearch"
client3.ridesearch.set user3.id, distance, ride.id, (err) ->
return next err if err
client3.ridesearch.get user3.id, distance, ride.id, (err, result) ->
result.distance.should.eql "#{distance}"
client2.rides.get '0', (err, ride) ->
return next err if err
client2.close()
distanceStart = geolib.getDistance {latitude: body.latStart, longitude: body.lonStart}, {latitude: ride.latStart, longitude: ride.lonStart}
distanceEnd = geolib.getDistance {latitude: body.latEnd, longitude: body.lonEnd}, {latitude: ride.latEnd, longitude: ride.lonEnd}
distanceStart.should.eql 338
distanceEnd.should.eql 2371
distance = distanceStart + distanceEnd
distance.should.eql 338+2371
client3.ridesearch.set user3.id, distance, ride.id, (err) ->
return next err if err
client3.ridesearch.get user3.id, distance, ride.id, (err, result) ->
result.distance.should.eql "#{distance}"
client3.close()
next()
it 'Get the best ride thanks to the ride search engine', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: '<EMAIL>'
password: '<PASSWORD>'
user2 =
email: '<EMAIL>'
password: '<PASSWORD>'
user3 =
email: '<EMAIL>'
password: '<PASSWORD>'
user4 =
email: '<EMAIL>'
password: '<PASSWORD>'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", 2, body, (err, rides) ->
should.not.exists err
rides.length.should.eql 3
for k, v of rides
console.log v
next()
it 'Test the ride search engine without entry values', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: '<EMAIL>'
password: '<PASSWORD>'
user2 =
email: '<EMAIL>'
password: '<PASSWORD>'
user3 =
email: '<EMAIL>'
password: '<PASSWORD>'
user4 =
email: '<EMAIL>'
password: '<PASSWORD>'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
rideSearch "#{__dirname}/../../../db/tmp", '2', {}, (err, rides) ->
should.not.exists err
rides.should.eql []
next()
it 'Test the ride search engine without rides', (next) ->
this.timeout 10000
user1 =
email: '<EMAIL>'
password: '<PASSWORD>'
user2 =
email: '<EMAIL>'
password: '<PASSWORD>'
user3 =
email: '<EMAIL>'
password: '<PASSWORD>'
user4 =
email: '<EMAIL>'
password: '<PASSWORD>'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", '2', body, (err, rides) ->
should.not.exists err
rides.should.eql []
next()
it 'Test the ride search engine with an out of date ride', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: '<EMAIL>'
password: '<PASSWORD>'
user2 =
email: '<EMAIL>'
password: '<PASSWORD>'
user3 =
email: '<EMAIL>'
password: '<PASSWORD>'
user4 =
email: '<EMAIL>'
password: '<PASSWORD>'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(35, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", 2, body, (err, rides) ->
should.not.exists err
rides.length.should.eql 2
for k, v of rides
console.log v
next()
it 'Test the ride search engine with an overloaded ride', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: '<EMAIL>'
password: '<PASSWORD>'
user2 =
email: '<EMAIL>'
password: '<PASSWORD>'
user3 =
email: '<EMAIL>'
password: '<PASSWORD>'
user4 =
email: '<EMAIL>'
password: '<PASSWORD>'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '3'
passenger_1: user2.id
passenger_2: user2.id
passenger_3: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '3'
ride.passenger_1.should.eql '1'
ride.passenger_2.should.eql '1'
ride.passenger_3.should.eql '1'
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", '2', body, (err, rides) ->
should.not.exists err
rides.length.should.eql 2
next()###
| true | rimraf = require 'rimraf'
should = require 'should'
db = require '../down'
rideSearch = require '../rideSearch'
geolib = require 'geolib'
moment = require 'moment'
describe 'Ride search', ->
###beforeEach (next) ->
rimraf "#{__dirname}/../../../db/tmp/ridesearch", ->
rimraf "#{__dirname}/../../../db/tmp/ride", ->
rimraf "#{__dirname}/../../../db/tmp/user", next
it 'Insert and get an element in ride search database', (next) ->
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
user1 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user2 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user3 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: 2
client2.rides.get '1', (err, ride) ->
return next err if err
distanceStart = geolib.getDistance {latitude: body.latStart, longitude: body.lonStart}, {latitude: ride.latStart, longitude: ride.lonStart}
distanceEnd = geolib.getDistance {latitude: body.latEnd, longitude: body.lonEnd}, {latitude: ride.latEnd, longitude: ride.lonEnd}
distanceStart.should.eql 0
distanceEnd.should.eql 0
distance = distanceStart + distanceEnd
distance.should.eql 0
client3 = db "#{__dirname}/../../../db/tmp/ridesearch"
client3.ridesearch.set user3.id, distance, ride.id, (err) ->
return next err if err
client3.ridesearch.get user3.id, distance, ride.id, (err, result) ->
result.distance.should.eql "#{distance}"
client2.rides.get '0', (err, ride) ->
return next err if err
client2.close()
distanceStart = geolib.getDistance {latitude: body.latStart, longitude: body.lonStart}, {latitude: ride.latStart, longitude: ride.lonStart}
distanceEnd = geolib.getDistance {latitude: body.latEnd, longitude: body.lonEnd}, {latitude: ride.latEnd, longitude: ride.lonEnd}
distanceStart.should.eql 338
distanceEnd.should.eql 2371
distance = distanceStart + distanceEnd
distance.should.eql 338+2371
client3.ridesearch.set user3.id, distance, ride.id, (err) ->
return next err if err
client3.ridesearch.get user3.id, distance, ride.id, (err, result) ->
result.distance.should.eql "#{distance}"
client3.close()
next()
it 'Get the best ride thanks to the ride search engine', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user2 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user3 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user4 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", 2, body, (err, rides) ->
should.not.exists err
rides.length.should.eql 3
for k, v of rides
console.log v
next()
it 'Test the ride search engine without entry values', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user2 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user3 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user4 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
rideSearch "#{__dirname}/../../../db/tmp", '2', {}, (err, rides) ->
should.not.exists err
rides.should.eql []
next()
it 'Test the ride search engine without rides', (next) ->
this.timeout 10000
user1 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user2 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user3 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user4 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", '2', body, (err, rides) ->
should.not.exists err
rides.should.eql []
next()
it 'Test the ride search engine with an out of date ride', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user2 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user3 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user4 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '1'
passenger_1: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '1'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(35, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", 2, body, (err, rides) ->
should.not.exists err
rides.length.should.eql 2
for k, v of rides
console.log v
next()
it 'Test the ride search engine with an overloaded ride', (next) ->
this.timeout 10000
dateTime1 = moment().add(30, 'm').format "DD-MM-YYYY H:mm"
dateTime2 = moment().add(1, 'h').format "DD-MM-YYYY H:mm"
dateTime3 = moment().add(90, 'm').format "DD-MM-YYYY H:mm"
user1 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user2 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user3 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
user4 =
email: 'PI:EMAIL:<EMAIL>END_PI'
password: 'PI:PASSWORD:<PASSWORD>END_PI'
client1 = db "#{__dirname}/../../../db/tmp/user"
client1.users.getMaxId (err, maxId) ->
return next err if err
user1.id = ++maxId
client1.users.set user1.id, user1, (err) ->
return next err if err
client1.users.setByEmail user1.email, user1, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user2.id = ++maxId
client1.users.set user2.id, user2, (err) ->
return next err if err
client1.users.setByEmail user2.email, user2, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user3.id = ++maxId
client1.users.set user3.id, user3, (err) ->
return next err if err
client1.users.setByEmail user3.email, user3, (err) ->
return next err if err
client1.users.getMaxId (err, maxId) ->
return next err if err
user4.id = ++maxId
client1.users.set user4.id, user4, (err) ->
return next err if err
client1.users.setByEmail user4.email, user4, (err) ->
return next err if err
client1.close()
client2 = db "#{__dirname}/../../../db/tmp/ride"
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '-1'
client2.rides.set ++maxId,
latStart: '48.853611'
lonStart: '2.287546'
latEnd: '48.860359'
lonEnd: '2.352949'
dateTime: dateTime1
price: '30'
numberOfPassenger: '2'
passenger_1: user1.id
passenger_2: user1.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '0'
client2.rides.set ++maxId,
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: dateTime2
price: '17'
numberOfPassenger: '3'
passenger_1: user2.id
passenger_2: user2.id
passenger_3: user2.id
, (err) ->
return next err if err
client2.rides.getMaxId (err, maxId) ->
return next err if err
maxId.should.eql '1'
client2.rides.set ++maxId,
latStart: '48.857460'
lonStart: '2.291070'
latEnd: '48.867158'
lonEnd: '2.313901'
dateTime: dateTime3
price: '17'
numberOfPassenger: '1'
passenger_1: user4.id
, (err) ->
return next err if err
client2.rides.get '0', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.853611'
ride.lonStart.should.eql '2.287546'
ride.latEnd.should.eql '48.860359'
ride.lonEnd.should.eql '2.352949'
ride.dateTime.should.eql dateTime1
ride.price.should.eql '30'
ride.numberOfPassenger.should.eql '2'
ride.passenger_1.should.eql '0'
ride.passenger_2.should.eql '0'
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.rides.get '1', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.856470'
ride.lonStart.should.eql '2.286001'
ride.latEnd.should.eql '48.865314'
ride.lonEnd.should.eql '2.321514'
ride.dateTime.should.eql dateTime2
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '3'
ride.passenger_1.should.eql '1'
ride.passenger_2.should.eql '1'
ride.passenger_3.should.eql '1'
should.not.exists ride.passenger_4
client2.rides.get '2', (err, ride) ->
return next err if err
ride.latStart.should.eql '48.857460'
ride.lonStart.should.eql '2.291070'
ride.latEnd.should.eql '48.867158'
ride.lonEnd.should.eql '2.313901'
ride.dateTime.should.eql dateTime3
ride.price.should.eql '17'
ride.numberOfPassenger.should.eql '1'
ride.passenger_1.should.eql '3'
should.not.exists ride.passenger_2
should.not.exists ride.passenger_3
should.not.exists ride.passenger_4
client2.close()
body =
latStart: '48.856470'
lonStart: '2.286001'
latEnd: '48.865314'
lonEnd: '2.321514'
dateTime: moment().add(25, 'm').format "DD-MM-YYYY H:mm"
numberOfPeople: '2'
rideSearch "#{__dirname}/../../../db/tmp", '2', body, (err, rides) ->
should.not.exists err
rides.length.should.eql 2
next()###
|
[
{
"context": " 'metafields7':\n id: 7\n key: 'Product metafield 2.1'\n subject_type: 'product'\n subject:\n ",
"end": 967,
"score": 0.7902933955192566,
"start": 954,
"tag": "KEY",
"value": "metafield 2.1"
}
] | tests/batman/model/associations/polymorphic_association_helper.coffee | davidcornu/batman | 0 | {createStorageAdapter, TestStorageAdapter, AsyncTestStorageAdapter, generateSorterOnProperty} = window
ex = window.PolymorphicAssociationHelpers = {}
ex.baseSetup = ->
namespace = @namespace = {}
namespace.Metafield = class @Metafield extends Batman.Model
@belongsTo 'subject', {polymorphic: true, namespace}
@encode 'id', 'key'
@metafieldAdapter = createStorageAdapter @Metafield, AsyncTestStorageAdapter,
'metafields1':
id: 1
subject_id: 1
subject_type: 'store'
key: 'Store metafield'
'metafields2':
id: 2
subject_id: 1
subject_type: 'product'
key: 'Product metafield'
'metafields3':
id: 3
subject_id: 1
subject_type: 'store'
key: 'Store metafield 2'
'metafields4':
id: 4
key: 'Product metafield 2'
subject_type: 'product'
subject:
name: "Product 5"
id: 5
'metafields7':
id: 7
key: 'Product metafield 2.1'
subject_type: 'product'
subject:
name: "Product 5"
id: 5
'metafields20':
id: 20
key: "SEO Title"
'metafields30':
id: 30
key: "SEO Title"
namespace.StringyMetafield = class @StringyMetafield extends Batman.Model
@belongsTo 'stringySubject', {polymorphic: true, namespace}
@encode 'id' # ids are integer-y strings, eg "1", "2", "3"...
@encode 'key'
@stringyMetafieldAdapter = createStorageAdapter @StringyMetafield, AsyncTestStorageAdapter,
stringyMetafields1:
id: "1"
stringySubject_id: 1
stringySubject_type: 'store'
key: 'Stringy store metafield'
stringyMetafields2:
id: "2"
stringySubject_id: 1
stringySubject_type: 'store'
key: 'Another Stringy store metafield'
namespace.Store = class @Store extends Batman.Model
@encode 'id', 'name'
@hasMany 'metafields', {as: 'subject', namespace, saveInline: true}
@hasMany 'stringyMetafields', {as: 'stringySubject', namespace, saveInline: true}
@storeAdapter = createStorageAdapter @Store, AsyncTestStorageAdapter,
'stores1':
name: "Store One"
id: 1
'stores2':
name: "Store Two"
id: 2
metafields: [{
id: 5
key: "SEO Title"
}]
'stores4':
name: "Store Four"
id: 4
namespace.Product = class @Product extends Batman.Model
@encode 'id', 'name'
@hasMany 'metafields', {as: 'subject', namespace, saveInline: true}
@productAdapter = createStorageAdapter @Product, AsyncTestStorageAdapter,
'products1':
name: "Product One"
id: 1
store_id: 1
'products4':
name: "Product One"
id: 1
metafields: [{
id: 6
key: "SEO Title"
}]
'products5':
name: "Product 5"
id: 5
'products6':
name: "Product Six"
id: 6
metafields: [{
id: 20
key: "SEO Title"
},{
id: 30
key: "SEO Handle"
}]
| 187944 | {createStorageAdapter, TestStorageAdapter, AsyncTestStorageAdapter, generateSorterOnProperty} = window
ex = window.PolymorphicAssociationHelpers = {}
ex.baseSetup = ->
namespace = @namespace = {}
namespace.Metafield = class @Metafield extends Batman.Model
@belongsTo 'subject', {polymorphic: true, namespace}
@encode 'id', 'key'
@metafieldAdapter = createStorageAdapter @Metafield, AsyncTestStorageAdapter,
'metafields1':
id: 1
subject_id: 1
subject_type: 'store'
key: 'Store metafield'
'metafields2':
id: 2
subject_id: 1
subject_type: 'product'
key: 'Product metafield'
'metafields3':
id: 3
subject_id: 1
subject_type: 'store'
key: 'Store metafield 2'
'metafields4':
id: 4
key: 'Product metafield 2'
subject_type: 'product'
subject:
name: "Product 5"
id: 5
'metafields7':
id: 7
key: 'Product <KEY>'
subject_type: 'product'
subject:
name: "Product 5"
id: 5
'metafields20':
id: 20
key: "SEO Title"
'metafields30':
id: 30
key: "SEO Title"
namespace.StringyMetafield = class @StringyMetafield extends Batman.Model
@belongsTo 'stringySubject', {polymorphic: true, namespace}
@encode 'id' # ids are integer-y strings, eg "1", "2", "3"...
@encode 'key'
@stringyMetafieldAdapter = createStorageAdapter @StringyMetafield, AsyncTestStorageAdapter,
stringyMetafields1:
id: "1"
stringySubject_id: 1
stringySubject_type: 'store'
key: 'Stringy store metafield'
stringyMetafields2:
id: "2"
stringySubject_id: 1
stringySubject_type: 'store'
key: 'Another Stringy store metafield'
namespace.Store = class @Store extends Batman.Model
@encode 'id', 'name'
@hasMany 'metafields', {as: 'subject', namespace, saveInline: true}
@hasMany 'stringyMetafields', {as: 'stringySubject', namespace, saveInline: true}
@storeAdapter = createStorageAdapter @Store, AsyncTestStorageAdapter,
'stores1':
name: "Store One"
id: 1
'stores2':
name: "Store Two"
id: 2
metafields: [{
id: 5
key: "SEO Title"
}]
'stores4':
name: "Store Four"
id: 4
namespace.Product = class @Product extends Batman.Model
@encode 'id', 'name'
@hasMany 'metafields', {as: 'subject', namespace, saveInline: true}
@productAdapter = createStorageAdapter @Product, AsyncTestStorageAdapter,
'products1':
name: "Product One"
id: 1
store_id: 1
'products4':
name: "Product One"
id: 1
metafields: [{
id: 6
key: "SEO Title"
}]
'products5':
name: "Product 5"
id: 5
'products6':
name: "Product Six"
id: 6
metafields: [{
id: 20
key: "SEO Title"
},{
id: 30
key: "SEO Handle"
}]
| true | {createStorageAdapter, TestStorageAdapter, AsyncTestStorageAdapter, generateSorterOnProperty} = window
ex = window.PolymorphicAssociationHelpers = {}
ex.baseSetup = ->
namespace = @namespace = {}
namespace.Metafield = class @Metafield extends Batman.Model
@belongsTo 'subject', {polymorphic: true, namespace}
@encode 'id', 'key'
@metafieldAdapter = createStorageAdapter @Metafield, AsyncTestStorageAdapter,
'metafields1':
id: 1
subject_id: 1
subject_type: 'store'
key: 'Store metafield'
'metafields2':
id: 2
subject_id: 1
subject_type: 'product'
key: 'Product metafield'
'metafields3':
id: 3
subject_id: 1
subject_type: 'store'
key: 'Store metafield 2'
'metafields4':
id: 4
key: 'Product metafield 2'
subject_type: 'product'
subject:
name: "Product 5"
id: 5
'metafields7':
id: 7
key: 'Product PI:KEY:<KEY>END_PI'
subject_type: 'product'
subject:
name: "Product 5"
id: 5
'metafields20':
id: 20
key: "SEO Title"
'metafields30':
id: 30
key: "SEO Title"
namespace.StringyMetafield = class @StringyMetafield extends Batman.Model
@belongsTo 'stringySubject', {polymorphic: true, namespace}
@encode 'id' # ids are integer-y strings, eg "1", "2", "3"...
@encode 'key'
@stringyMetafieldAdapter = createStorageAdapter @StringyMetafield, AsyncTestStorageAdapter,
stringyMetafields1:
id: "1"
stringySubject_id: 1
stringySubject_type: 'store'
key: 'Stringy store metafield'
stringyMetafields2:
id: "2"
stringySubject_id: 1
stringySubject_type: 'store'
key: 'Another Stringy store metafield'
namespace.Store = class @Store extends Batman.Model
@encode 'id', 'name'
@hasMany 'metafields', {as: 'subject', namespace, saveInline: true}
@hasMany 'stringyMetafields', {as: 'stringySubject', namespace, saveInline: true}
@storeAdapter = createStorageAdapter @Store, AsyncTestStorageAdapter,
'stores1':
name: "Store One"
id: 1
'stores2':
name: "Store Two"
id: 2
metafields: [{
id: 5
key: "SEO Title"
}]
'stores4':
name: "Store Four"
id: 4
namespace.Product = class @Product extends Batman.Model
@encode 'id', 'name'
@hasMany 'metafields', {as: 'subject', namespace, saveInline: true}
@productAdapter = createStorageAdapter @Product, AsyncTestStorageAdapter,
'products1':
name: "Product One"
id: 1
store_id: 1
'products4':
name: "Product One"
id: 1
metafields: [{
id: 6
key: "SEO Title"
}]
'products5':
name: "Product 5"
id: 5
'products6':
name: "Product Six"
id: 6
metafields: [{
id: 20
key: "SEO Title"
},{
id: 30
key: "SEO Handle"
}]
|
[
{
"context": "ou are less likely to use teleports.\n *\n * @name Teleshy\n * @prerequisite Teleport 50 times\n * @effect -",
"end": 143,
"score": 0.9792166352272034,
"start": 136,
"tag": "NAME",
"value": "Teleshy"
}
] | src/character/personalities/Teleshy.coffee | sadbear-/IdleLands | 3 |
Personality = require "../base/Personality"
`/**
* This personality makes it so you are less likely to use teleports.
*
* @name Teleshy
* @prerequisite Teleport 50 times
* @effect -99% chance to use a teleport
* @category Personalities
* @package Player
*/`
class Teleshy extends Personality
constructor: ->
teleportChance: -> -99
@canUse = (player) ->
player.statistics["explore transfer teleport"] >= 50
@desc = "Step through 50 portals"
module.exports = exports = Teleshy | 112479 |
Personality = require "../base/Personality"
`/**
* This personality makes it so you are less likely to use teleports.
*
* @name <NAME>
* @prerequisite Teleport 50 times
* @effect -99% chance to use a teleport
* @category Personalities
* @package Player
*/`
class Teleshy extends Personality
constructor: ->
teleportChance: -> -99
@canUse = (player) ->
player.statistics["explore transfer teleport"] >= 50
@desc = "Step through 50 portals"
module.exports = exports = Teleshy | true |
Personality = require "../base/Personality"
`/**
* This personality makes it so you are less likely to use teleports.
*
* @name PI:NAME:<NAME>END_PI
* @prerequisite Teleport 50 times
* @effect -99% chance to use a teleport
* @category Personalities
* @package Player
*/`
class Teleshy extends Personality
constructor: ->
teleportChance: -> -99
@canUse = (player) ->
player.statistics["explore transfer teleport"] >= 50
@desc = "Step through 50 portals"
module.exports = exports = Teleshy |
[
{
"context": "ttle Mocha Reference ========\r\nhttps://github.com/visionmedia/should.js\r\nhttps://github.com/visionmedia/mocha\r\n",
"end": 297,
"score": 0.9994474649429321,
"start": 286,
"tag": "USERNAME",
"value": "visionmedia"
},
{
"context": "hub.com/visionmedia/should.js\r\nhttps://github.com/visionmedia/mocha\r\n\r\nMocha hooks:\r\n before ()-> # before des",
"end": 339,
"score": 0.9994103908538818,
"start": 328,
"tag": "USERNAME",
"value": "visionmedia"
},
{
"context": " 'foo bar baz'.should.include('foo')\r\n { name: 'TJ', pet: tobi }.user.should.include({ pet: tobi, na",
"end": 1315,
"score": 0.6113772988319397,
"start": 1313,
"tag": "NAME",
"value": "TJ"
},
{
"context": ".should.be.a('object').and.have.property('name', 'tj')\r\n###\r\n\r\ndescribe 'gas-manager', ()->\r\n\r\n\r\n\r\n i",
"end": 1627,
"score": 0.5217217803001404,
"start": 1625,
"tag": "USERNAME",
"value": "tj"
},
{
"context": " files :[\r\n {\r\n name : \"test\"\r\n type : \"server_js\"\r\n ",
"end": 4963,
"score": 0.9753511548042297,
"start": 4959,
"tag": "NAME",
"value": "test"
}
] | src/test/gas-manager_test.coffee | unau/gas-minus-minus | 1 | 'use strict'
gas_manager = require('../lib/gas-manager.js')
readline = require 'readline'
open = require 'open'
fs = require 'fs'
FILE_ID = "1jdu8QQcKZ5glzOaJnofi2At2Q-2PnLLKxptN0CTRVfgfz9ZIopD5sYXz"
###
======== A Handy Little Mocha Reference ========
https://github.com/visionmedia/should.js
https://github.com/visionmedia/mocha
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')
###
describe 'gas-manager', ()->
it "should have Manager property ",()->
gas_manager.should.have.property('Manager')
@
describe '.Manager class', ()->
Manager = null
scriptManager = null
before ()->
Manager = gas_manager.Manager
@
it 'should be a function', ()->
Manager.should.be.a('function')
@
describe '.constructor',()->
options = null
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
@
it 'should be a constructor', ()->
scriptManager.should.be.a('object')
@
it 'should be throw error, if does not set options' , ()->
(()-> new Manager).should.throwError("should set options")
@
it 'should have tokenProvider propety ',()->
scriptManager.should.have.property('tokenProvider')
@
it 'should have option', ()->
scriptManager.should.have.property('options' , options)
@
describe '.getProject', ()->
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
@
it 'should get project', (done)->
scriptManager.getProject(FILE_ID
,(err, project)->
return done(err) if err
project.should.be.a('object')
project.should.have.property 'origin'
done()
)
@
it 'should call error , if does not exist',(done)->
scriptManager.getProject("a",(err, project)->
return done() if err
done("should throw error")
)
describe '.upload',()->
project = null
before (done)->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
scriptManager.getProject FILE_ID, (err, p)->
return done(err) if err
project = p
done()
@
it 'should upload project', (done)->
now = new Date()
project.getFiles()[0].source = project.getFiles()[0].source + "\n//test" + now
scriptManager.upload(FILE_ID, project.origin
,(err, p, response)->
return done(throw new Error(err)) if err
scriptManager.getProject(FILE_ID, (err, p)->
return done(err) if err
p.getFiles()[0].source.should.match(/\/\/test/)
done()
)
)
@
describe '.createProject', ()->
project = null
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
project = scriptManager.createProject 'test'
@
it "should be GASProject", ()->
project.should.have.property "filename"
project.filename.should.eql "test"
@
describe '.createNewProject', ()->
fileId = null
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
@
it "should create new gas project",(done)->
scriptManager.createNewProject "test-test" , {
files :[
{
name : "test"
type : "server_js"
source : "function a(){ Logger.log('a');}"
}
]
},
(err, project)->
return done(err) if err
project.filename.should.eql "test-test"
fileId = project.fileId
done()
@
after (done)->
scriptManager.deleteProject(fileId
,(err)->
return done(err) if err
done()
)
@
| 76599 | 'use strict'
gas_manager = require('../lib/gas-manager.js')
readline = require 'readline'
open = require 'open'
fs = require 'fs'
FILE_ID = "1jdu8QQcKZ5glzOaJnofi2At2Q-2PnLLKxptN0CTRVfgfz9ZIopD5sYXz"
###
======== A Handy Little Mocha Reference ========
https://github.com/visionmedia/should.js
https://github.com/visionmedia/mocha
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: 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')
###
describe 'gas-manager', ()->
it "should have Manager property ",()->
gas_manager.should.have.property('Manager')
@
describe '.Manager class', ()->
Manager = null
scriptManager = null
before ()->
Manager = gas_manager.Manager
@
it 'should be a function', ()->
Manager.should.be.a('function')
@
describe '.constructor',()->
options = null
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
@
it 'should be a constructor', ()->
scriptManager.should.be.a('object')
@
it 'should be throw error, if does not set options' , ()->
(()-> new Manager).should.throwError("should set options")
@
it 'should have tokenProvider propety ',()->
scriptManager.should.have.property('tokenProvider')
@
it 'should have option', ()->
scriptManager.should.have.property('options' , options)
@
describe '.getProject', ()->
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
@
it 'should get project', (done)->
scriptManager.getProject(FILE_ID
,(err, project)->
return done(err) if err
project.should.be.a('object')
project.should.have.property 'origin'
done()
)
@
it 'should call error , if does not exist',(done)->
scriptManager.getProject("a",(err, project)->
return done() if err
done("should throw error")
)
describe '.upload',()->
project = null
before (done)->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
scriptManager.getProject FILE_ID, (err, p)->
return done(err) if err
project = p
done()
@
it 'should upload project', (done)->
now = new Date()
project.getFiles()[0].source = project.getFiles()[0].source + "\n//test" + now
scriptManager.upload(FILE_ID, project.origin
,(err, p, response)->
return done(throw new Error(err)) if err
scriptManager.getProject(FILE_ID, (err, p)->
return done(err) if err
p.getFiles()[0].source.should.match(/\/\/test/)
done()
)
)
@
describe '.createProject', ()->
project = null
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
project = scriptManager.createProject 'test'
@
it "should be GASProject", ()->
project.should.have.property "filename"
project.filename.should.eql "test"
@
describe '.createNewProject', ()->
fileId = null
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
@
it "should create new gas project",(done)->
scriptManager.createNewProject "test-test" , {
files :[
{
name : "<NAME>"
type : "server_js"
source : "function a(){ Logger.log('a');}"
}
]
},
(err, project)->
return done(err) if err
project.filename.should.eql "test-test"
fileId = project.fileId
done()
@
after (done)->
scriptManager.deleteProject(fileId
,(err)->
return done(err) if err
done()
)
@
| true | 'use strict'
gas_manager = require('../lib/gas-manager.js')
readline = require 'readline'
open = require 'open'
fs = require 'fs'
FILE_ID = "1jdu8QQcKZ5glzOaJnofi2At2Q-2PnLLKxptN0CTRVfgfz9ZIopD5sYXz"
###
======== A Handy Little Mocha Reference ========
https://github.com/visionmedia/should.js
https://github.com/visionmedia/mocha
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: 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')
###
describe 'gas-manager', ()->
it "should have Manager property ",()->
gas_manager.should.have.property('Manager')
@
describe '.Manager class', ()->
Manager = null
scriptManager = null
before ()->
Manager = gas_manager.Manager
@
it 'should be a function', ()->
Manager.should.be.a('function')
@
describe '.constructor',()->
options = null
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
@
it 'should be a constructor', ()->
scriptManager.should.be.a('object')
@
it 'should be throw error, if does not set options' , ()->
(()-> new Manager).should.throwError("should set options")
@
it 'should have tokenProvider propety ',()->
scriptManager.should.have.property('tokenProvider')
@
it 'should have option', ()->
scriptManager.should.have.property('options' , options)
@
describe '.getProject', ()->
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
@
it 'should get project', (done)->
scriptManager.getProject(FILE_ID
,(err, project)->
return done(err) if err
project.should.be.a('object')
project.should.have.property 'origin'
done()
)
@
it 'should call error , if does not exist',(done)->
scriptManager.getProject("a",(err, project)->
return done() if err
done("should throw error")
)
describe '.upload',()->
project = null
before (done)->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
scriptManager.getProject FILE_ID, (err, p)->
return done(err) if err
project = p
done()
@
it 'should upload project', (done)->
now = new Date()
project.getFiles()[0].source = project.getFiles()[0].source + "\n//test" + now
scriptManager.upload(FILE_ID, project.origin
,(err, p, response)->
return done(throw new Error(err)) if err
scriptManager.getProject(FILE_ID, (err, p)->
return done(err) if err
p.getFiles()[0].source.should.match(/\/\/test/)
done()
)
)
@
describe '.createProject', ()->
project = null
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
project = scriptManager.createProject 'test'
@
it "should be GASProject", ()->
project.should.have.property "filename"
project.filename.should.eql "test"
@
describe '.createNewProject', ()->
fileId = null
before ()->
options = JSON.parse fs.readFileSync "./tmp/test.json"
scriptManager = new Manager options
@
it "should create new gas project",(done)->
scriptManager.createNewProject "test-test" , {
files :[
{
name : "PI:NAME:<NAME>END_PI"
type : "server_js"
source : "function a(){ Logger.log('a');}"
}
]
},
(err, project)->
return done(err) if err
project.filename.should.eql "test-test"
fileId = project.fileId
done()
@
after (done)->
scriptManager.deleteProject(fileId
,(err)->
return done(err) if err
done()
)
@
|
[
{
"context": "================\n#\n# Generic Utilities\n#\n# @author Matthew Wagerfield @mwagerfield\n#\n#=================================",
"end": 118,
"score": 0.9998781085014343,
"start": 100,
"tag": "NAME",
"value": "Matthew Wagerfield"
},
{
"context": "# Generic Utilities\n#\n# @author Matthew Wagerfield @mwagerfield\n#\n#==============================================",
"end": 131,
"score": 0.9986079335212708,
"start": 119,
"tag": "USERNAME",
"value": "@mwagerfield"
}
] | assets/scripts/coffee/core/Utils.coffee | wagerfield/danbo | 1 | ###
#============================================================
#
# Generic Utilities
#
# @author Matthew Wagerfield @mwagerfield
#
#============================================================
###
class Utils
###
# Generates a GUID.
# @param {number} length The length of the guid.
# @param {string} prefix String to prefix the GUID with.
# @return {string} The generated GUID.
###
@guid = (length = 8, prefix = 'mw') ->
guid = ((Math.random().toFixed 1).substr 2 for i in [0...length])
guid = "#{prefix}#{guid.join ''}"
return guid
| 104141 | ###
#============================================================
#
# Generic Utilities
#
# @author <NAME> @mwagerfield
#
#============================================================
###
class Utils
###
# Generates a GUID.
# @param {number} length The length of the guid.
# @param {string} prefix String to prefix the GUID with.
# @return {string} The generated GUID.
###
@guid = (length = 8, prefix = 'mw') ->
guid = ((Math.random().toFixed 1).substr 2 for i in [0...length])
guid = "#{prefix}#{guid.join ''}"
return guid
| true | ###
#============================================================
#
# Generic Utilities
#
# @author PI:NAME:<NAME>END_PI @mwagerfield
#
#============================================================
###
class Utils
###
# Generates a GUID.
# @param {number} length The length of the guid.
# @param {string} prefix String to prefix the GUID with.
# @return {string} The generated GUID.
###
@guid = (length = 8, prefix = 'mw') ->
guid = ((Math.random().toFixed 1).substr 2 for i in [0...length])
guid = "#{prefix}#{guid.join ''}"
return guid
|
[
{
"context": "ader: (key, val = undefined) ->\n key = key.toLowerCase()\n if @req.headers[key] then @req.headers[",
"end": 2174,
"score": 0.8231669664382935,
"start": 2163,
"tag": "KEY",
"value": "toLowerCase"
}
] | src/request.coffee | SegmentFault/node-tiny-http | 16 | Form = require 'formidable'
Url = require 'url'
Cookie = require 'cookie'
QueryString = require 'querystring'
class Request
mergeParams = (source, target) ->
for k, v of target
source[k] = v
constructor: (@req, @options, cb) ->
parts = Url.parse @req.url, yes
@method = @req.method.toUpperCase()
@uri = parts.href
@path = if parts.pathname? then parts.pathname else '/'
@port = @req.socket.remotePort
@agent = @header 'user-agent', ''
@httpVersion = @req.httpVersion
@body = null
# detect host
host = @header 'host', ''
matched = host.match /^\s*([_0-9a-z-\.]+)/
@host = if matched then matched[1] else null
@$cookies = Cookie.parse @header 'cookie', ''
@$params = parts.query
@$files = {}
@$ip = null
if @method is 'POST'
contentType = @header 'content-type', ''
if contentType.match /^\s*(application\/x\-www\-form\-urlencoded|multipart\/form\-data)/i
form = new Form.IncomingForm
form.parse @req, (err, fields, files) =>
return cb @ if err?
mergeParams @$params, fields
@$files = files
cb @
else
body = []
@req.on 'data', (chunk) ->
body.push chunk
.on 'end', =>
@body = (Buffer.concat body).toString()
cb @
.on 'error', =>
cb @
else
cb @
ip: ->
defaults = ['x-real-ip', 'x-forwarded-for', 'client-ip']
if not @$ip?
if @options.ipHeader?
@$ip = @header @options.ipHeader, @req.socket.remoteAddress
else
@$ip = @req.socket.remoteAddress
for key in defaults
val = @header key
if val?
@$ip = val
break
@$ip
header: (key, val = undefined) ->
key = key.toLowerCase()
if @req.headers[key] then @req.headers[key] else val
cookie: (key, val = undefined) ->
if @$cookies[key]? then @$cookies[key] else val
is: (query) ->
required = QueryString.parse query
for k, v of required
if v.length > 0
return no if v != @get k
else
val = @get k
return no if val is undefined or val.length == 0
yes
set: (key, val = null) ->
if val == null and key instanceof Object
mergeParams @$params, key
else
@$params[key] = val
get: (key, defaults = undefined) ->
if @$params[key]? then @$params[key] else defaults
file: (key) ->
if @$files[key]? then @$files[key] else undefined
module.exports = Request
| 79533 | Form = require 'formidable'
Url = require 'url'
Cookie = require 'cookie'
QueryString = require 'querystring'
class Request
mergeParams = (source, target) ->
for k, v of target
source[k] = v
constructor: (@req, @options, cb) ->
parts = Url.parse @req.url, yes
@method = @req.method.toUpperCase()
@uri = parts.href
@path = if parts.pathname? then parts.pathname else '/'
@port = @req.socket.remotePort
@agent = @header 'user-agent', ''
@httpVersion = @req.httpVersion
@body = null
# detect host
host = @header 'host', ''
matched = host.match /^\s*([_0-9a-z-\.]+)/
@host = if matched then matched[1] else null
@$cookies = Cookie.parse @header 'cookie', ''
@$params = parts.query
@$files = {}
@$ip = null
if @method is 'POST'
contentType = @header 'content-type', ''
if contentType.match /^\s*(application\/x\-www\-form\-urlencoded|multipart\/form\-data)/i
form = new Form.IncomingForm
form.parse @req, (err, fields, files) =>
return cb @ if err?
mergeParams @$params, fields
@$files = files
cb @
else
body = []
@req.on 'data', (chunk) ->
body.push chunk
.on 'end', =>
@body = (Buffer.concat body).toString()
cb @
.on 'error', =>
cb @
else
cb @
ip: ->
defaults = ['x-real-ip', 'x-forwarded-for', 'client-ip']
if not @$ip?
if @options.ipHeader?
@$ip = @header @options.ipHeader, @req.socket.remoteAddress
else
@$ip = @req.socket.remoteAddress
for key in defaults
val = @header key
if val?
@$ip = val
break
@$ip
header: (key, val = undefined) ->
key = key.<KEY>()
if @req.headers[key] then @req.headers[key] else val
cookie: (key, val = undefined) ->
if @$cookies[key]? then @$cookies[key] else val
is: (query) ->
required = QueryString.parse query
for k, v of required
if v.length > 0
return no if v != @get k
else
val = @get k
return no if val is undefined or val.length == 0
yes
set: (key, val = null) ->
if val == null and key instanceof Object
mergeParams @$params, key
else
@$params[key] = val
get: (key, defaults = undefined) ->
if @$params[key]? then @$params[key] else defaults
file: (key) ->
if @$files[key]? then @$files[key] else undefined
module.exports = Request
| true | Form = require 'formidable'
Url = require 'url'
Cookie = require 'cookie'
QueryString = require 'querystring'
class Request
mergeParams = (source, target) ->
for k, v of target
source[k] = v
constructor: (@req, @options, cb) ->
parts = Url.parse @req.url, yes
@method = @req.method.toUpperCase()
@uri = parts.href
@path = if parts.pathname? then parts.pathname else '/'
@port = @req.socket.remotePort
@agent = @header 'user-agent', ''
@httpVersion = @req.httpVersion
@body = null
# detect host
host = @header 'host', ''
matched = host.match /^\s*([_0-9a-z-\.]+)/
@host = if matched then matched[1] else null
@$cookies = Cookie.parse @header 'cookie', ''
@$params = parts.query
@$files = {}
@$ip = null
if @method is 'POST'
contentType = @header 'content-type', ''
if contentType.match /^\s*(application\/x\-www\-form\-urlencoded|multipart\/form\-data)/i
form = new Form.IncomingForm
form.parse @req, (err, fields, files) =>
return cb @ if err?
mergeParams @$params, fields
@$files = files
cb @
else
body = []
@req.on 'data', (chunk) ->
body.push chunk
.on 'end', =>
@body = (Buffer.concat body).toString()
cb @
.on 'error', =>
cb @
else
cb @
ip: ->
defaults = ['x-real-ip', 'x-forwarded-for', 'client-ip']
if not @$ip?
if @options.ipHeader?
@$ip = @header @options.ipHeader, @req.socket.remoteAddress
else
@$ip = @req.socket.remoteAddress
for key in defaults
val = @header key
if val?
@$ip = val
break
@$ip
header: (key, val = undefined) ->
key = key.PI:KEY:<KEY>END_PI()
if @req.headers[key] then @req.headers[key] else val
cookie: (key, val = undefined) ->
if @$cookies[key]? then @$cookies[key] else val
is: (query) ->
required = QueryString.parse query
for k, v of required
if v.length > 0
return no if v != @get k
else
val = @get k
return no if val is undefined or val.length == 0
yes
set: (key, val = null) ->
if val == null and key instanceof Object
mergeParams @$params, key
else
@$params[key] = val
get: (key, defaults = undefined) ->
if @$params[key]? then @$params[key] else defaults
file: (key) ->
if @$files[key]? then @$files[key] else undefined
module.exports = Request
|
[
{
"context": "ocument.getElementById('login-username').value = 'admin';\n document.getElementById('login-password').val",
"end": 78,
"score": 0.9990029335021973,
"start": 73,
"tag": "USERNAME",
"value": "admin"
},
{
"context": "ocument.getElementById('login-password').value = '123456';",
"end": 140,
"score": 0.9992126822471619,
"start": 134,
"tag": "PASSWORD",
"value": "123456"
}
] | app/assets/javascripts/admin-input.coffee | john-huang-121/rapidfire_survey | 1 | @loginAdmin = () ->
document.getElementById('login-username').value = 'admin';
document.getElementById('login-password').value = '123456'; | 100380 | @loginAdmin = () ->
document.getElementById('login-username').value = 'admin';
document.getElementById('login-password').value = '<PASSWORD>'; | true | @loginAdmin = () ->
document.getElementById('login-username').value = 'admin';
document.getElementById('login-password').value = 'PI:PASSWORD:<PASSWORD>END_PI'; |
[
{
"context": " yang bagus.\"\n# century_skills_quote4_author: \"Joey, 10th Grade\"\n century_skills_subtitle4: \"Komuni",
"end": 3488,
"score": 0.8735718727111816,
"start": 3484,
"tag": "NAME",
"value": "Joey"
},
{
"context": "bagus.\"\n# century_skills_quote4_author: \"Joey, 10th Grade\"\n century_skills_subtitle4: \"Komunikasi\"\n c",
"end": 3500,
"score": 0.9388333559036255,
"start": 3490,
"tag": "NAME",
"value": "10th Grade"
},
{
"context": "an & Mitra\"\n featured_partners_blurb1: \"Mitra Pintar\"\n featured_partners_blurb2: \"Alat Kreativitas ",
"end": 5614,
"score": 0.5755237340927124,
"start": 5609,
"tag": "NAME",
"value": "intar"
},
{
"context": "e his coding skills.\"\n# quotes_quote5_author: \"Latthaphon Pohpon, Parent\"\n see_example: \"Lihat contoh\"\n slog",
"end": 9707,
"score": 0.9998904466629028,
"start": 9690,
"tag": "NAME",
"value": "Latthaphon Pohpon"
},
{
"context": "\"Mau CodeCombat ada di sekolahmu?\"\n educator: \"Pendidik\"\n student: \"Siswa\"\n our_coding_programs: \"P",
"end": 16418,
"score": 0.9992741942405701,
"start": 16410,
"tag": "NAME",
"value": "Pendidik"
},
{
"context": "ekolahmu?\"\n educator: \"Pendidik\"\n student: \"Siswa\"\n our_coding_programs: \"Program Coding Kami\"\n ",
"end": 16439,
"score": 0.9996047019958496,
"start": 16434,
"tag": "NAME",
"value": "Siswa"
},
{
"context": "illion: \"__num__ Billion\"\n\n nav:\n educators: \"Pendidik\"\n follow_us: \"Ikuti Kami\"\n general: \"Utama\"",
"end": 19707,
"score": 0.9887710809707642,
"start": 19699,
"tag": "NAME",
"value": "Pendidik"
},
{
"context": "\n nav:\n educators: \"Pendidik\"\n follow_us: \"Ikuti Kami\"\n general: \"Utama\"\n map: \"Peta\"\n play: \"",
"end": 19735,
"score": 0.8573780059814453,
"start": 19725,
"tag": "NAME",
"value": "Ikuti Kami"
},
{
"context": " blog: \"Blog\"\n forum: \"Forum\"\n account: \"Akun\"\n my_account: \"Akunku\"\n profile: \"Profil\"\n ",
"end": 19965,
"score": 0.8776565790176392,
"start": 19961,
"tag": "NAME",
"value": "Akun"
},
{
"context": "rum: \"Forum\"\n account: \"Akun\"\n my_account: \"Akunku\"\n profile: \"Profil\"\n home: \"Beranda\"\n co",
"end": 19990,
"score": 0.8300597071647644,
"start": 19984,
"tag": "NAME",
"value": "Akunku"
},
{
"context": "Tentang\"\n impact: \"Pengaruh\"\n contact: \"Kontak\"\n twitter_follow: \"Ikuti\"\n my_classrooms: \"",
"end": 20183,
"score": 0.8651819825172424,
"start": 20181,
"tag": "NAME",
"value": "ak"
},
{
"context": "garuh\"\n contact: \"Kontak\"\n twitter_follow: \"Ikuti\"\n my_classrooms: \"Kelasku\"\n my_courses: \"Ku",
"end": 20211,
"score": 0.9995547533035278,
"start": 20206,
"tag": "USERNAME",
"value": "Ikuti"
},
{
"context": "susku\"\n my_teachers: \"Guruku\"\n careers: \"Karir\"\n facebook: \"Facebook\"\n twitter: \"Twitter\"\n",
"end": 20314,
"score": 0.5837499499320984,
"start": 20312,
"tag": "NAME",
"value": "ir"
},
{
"context": "s: \"Karir\"\n facebook: \"Facebook\"\n twitter: \"Twitter\"\n create_a_class: \"Buat sebuah kelas\"\n othe",
"end": 20362,
"score": 0.45654645562171936,
"start": 20355,
"tag": "USERNAME",
"value": "Twitter"
},
{
"context": ": \"berhenti\"\n continue: \"lanjutkan\"\n pass: \"lewati\"\n return: \"kembali\"\n then: \"kemudian\"\n d",
"end": 29528,
"score": 0.9908032417297363,
"start": 29522,
"tag": "PASSWORD",
"value": "lewati"
},
{
"context": "up: \"Buat Akun\"\n email_or_username: \"Email atau username\"\n log_in: \"Masuk\"\n logging_in: \"Sedang masu",
"end": 30889,
"score": 0.8876885175704956,
"start": 30881,
"tag": "USERNAME",
"value": "username"
},
{
"context": "asuk\"\n log_out: \"Keluar\"\n forgot_password: \"Lupa dengan passwordmu?\"\n finishing: \"Finishing\"\n sign_in_with_faceb",
"end": 31008,
"score": 0.9988622665405273,
"start": 30986,
"tag": "PASSWORD",
"value": "Lupa dengan passwordmu"
},
{
"context": " log_in: \"masuk dengan kata sandi\"\n login: \"Masuk\"\n required: \"Kamu wajib masuk sebelum bisa mel",
"end": 32016,
"score": 0.9794477820396423,
"start": 32011,
"tag": "USERNAME",
"value": "Masuk"
},
{
"context": " invalid: \"Tidak valid\"\n invalid_password: \"Kata sandi salah\"\n with: \"dengan\"\n want_to_play_codecombat: ",
"end": 37291,
"score": 0.9991962909698486,
"start": 37275,
"tag": "PASSWORD",
"value": "Kata sandi salah"
},
{
"context": " invalid_password: \"Kata sandi salah\"\n with: \"dengan\"\n want_to_play_codecombat: \"Tidak, saya tidak ",
"end": 37310,
"score": 0.5552555322647095,
"start": 37304,
"tag": "PASSWORD",
"value": "dengan"
},
{
"context": "ccount_title: \"Pulihkan Akun\"\n send_password: \"Kirim Pemulihan Kata Sandi\"\n recovery_sent: \"Email pemulihan telah dikiri",
"end": 37647,
"score": 0.9992027282714844,
"start": 37621,
"tag": "PASSWORD",
"value": "Kirim Pemulihan Kata Sandi"
},
{
"context": "ct: \"Tolak\"\n withdraw: \"Tarik\"\n submitter: \"Yang Mengajukan\"\n submitted: \"Diajukan\"\n commit_msg: \"Pesan",
"end": 39562,
"score": 0.9986377358436584,
"start": 39547,
"tag": "NAME",
"value": "Yang Mengajukan"
},
{
"context": "bject: \"Subjek\"\n email: \"Email\"\n password: \"Kata Kunci\"\n confirm_password: \"Konfirmasi Kata Kunci\"\n ",
"end": 40112,
"score": 0.9991616010665894,
"start": 40102,
"tag": "PASSWORD",
"value": "Kata Kunci"
},
{
"context": " password: \"Kata Kunci\"\n confirm_password: \"Konfirmasi Kata Kunci\"\n message: \"Pesan\"\n code: \"Kode\"\n ladder",
"end": 40158,
"score": 0.9991356730461121,
"start": 40137,
"tag": "PASSWORD",
"value": "Konfirmasi Kata Kunci"
},
{
"context": "\"Pemanah\"\n wizard: \"Penyihir\"\n first_name: \"Nama Awal\"\n last_name: \"Nama Akhir\"\n last_initial: \"I",
"end": 40613,
"score": 0.9993413090705872,
"start": 40604,
"tag": "NAME",
"value": "Nama Awal"
},
{
"context": "ihir\"\n first_name: \"Nama Awal\"\n last_name: \"Nama Akhir\"\n last_initial: \"Inisial Akhir\"\n username: ",
"end": 40641,
"score": 0.999286949634552,
"start": 40631,
"tag": "NAME",
"value": "Nama Akhir"
},
{
"context": "last_name: \"Nama Akhir\"\n last_initial: \"Inisial Akhir\"\n username: \"Username\"\n contact_us: \"Hubung",
"end": 40675,
"score": 0.9124573469161987,
"start": 40670,
"tag": "NAME",
"value": "Akhir"
},
{
"context": "\n last_initial: \"Inisial Akhir\"\n username: \"Username\"\n contact_us: \"Hubungi Kami\"\n close_window:",
"end": 40700,
"score": 0.990772008895874,
"start": 40692,
"tag": "USERNAME",
"value": "Username"
},
{
"context": " Akhir\"\n username: \"Username\"\n contact_us: \"Hubungi Kami\"\n close_window: \"Tutup Jendela\"\n learn_more",
"end": 40731,
"score": 0.9990976452827454,
"start": 40719,
"tag": "NAME",
"value": "Hubungi Kami"
},
{
"context": "ry_new_item: \"Barang Baru\"\n victory_new_hero: \"Jagoan Baru\"\n victory_viking_code_school: \"Ya ampun, Itu a",
"end": 44762,
"score": 0.8898465037345886,
"start": 44751,
"tag": "NAME",
"value": "Jagoan Baru"
},
{
"context": " dan praktek. Tetapi dalam praktek, ada bedanya. - Yogi Berra\"\n tip_error_free: \"Ada dua cara untuk menulis ",
"end": 47534,
"score": 0.9897123575210571,
"start": 47524,
"tag": "NAME",
"value": "Yogi Berra"
},
{
"context": "i error; tetapi hanya cara ketiga yang berhasil. - Alan Perlis\"\n tip_debugging_program: \"Jika men-debug adala",
"end": 47668,
"score": 0.9998185634613037,
"start": 47657,
"tag": "NAME",
"value": "Alan Perlis"
},
{
"context": " memprogram pastilah proses menaruhnya kembali. - Edsger W. Dijkstra\"\n tip_forums: \"Pergilah menuju ke forum dan ce",
"end": 47820,
"score": 0.9998050332069397,
"start": 47802,
"tag": "NAME",
"value": "Edsger W. Dijkstra"
},
{
"context": " terlihat tidak mungkin sampai hal itu berhasil. - Nelson Mandela\"\n tip_talk_is_cheap: \"Bicara itu mudah. Tunjuk",
"end": 49061,
"score": 0.9998912811279297,
"start": 49047,
"tag": "NAME",
"value": "Nelson Mandela"
},
{
"context": ": \"Bicara itu mudah. Tunjukkan kepadaku kodenya. - Linus Torvalds\"\n tip_first_language: \"Hal malapetaka yang per",
"end": 49149,
"score": 0.9998692274093628,
"start": 49135,
"tag": "NAME",
"value": "Linus Torvalds"
},
{
"context": " yang prematur adalah akar dari semua keburukan. - Donald Knuth\"\n tip_brute_force: \"Jika ragu-ragu, gunakanlah",
"end": 49671,
"score": 0.9996079206466675,
"start": 49659,
"tag": "NAME",
"value": "Donald Knuth"
},
{
"context": "e_force: \"Jika ragu-ragu, gunakanlah kebrutalan. - Ken Thompson\"\n tip_extrapolation: \"Ada dua tipe orang: mere",
"end": 49748,
"score": 0.9998579621315002,
"start": 49736,
"tag": "NAME",
"value": "Ken Thompson"
},
{
"context": "arnya, kamu memiliki hak untuk mengontrol nasibmu. Linus Torvalds\"\n tip_no_code: \"Tanpa kode lebih cepat daripad",
"end": 50073,
"score": 0.9998880624771118,
"start": 50059,
"tag": "NAME",
"value": "Linus Torvalds"
},
{
"context": "pernah berbohong, tetapi komentar kadang-kadang. - Ron Jeffries\"\n tip_reusable_software: \"Sebelum perangkat lu",
"end": 50247,
"score": 0.9998906254768372,
"start": 50235,
"tag": "NAME",
"value": "Ron Jeffries"
},
{
"context": " proses pembuatan pesawat terbang dari beratnya. - Bill Gates\"\n tip_source_code: \"Aku ingin mengubah dunia t",
"end": 50660,
"score": 0.9998782277107239,
"start": 50650,
"tag": "NAME",
"value": "Bill Gates"
},
{
"context": "ntuk JavaScript sama seperti Bis dengan Biskuit. - Chris Heilmann\"\n tip_move_forward: \"Apapun yang telah kamu la",
"end": 50865,
"score": 0.9998466372489929,
"start": 50851,
"tag": "NAME",
"value": "Chris Heilmann"
},
{
"context": " telah kamu lakukan, tetaplah bergerak ke depan. - Martin Luther King Jr.\"\n tip_google: \"Punya masalah yang tidak da",
"end": 50970,
"score": 0.9997320175170898,
"start": 50952,
"tag": "NAME",
"value": "Martin Luther King"
},
{
"context": "a benci sebenarnya adalah programmer yang buruk. - Larry Niven\"\n tip_open_source_contribute: \"Kamu dapat memb",
"end": 51282,
"score": 0.9998810291290283,
"start": 51271,
"tag": "NAME",
"value": "Larry Niven"
},
{
"context": "engulang adalah manusiawi, Rekursi adalah ilahi. - L. Peter Deutsch\"\n tip_free_your_mind: \"Kamu harus membiarkan s",
"end": 51455,
"score": 0.999236524105072,
"start": 51439,
"tag": "NAME",
"value": "L. Peter Deutsch"
},
{
"context": "-tama, pecahkan masalah. Lalu, tulislah kodenya. - John Johnson\"\n tip_compiler_ignores_comments: \"Kadang-kadan",
"end": 51923,
"score": 0.9998469352722168,
"start": 51911,
"tag": "NAME",
"value": "John Johnson"
},
{
"context": "ena tempat asalmu. Batasmu hanyalah jiwamu. - Gusteau, Ratatouille\"\n tip_nemo: \"Ketika kehidupan m",
"end": 52612,
"score": 0.5691843032836914,
"start": 52611,
"tag": "NAME",
"value": "e"
},
{
"context": "tempat asalmu. Batasmu hanyalah jiwamu. - Gusteau, Ratatouille\"\n tip_nemo: \"Ketika kehidupan membuatmu pa",
"end": 52623,
"score": 0.6945971846580505,
"start": 52616,
"tag": "NAME",
"value": "Ratatou"
},
{
"context": "amu lakukan? Tetaplah berenang, tetaplah berenang. Dory, Finding Nemo\"\n tip_internet_weather: \"Baru saj",
"end": 52769,
"score": 0.9421048164367676,
"start": 52765,
"tag": "NAME",
"value": "Dory"
},
{
"context": "kukan? Tetaplah berenang, tetaplah berenang. Dory, Finding Nemo\"\n tip_internet_weather: \"Baru saja pindah ke i",
"end": 52783,
"score": 0.8926135301589966,
"start": 52771,
"tag": "NAME",
"value": "Finding Nemo"
},
{
"context": " hidup di dalam di mana cuaca selalu luar biasa. - John Green\"\n tip_nerds: \"Kutu buku diperbolehkan untuk me",
"end": 52936,
"score": 0.9995666146278381,
"start": 52926,
"tag": "NAME",
"value": "John Green"
},
{
"context": "i-kursi-tidak-dapat-mengontrol-diri suka sekali. - John Green\"\n tip_self_taught: \"Saya mengajari diri saya 9",
"end": 53092,
"score": 0.9996088743209839,
"start": 53082,
"tag": "NAME",
"value": "John Green"
},
{
"context": "ri apa yang telah saya pelajari. Dan itu normal! - Hank Green\"\n tip_luna_lovegood: \"Jangan khawatir, karena ",
"end": 53208,
"score": 0.9997777938842773,
"start": 53198,
"tag": "NAME",
"value": "Hank Green"
},
{
"context": " khawatir, karena kamu sama warasnya dengan aku. - Luna Lovegood\"\n tip_good_idea: \"Cara terbaik untuk memiliki ",
"end": 53304,
"score": 0.990845799446106,
"start": 53291,
"tag": "NAME",
"value": "Luna Lovegood"
},
{
"context": "ide baik adalah memiliki ide yang sangat banyak. - Linus Pauling\"\n tip_programming_not_about_computers: \"Ilmu K",
"end": 53418,
"score": 0.9993515610694885,
"start": 53405,
"tag": "NAME",
"value": "Linus Pauling"
},
{
"context": " seperti astronomi tidak hanya seputar teropong. - Edsger Dijkstra\"\n tip_mulan: \"Percayalah apa yang kamu bisa, m",
"end": 53576,
"score": 0.9964091181755066,
"start": 53561,
"tag": "NAME",
"value": "Edsger Dijkstra"
},
{
"context": "obal_tournament: \"Turnamen Global\"\n register: \"Daftar\"\n date: \"1 Agustus - 31 Agustus\"\n\n play_g",
"end": 57082,
"score": 0.6702332496643066,
"start": 57080,
"tag": "NAME",
"value": "Da"
},
{
"context": "n atau memilih PayPal? Email\"\n support_part2: \"support@codecombat.com\"\n\n announcement:\n now_available: \"Sekarang te",
"end": 62803,
"score": 0.9999251961708069,
"start": 62781,
"tag": "EMAIL",
"value": "support@codecombat.com"
},
{
"context": "ri. Sepanjang waktu, sungguh.\"\n griffin_name: \"Baby Griffin\"\n griffin_description: \"Griffin adalah setenga",
"end": 63200,
"score": 0.9998694658279419,
"start": 63188,
"tag": "NAME",
"value": "Baby Griffin"
},
{
"context": "ngkatkan persediaan emas Anda.\"\n cougar_name: \"Cougar\"\n cougar_description: \"Para cougar ingin me",
"end": 63620,
"score": 0.618238091468811,
"start": 63617,
"tag": "NAME",
"value": "Cou"
},
{
"context": "ngkur dengan Bahagia Setiap Hari.\"\n fox_name: \"Rubah Biru\"\n fox_description: \"Rubah biru sangat pintar d",
"end": 63762,
"score": 0.9984300136566162,
"start": 63752,
"tag": "NAME",
"value": "Rubah Biru"
},
{
"context": "ka menggali tanah dan salju!\"\n pugicorn_name: \"Pugicorn\"\n pugicorn_description: \"Pugicorn adalah salah",
"end": 63875,
"score": 0.9605148434638977,
"start": 63867,
"tag": "NAME",
"value": "Pugicorn"
},
{
"context": " langka dan bisa merapal mantra!\"\n wolf_name: \"Anjing Serigala\"\n wolf_description: \"Anak anjing serigala ungg",
"end": 64010,
"score": 0.9989292621612549,
"start": 63995,
"tag": "NAME",
"value": "Anjing Serigala"
},
{
"context": "memainkan permainan petak umpet!\"\n ball_name: \"Bola Berderit Merah\"\n ball_description: \"ball.squeak()\"\n collec",
"end": 64165,
"score": 0.9995805621147156,
"start": 64146,
"tag": "NAME",
"value": "Bola Berderit Merah"
},
{
"context": "ama!\"\n coming_soon: \"Segera hadir\"\n ritic: \"Ritic the Cold\" # Ritic Announcement Modal\n ritic_descri",
"end": 64690,
"score": 0.7384337186813354,
"start": 64681,
"tag": "NAME",
"value": "Ritic the"
},
{
"context": "oming_soon: \"Segera hadir\"\n ritic: \"Ritic the Cold\" # Ritic Announcement Modal\n ritic_description",
"end": 64695,
"score": 0.690977931022644,
"start": 64692,
"tag": "NAME",
"value": "old"
},
{
"context": " ritic_description: \"Ritic the Cold. Terjebak di Kelvintaph Glacier selama berabad-abad, akhirnya bebas dan siap mera",
"end": 64794,
"score": 0.9976527094841003,
"start": 64776,
"tag": "NAME",
"value": "Kelvintaph Glacier"
},
{
"context": "pelanggan! Manfaatkan kekuatan tak terbendung dari Okar Stompfoot, keakuratan yang mematikan dari Naria si Daun, at",
"end": 66125,
"score": 0.8992292284965515,
"start": 66111,
"tag": "NAME",
"value": "Okar Stompfoot"
},
{
"context": "aun, atau memanggil \\\"menggemaskan\\\" kerangka oleh Nalfar Cryptor.\"\n hero_blurb_2: \"Kesatria Premium membuka kem",
"end": 66233,
"score": 0.9981794357299805,
"start": 66219,
"tag": "NAME",
"value": "Nalfar Cryptor"
},
{
"context": " heading: \"Sesuaikan Pahlawan Anda\"\n body: \"Badan\"\n name_label: \"Nama Pahlawan\"\n hair_label",
"end": 70039,
"score": 0.5429222583770752,
"start": 70036,
"tag": "NAME",
"value": "Bad"
},
{
"context": "Pahlawan Anda\"\n body: \"Badan\"\n name_label: \"Nama Pahlawan\"\n hair_label: \"Warna Rambut\"\n skin_label: \"",
"end": 70073,
"score": 0.9803546667098999,
"start": 70060,
"tag": "NAME",
"value": "Nama Pahlawan"
},
{
"context": "oordinator: \"Koordinator Teknologi\"\n advisor: \"Spesialis Kurikulum/Penasihat\"\n principal: \"Kepala Sekolah\"\n sup",
"end": 82886,
"score": 0.9957129955291748,
"start": 82867,
"tag": "NAME",
"value": "Spesialis Kurikulum"
},
{
"context": "ator Teknologi\"\n advisor: \"Spesialis Kurikulum/Penasihat\"\n principal: \"Kepala Sekolah\"\n superintende",
"end": 82896,
"score": 0.8902473449707031,
"start": 82887,
"tag": "NAME",
"value": "Penasihat"
},
{
"context": "hanmu akan terlihat\"\n\n contact:\n contact_us: \"Hubungi CodeCombat\"\n welcome: \"Senang mendengar dari kamu! Gunaka",
"end": 86418,
"score": 0.7654815912246704,
"start": 86400,
"tag": "NAME",
"value": "Hubungi CodeCombat"
},
{
"context": " wrong_email: \"Email Salah\"\n wrong_password: \"Kata Kunci Salah\"\n delete_this_account: \"Hapus a",
"end": 87428,
"score": 0.9992375373840332,
"start": 87427,
"tag": "PASSWORD",
"value": "K"
},
{
"context": " untuk mengatur langganganmu.\"\n new_password: \"Kata Kunci Baru\"\n new_password_verify: \"Verifikasi\"\n type_i",
"end": 87800,
"score": 0.9913002848625183,
"start": 87785,
"tag": "PASSWORD",
"value": "Kata Kunci Baru"
},
{
"context": "word: \"Kata Kunci Baru\"\n new_password_verify: \"Verifikasi\"\n type_in_email: \"Ketik dalam email atau nama ",
"end": 87838,
"score": 0.9959352016448975,
"start": 87828,
"tag": "PASSWORD",
"value": "Verifikasi"
},
{
"context": "h: \"Kata sandi tidak sama.\"\n password_repeat: \"Tolong ulang kata sandimu.\"\n\n keyboard_shortcuts:\n keyboard_shortcuts: \"T",
"end": 89294,
"score": 0.9850587248802185,
"start": 89269,
"tag": "PASSWORD",
"value": "Tolong ulang kata sandimu"
},
{
"context": "odeCombat di Facebook\"\n social_twitter: \"Follow CodeCombat di Twitter\"\n social_slack: \"Mengobrol bersama ",
"end": 91705,
"score": 0.9587103128433228,
"start": 91695,
"tag": "USERNAME",
"value": "CodeCombat"
},
{
"context": " dengan mengirimkan mereka tautan.\"\n members: \"Anggota\"\n progress: \"Perkembangan\"\n not_started_1: ",
"end": 93165,
"score": 0.7795228362083435,
"start": 93158,
"tag": "NAME",
"value": "Anggota"
},
{
"context": "ssign: \"daftarkan kursus berbayar.\"\n student: \"Siswa\"\n teacher: \"Guru\"\n arena: \"Arena\"\n avail",
"end": 96343,
"score": 0.9955795407295227,
"start": 96338,
"tag": "NAME",
"value": "Siswa"
},
{
"context": "sus berbayar.\"\n student: \"Siswa\"\n teacher: \"Guru\"\n arena: \"Arena\"\n available_levels: \"Level ",
"end": 96363,
"score": 0.9834343194961548,
"start": 96359,
"tag": "NAME",
"value": "Guru"
},
{
"context": "Undang Siswa Melalui Email\"\n remove_student1: \"Hapus Siswa\"\n are_you_sure: \"Apakah anda yakin ingin mengh",
"end": 97848,
"score": 0.5920719504356384,
"start": 97837,
"tag": "NAME",
"value": "Hapus Siswa"
},
{
"context": "n tidak dapat dikembalikan.\"\n instructor: \"Pengajar: \"\n youve_been_invited_1: \"Kamu telah diundang",
"end": 102796,
"score": 0.9220432043075562,
"start": 102792,
"tag": "NAME",
"value": "ajar"
},
{
"context": "el akhir yang terselesaikan\"\n enroll_student: \"Daftar siswa\"\n apply_license: \"Gunakan Lisensi\"\n r",
"end": 111517,
"score": 0.8229711055755615,
"start": 111511,
"tag": "NAME",
"value": "Daftar"
},
{
"context": "ir yang terselesaikan\"\n enroll_student: \"Daftar siswa\"\n apply_license: \"Gunakan Lisensi\"\n revoke_",
"end": 111523,
"score": 0.8600153923034668,
"start": 111518,
"tag": "NAME",
"value": "siswa"
},
{
"context": "signed: \"Tetapkan\"\n enroll_selected_students: \"Daftar Siswa Terpilih\"\n no_students_selected: \"Tidak ",
"end": 114410,
"score": 0.7393189072608948,
"start": 114404,
"tag": "NAME",
"value": "Daftar"
},
{
"context": ": \"Tetapkan\"\n enroll_selected_students: \"Daftar Siswa Terpilih\"\n no_students_selected: \"Tidak ada siswa yang ",
"end": 114425,
"score": 0.8657223582267761,
"start": 114411,
"tag": "NAME",
"value": "Siswa Terpilih"
},
{
"context": " kata kunci baru di bawah:\"\n change_password: \"Ganti Kata Kunci\"\n changed: \"Terganti\"\n available_credits: \"",
"end": 115403,
"score": 0.9990439414978027,
"start": 115387,
"tag": "PASSWORD",
"value": "Ganti Kata Kunci"
},
{
"context": "tudent_details: \"Detail Siswa\"\n student_name: \"Nama Siswa\"\n no_name: \"Tidak ada nama.\"\n no_username: ",
"end": 124531,
"score": 0.9973737001419067,
"start": 124521,
"tag": "NAME",
"value": "Nama Siswa"
},
{
"context": "ode lebh lagi? Hubungi [spesialis sekolah](mailto:schools@codecombat.com) kami hari ini!\"\n teacher_quest_keep_going: \"T",
"end": 131296,
"score": 0.9998794198036194,
"start": 131274,
"tag": "EMAIL",
"value": "schools@codecombat.com"
},
{
"context": "hare_licenses: \"Bagikan Lisensi\"\n shared_by: \"Dibagikan Oleh:\"\n add_teacher_label: \"Masukan email guru yang",
"end": 134684,
"score": 0.8005668520927429,
"start": 134671,
"tag": "NAME",
"value": "ibagikan Oleh"
},
{
"context": "lay versus your code:\"\n\n game_dev:\n creator: \"Pembuat\"\n\n web_dev:\n image_gallery_title: \"Galeri Gam",
"end": 136858,
"score": 0.7921541333198547,
"start": 136851,
"tag": "USERNAME",
"value": "Pembuat"
},
{
"context": "ng lain untuk memprogram.\"\n adventurer_title: \"Petualang\"\n adventurer_title_description: \"(Penguji Leve",
"end": 138049,
"score": 0.813208281993866,
"start": 138040,
"tag": "NAME",
"value": "Petualang"
},
{
"context": " bug sebelum rilis ke publik.\"\n scribe_title: \"Penulis\"\n scribe_title_description: \"(Editor Artikel)\"",
"end": 138313,
"score": 0.9639767408370972,
"start": 138306,
"tag": "NAME",
"value": "Penulis"
},
{
"context": "ili CodeCombat kepada dunia.\"\n teacher_title: \"Guru\"\n\n editor:\n main_title: \"Editor CodeCombat\"\n ",
"end": 139001,
"score": 0.9656178951263428,
"start": 138997,
"tag": "NAME",
"value": "Guru"
},
{
"context": "\"\n new_poll_title_login: \"Masuk untuk Membuat Jajak Pendapat Baru\"\n article_search_title: \"Telusuri Artikel Di S",
"end": 141669,
"score": 0.6889313459396362,
"start": 141651,
"tag": "NAME",
"value": "ajak Pendapat Baru"
},
{
"context": "nyak waktu untuk melatih Anda.\"\n how_to_join: \"Cara Bergabung\"\n join_desc_1: \"Siapa pun dapat membantu! Liha",
"end": 144257,
"score": 0.9320210814476013,
"start": 144243,
"tag": "NAME",
"value": "Cara Bergabung"
},
{
"context": "atkan peringkat game Anda.\"\n choose_opponent: \"Pilih Lawan\"\n select_your_language: \"Pilih bahasa An",
"end": 153497,
"score": 0.6609675884246826,
"start": 153492,
"tag": "NAME",
"value": "Pilih"
},
{
"context": " peringkat game Anda.\"\n choose_opponent: \"Pilih Lawan\"\n select_your_language: \"Pilih bahasa Anda!\"\n ",
"end": 153503,
"score": 0.9618062973022461,
"start": 153498,
"tag": "NAME",
"value": "Lawan"
},
{
"context": ": \"Losses\"\n# win_rate: \"Win %\"\n humans: \"Merah\" # Ladder page display team name\n ogres: \"Biru",
"end": 155702,
"score": 0.6634991765022278,
"start": 155700,
"tag": "NAME",
"value": "ah"
},
{
"context": "_open: \"Buka\"\n\n user:\n user_title: \"__name__ - Belajar Membuat Kode dengan CodeCombat\"\n stats: \"Statistik\"\n ",
"end": 156060,
"score": 0.8204625248908997,
"start": 156043,
"tag": "NAME",
"value": "Belajar Membuat K"
},
{
"context": "\"Bobby Duke Middle School\"\n featured_teacher: \"Scott Baily\"\n teacher_title: \"Guru Teknologi Coachella, CA",
"end": 161163,
"score": 0.9998207092285156,
"start": 161152,
"tag": "NAME",
"value": "Scott Baily"
},
{
"context": "ementation: \"Implementasi\"\n grades_taught: \"Nilai Diajarkan\"\n length_use: \"Panjang Penggunaan\"\n length_",
"end": 161285,
"score": 0.9967654347419739,
"start": 161273,
"tag": "NAME",
"value": "ai Diajarkan"
},
{
"context": "ngagement: \"Keterlibatan Segera\"\n paragraph1: \"Bobby Duke Middle School terletak di antara pegunungan ",
"end": 161798,
"score": 0.8660247921943665,
"start": 161793,
"tag": "NAME",
"value": "Bobby"
},
{
"context": "a . \"\n paragraph2: \"Para siswa Sekolah Menengah Bobby Duke mencerminkan tantangan sosial ekonomi yang dihada",
"end": 162117,
"score": 0.7344191074371338,
"start": 162107,
"tag": "NAME",
"value": "Bobby Duke"
},
{
"context": " prioritas utama guru Teknologi Sekolah Menengah Bobby Duke, Scott Baily. \"\n paragraph3: \"Baily tahu ",
"end": 162540,
"score": 0.7702751159667969,
"start": 162536,
"tag": "NAME",
"value": "obby"
},
{
"context": " utama guru Teknologi Sekolah Menengah Bobby Duke, Scott Baily. \"\n paragraph3: \"Baily tahu bahwa mengajari si",
"end": 162558,
"score": 0.9918694496154785,
"start": 162547,
"tag": "NAME",
"value": "Scott Baily"
},
{
"context": "ka bahkan tidak menutup.\"\n quote_attribution: \"Scott Baily, Guru Teknologi\"\n read_full_story: \"Baca Kisah",
"end": 163278,
"score": 0.9998860359191895,
"start": 163267,
"tag": "NAME",
"value": "Scott Baily"
},
{
"context": "ight: \"Sorotan Guru & Siswa\"\n teacher_name_1: \"Amanda Henry\"\n teacher_title_1: \"Instruktur Rehabilitasi\"\n ",
"end": 163837,
"score": 0.9998820424079895,
"start": 163825,
"tag": "NAME",
"value": "Amanda Henry"
},
{
"context": "membantu mereka yang membutuhkan kesempatan kedua, Amanda Henry membantu mengubah kehidupan siswa yang membutuhka",
"end": 164054,
"score": 0.9998152852058411,
"start": 164042,
"tag": "NAME",
"value": "Amanda Henry"
},
{
"context": "ositif. Tanpa pengalaman ilmu komputer sebelumnya, Henry memimpin siswanya meraih kesuksesan coding dalam ",
"end": 164171,
"score": 0.9997556209564209,
"start": 164166,
"tag": "NAME",
"value": "Henry"
},
{
"context": "ompetisi coding regional . \"\n teacher_name_2: \"Kaila, Siswa\"\n teacher_title_2: \"Maysville Community & Tech",
"end": 164284,
"score": 0.9998712539672852,
"start": 164272,
"tag": "NAME",
"value": "Kaila, Siswa"
},
{
"context": "nuju masa depan yang cerah.\"\n teacher_name_3: \"Susan Jones-Szabo\"\n teacher_title_3: \"Pustakawan Guru\"\n teach",
"end": 164615,
"score": 0.9977399706840515,
"start": 164598,
"tag": "NAME",
"value": "Susan Jones-Szabo"
},
{
"context": "acher_location_3: \"Alameda, CA\"\n spotlight_3: \"Susan Jones-Szabo mempromosikan suasana yang setara di kelasnya di ",
"end": 164777,
"score": 0.9873043894767761,
"start": 164760,
"tag": "NAME",
"value": "Susan Jones-Szabo"
},
{
"context": "dan muat ulang halaman ini.\"\n login_required: \"Wajib Masuk\"\n login_required_desc: \"Anda harus masuk untuk",
"end": 165346,
"score": 0.8558073043823242,
"start": 165335,
"tag": "NAME",
"value": "Wajib Masuk"
},
{
"context": "gikan\"\n\n anonymous_teacher:\n notify_teacher: \"Beri Tahu Guru\"\n create_teacher_account: \"Buat akun guru grat",
"end": 171925,
"score": 0.9103456735610962,
"start": 171911,
"tag": "NAME",
"value": "Beri Tahu Guru"
},
{
"context": "Email guru anda:\"\n teacher_email_placeholder: \"guruku@contoh.com\"\n student_name_placeholder: \"ketik nama anda d",
"end": 172109,
"score": 0.9999303817749023,
"start": 172092,
"tag": "EMAIL",
"value": "guruku@contoh.com"
},
{
"context": "taken: \"Email telah diambil\"\n username_taken: \"Username telah diambil\"\n easy_password: \"Kata sandi terlalu mudah dit",
"end": 179109,
"score": 0.9948086142539978,
"start": 179087,
"tag": "USERNAME",
"value": "Username telah diambil"
},
{
"context": "ken: \"Username telah diambil\"\n easy_password: \"Kata sandi terlalu mudah ditebak\"\n reused_password: \"Kata sandi tidak dapat dig",
"end": 179163,
"score": 0.9992441534996033,
"start": 179131,
"tag": "PASSWORD",
"value": "Kata sandi terlalu mudah ditebak"
},
{
"context": "andi terlalu mudah ditebak\"\n reused_password: \"Kata sandi tidak dapat digunakan kembali\"\n\n esper:\n line_no: \"Baris $1:\"\n uncaught:",
"end": 179227,
"score": 0.9992492198944092,
"start": 179187,
"tag": "PASSWORD",
"value": "Kata sandi tidak dapat digunakan kembali"
},
{
"context": "an atau lebih suka Paypal? Email <a href=\\\"mailto:support@codecombat.com\\\"> support@codecombat.com </a>\"\n not_sure_kid:",
"end": 190467,
"score": 0.999926745891571,
"start": 190445,
"tag": "EMAIL",
"value": "support@codecombat.com"
},
{
"context": "? Email <a href=\\\"mailto:support@codecombat.com\\\"> support@codecombat.com </a>\"\n not_sure_kid: \"Tidak yakin apakah CodeC",
"end": 190493,
"score": 0.9999279975891113,
"start": 190471,
"tag": "EMAIL",
"value": "support@codecombat.com"
},
{
"context": "sebut berfungsi dengan benar. \\\"\"\n quote_3: \"\\\"Oliver’s Python akan segera hadir. Dia menggunakan CodeC",
"end": 194251,
"score": 0.8081983327865601,
"start": 194245,
"tag": "NAME",
"value": "Oliver"
},
{
"context": "nnya 10!\\\"\"\n parent: \"Orang Tua\"\n student: \"Siswa\"\n grade: \"Tingkat\"\n subscribe_error_user_ty",
"end": 194685,
"score": 0.9992298483848572,
"start": 194680,
"tag": "NAME",
"value": "Siswa"
},
{
"context": "dengan CodeCombat Premium, silakan hubungi kami di team@codecombat.com.\"\n subscribe_error_already_subscribed: \"Anda s",
"end": 194880,
"score": 0.9999271035194397,
"start": 194861,
"tag": "EMAIL",
"value": "team@codecombat.com"
},
{
"context": "ang di CodeCombat's Hour of Code!\"\n educator: \"Saya seorang pendidik\"\n show_resources: \"Tunjukkan sumber daya g",
"end": 197776,
"score": 0.6438098549842834,
"start": 197759,
"tag": "NAME",
"value": "Saya seorang pend"
},
{
"context": " Hour of Code!\"\n educator: \"Saya seorang pendidik\"\n show_resources: \"Tunjukkan sumber daya guru!",
"end": 197780,
"score": 0.6498727798461914,
"start": 197778,
"tag": "NAME",
"value": "ik"
},
{
"context": "rces: \"Tunjukkan sumber daya guru!\"\n student: \"Saya seorang siswa\"\n ready_to_code: \"Saya siap membuat kode!\"\n\n ",
"end": 197864,
"score": 0.7204340696334839,
"start": 197846,
"tag": "NAME",
"value": "Saya seorang siswa"
},
{
"context": "_cert_btn: \"Dapatkan Sertifikat\"\n first_name: \"Nama depan\"\n last_initial: \"Inisial Terakhir\"\n teacher",
"end": 198263,
"score": 0.9793291091918945,
"start": 198253,
"tag": "NAME",
"value": "Nama depan"
},
{
"context": "\"\n first_name: \"Nama depan\"\n last_initial: \"Inisial Terakhir\"\n teacher_email: \"Alamat email guru\"\n\n school",
"end": 198300,
"score": 0.984074056148529,
"start": 198284,
"tag": "NAME",
"value": "Inisial Terakhir"
},
{
"context": "i Manajer Akun CodeCombat Anda atau kirim email ke support@codecombat.com.\"\n license_stat_description: \"Lisensi akun yan",
"end": 198878,
"score": 0.9999130368232727,
"start": 198856,
"tag": "EMAIL",
"value": "support@codecombat.com"
},
{
"context": "ktor superstar Meksiko, komedian, dan pembuat film Eugenio Derbez.\"\n invite_link: \"Undang pemain ke tim ini deng",
"end": 205621,
"score": 0.9946654438972473,
"start": 205607,
"tag": "NAME",
"value": "Eugenio Derbez"
},
{
"context": "si sesuai jadwal mereka sendiri.\"\n edit_team: \"Edit Tim\"\n start_team: \"Mulai Tim\"\n leave_team: ",
"end": 206743,
"score": 0.8435009717941284,
"start": 206739,
"tag": "NAME",
"value": "Edit"
},
{
"context": "esuai jadwal mereka sendiri.\"\n edit_team: \"Edit Tim\"\n start_team: \"Mulai Tim\"\n leave_team: \"Kel",
"end": 206747,
"score": 0.7220877408981323,
"start": 206744,
"tag": "NAME",
"value": "Tim"
},
{
"context": "diri.\"\n edit_team: \"Edit Tim\"\n start_team: \"Mulai Tim\"\n leave_team: \"Keluar dari Tim\"\n join_team:",
"end": 206775,
"score": 0.9561454653739929,
"start": 206766,
"tag": "NAME",
"value": "Mulai Tim"
},
{
"context": "art_team: \"Mulai Tim\"\n leave_team: \"Keluar dari Tim\"\n join_team: \"Gabung Tim\"\n# view_team: \"Vie",
"end": 206809,
"score": 0.8506284356117249,
"start": 206806,
"tag": "NAME",
"value": "Tim"
},
{
"context": " leave_team: \"Keluar dari Tim\"\n join_team: \"Gabung Tim\"\n# view_team: \"View Team\"\n# join_team_name:",
"end": 206837,
"score": 0.985913872718811,
"start": 206827,
"tag": "NAME",
"value": "Gabung Tim"
},
{
"context": "ents\" # 2 students\n# top_student: \"Top:\" # Top: Jane D\n# top_percent: \"top\" # - top 3%)\n# top_of: ",
"end": 210812,
"score": 0.9984665513038635,
"start": 210806,
"tag": "NAME",
"value": "Jane D"
}
] | app/locale/id.coffee | Snake210993/codecombat | 0 | module.exports = nativeDescription: "Bahasa Indonesia", englishDescription: "Indonesian", translation:
new_home:
title: "CodeCombat - Coding game untuk belajar Python dan JavaScript"
meta_keywords: "CodeCombat, python, javascript, Coding Games"
meta_description: "Pelajari kode yang diketik melalui permainan pemrograman. Pelajari Python, JavaScript, dan HTML sambil Anda memecahkan teka-teki dan belajar membuat game dan situs web pengkodean Anda sendiri."
meta_og_url: "https://codecombat.com"
become_investor: "menjadi investor di CodeCombat"
built_for_teachers_title: "Sebuah Game Coding yang Dibuat dengan Guru sebagai Pemeran Utama"
built_for_teachers_blurb: "Mengajari anak-anak membuat kode sering kali terasa berat. CodeCombat membantu semua pengajar mengajari siswa cara membuat kode dalam JavaScript atau Python, dua bahasa pemrograman paling populer. Dengan kurikulum komprehensif yang mencakup enam unit ilmu komputer dan memperkuat pembelajaran melalui pengembangan game berbasis proyek dan unit pengembangan web, anak-anak akan maju dalam perjalanan dari sintaks dasar ke rekursi! "
built_for_teachers_subtitle1: "Ilmu Komputer"
built_for_teachers_subblurb1: "Dimulai dengan kursus Pengantar Ilmu Komputer gratis kami, siswa menguasai konsep pengkodean inti seperti while / for loop, fungsi, dan algoritma."
built_for_teachers_subtitle2: "Pengembangan Game"
built_for_teachers_subblurb2: "Peserta didik membangun labirin dan menggunakan penanganan masukan (input handling) dasar untuk membuat kode permainan mereka sendiri yang dapat dibagikan dengan teman dan keluarga."
built_for_teachers_subtitle3: "Pengembangan Web"
built_for_teachers_subblurb3: "Dengan menggunakan HTML, CSS, dan jQuery, pelajar melatih otot kreatif mereka untuk memprogram laman web mereka sendiri dengan URL khusus untuk dibagikan dengan teman sekelas mereka."
century_skills_title: "Keterampilan Abad 21"
century_skills_blurb1: "Siswa Tidak Hanya Meningkatkan Level Pahlawan Mereka, Mereka Sendiri Meningkatkan Level Keterampilan Coding"
century_skills_quote1: "Kamu merasa gagal ... karena itu kamu harus memikirkan tentang semua cara yang mungkin untuk memperbaikinya, lalu coba lagi. Aku tidak akan bisa sampai di sini tanpa berusaha keras."
century_skills_subtitle1: "Berpikir Kritis"
century_skills_subblurb1: "Dengan teka-teki pengkodean yang secara alami disusun menjadi level yang semakin menantang, game pemrograman CodeCombat memastikan anak-anak selalu mempraktikkan pemikiran kritis."
century_skills_quote2: "Semua orang membuat labirin, jadi saya pikir, 'tangkap bendera' dan itulah yang saya lakukan."
century_skills_subtitle2: "Kreativitas"
century_skills_subblurb2: "CodeCombat mendorong siswa untuk menunjukkan kreativitas mereka dengan membuat dan berbagi game dan halaman web mereka sendiri."
century_skills_quote3: "Jika saya terjebak pada suatu level. Saya akan bekerja dengan orang-orang di sekitar saya sampai kita semua dapat melaluinya."
century_skills_subtitle3: "Kolaborasi"
century_skills_subblurb3: "Sepanjang permainan, ada peluang bagi siswa untuk berkolaborasi saat mereka mengalami kebuntuan dan untuk bekerja sama menggunakan panduan pemrograman berpasangan."
century_skills_quote4: "Saya selalu memiliki aspirasi untuk mendesain video game dan mempelajari cara membuat kode ... ini memberi saya titik awal yang bagus."
# century_skills_quote4_author: "Joey, 10th Grade"
century_skills_subtitle4: "Komunikasi"
century_skills_subblurb4: "Coding mengharuskan anak-anak untuk mempraktikkan bentuk komunikasi baru, termasuk berkomunikasi dengan komputer itu sendiri dan menyampaikan ide-ide mereka menggunakan kode yang paling efisien."
classroom_in_box_title: "Kami Berusaha Untuk:"
classroom_in_box_blurb1: "Libatkan setiap siswa sehingga mereka yakin bahwa kemampuan coding bermanfaat untuk mereka."
classroom_in_box_blurb2: "Berdayakan semua pendidik untuk merasa percaya diri saat mengajar coding."
classroom_in_box_blurb3: "Menginspirasi semua pimpinan sekolah untuk membuat program ilmu komputer kelas dunia."
classroom_in_box_blurb4: ""
click_here: "Klik di sini"
creativity_rigor_title: "Di Mana Kreativitas Bertemu dengan Ketelitian"
creativity_rigor_subtitle1: "Jadikan coding menyenangkan dan ajarkan keterampilan dunia nyata"
creativity_rigor_blurb1: "Siswa mengetik Python dan JavaScript nyata sambil bermain game yang mendorong coba-dan-gagal (trial-and-error), berpikir kritis, dan kreativitas. Siswa kemudian menerapkan keterampilan pengkodean yang telah mereka pelajari dengan mengembangkan game dan situs web mereka sendiri dalam kursus berbasis proyek. "
creativity_rigor_subtitle2: "Jangkau siswa di level mereka"
creativity_rigor_blurb2: "Setiap level CodeCombat dirancang berdasarkan jutaan poin data dan dioptimalkan untuk beradaptasi dengan setiap pelajar. Level dan petunjuk latihan membantu siswa saat mereka mengalami kebuntuan, dan level tantangan menilai pembelajaran siswa selama game."
creativity_rigor_subtitle3: "Dibuat untuk semua guru, apa pun pengalamannya"
creativity_rigor_blurb3: "Kurikulum CodeCombat yang serba cepat dan selaras dengan standar memungkinkan pengajaran ilmu komputer untuk semua orang. CodeCombat membekali guru dengan pelatihan, sumber daya instruksional, dan dukungan khusus untuk merasa percaya diri dan sukses di kelas."
featured_partners_title1: "Ditampilkan Dalam"
featured_partners_title2: "Penghargaan & Mitra"
featured_partners_blurb1: "Mitra Pintar"
featured_partners_blurb2: "Alat Kreativitas Terbaik untuk Siswa"
featured_partners_blurb3: "Pilihan Terbaik untuk Belajar"
featured_partners_blurb4: "Mitra Resmi Code.org"
featured_partners_blurb5: "Anggota Resmi CSforAll"
featured_partners_blurb6: "Mitra Aktifitas Hour of Code"
for_leaders_title: "Untuk Pimpinan Sekolah"
for_leaders_blurb: "Program Ilmu Komputer yang Selaras dengan Standar"
for_leaders_subtitle1: "Penerapan yang Mudah"
for_leaders_subblurb1: "Program berbasis web yang tidak memerlukan dukungan TI. Mulailah dalam waktu kurang dari 5 menit menggunakan Google atau Clever Single Sign-On (SSO)."
for_leaders_subtitle2: "Kurikulum Coding Lengkap"
for_leaders_subblurb2: "Kurikulum yang selaras dengan standar dengan sumber daya instruksional dan pengembangan profesional untuk memungkinkan semua guru mengajarkan ilmu komputer."
for_leaders_subtitle3: "Kasus Penggunaan Fleksibel"
for_leaders_subblurb3: "Apakah Anda ingin membangun mata pelajaran pengkodean Sekolah Menengah, jalur CTE, atau mengajar kelas Pengantar Ilmu Komputer, CodeCombat disesuaikan dengan kebutuhan Anda."
for_leaders_subtitle4: "Keterampilan Dunia Nyata"
for_leaders_subblurb4: "Siswa membangun daya tahan dan mengembangkan pola pikir yang berkembang melalui tantangan pengkodean yang mempersiapkan mereka untuk 500K+ pekerjaan komputasi terbuka."
for_teachers_title: "Untuk Guru"
for_teachers_blurb: "Alat untuk Membuka Potensi Siswa"
for_teachers_subtitle1: "Pembelajaran Berbasis Proyek"
for_teachers_subblurb1: "Promosikan kreativitas, pemecahan masalah, dan kepercayaan diri dalam kursus berbasis proyek tempat siswa mengembangkan game dan halaman web mereka sendiri."
for_teachers_subtitle2: "Dasbor Guru"
for_teachers_subblurb2: "Melihat data tentang kemajuan siswa, menemukan sumber daya kurikulum, dan mengakses dukungan waktu nyata untuk memberdayakan pembelajaran siswa."
for_teachers_subtitle3: "Penilaian Bawaan"
for_teachers_subblurb3: "Personalisasi instruksi dan pastikan siswa memahami konsep inti dengan penilaian formatif dan sumatif."
for_teachers_subtitle4: "Diferensiasi Otomatis"
for_teachers_subblurb4: "Libatkan semua pelajar di kelas yang berbeda dengan tingkat latihan yang menyesuaikan dengan kebutuhan belajar setiap siswa."
game_based_blurb: "CodeCombat adalah program ilmu komputer berbasis game tempat siswa mengetik kode nyata dan melihat karakter mereka bereaksi dalam waktu nyata."
get_started: "Memulai"
global_title: "Bergabunglah dengan Komunitas Global untuk Pelajar dan Pendidik"
global_subtitle1: "Peserta"
global_subtitle2: "Garis Kode"
global_subtitle3: "Guru"
global_subtitle4: "Negara"
go_to_my_classes: "Masuk ke kelas saya"
go_to_my_courses: "Masuk ke kursus saya"
quotes_quote1: "Sebutkan program apa pun secara online, saya sudah mencobanya. Tidak ada yang cocok dengan CodeCombat. Setiap guru yang ingin siswanya belajar cara membuat kode ... mulai dari sini!" # {change}
quotes_quote2: "Saya terkejut tentang betapa mudah dan intuitifnya CodeCombat dalam mempelajari ilmu komputer. Nilai ujian AP jauh lebih tinggi dari yang saya harapkan dan saya yakin CodeCombat adalah alasan mengapa hal ini terjadi."
quotes_quote3: "CodeCombat telah menjadi hal yang paling bermanfaat untuk mengajar siswa saya kemampuan pengkodean kehidupan nyata. Suami saya adalah seorang insinyur perangkat lunak dan dia telah menguji semua program saya. Dia menempatkan ini sebagai pilihan utamanya."
quotes_quote4: "Umpan baliknya… sangat positif sehingga kami menyusun kelas ilmu komputer di sekitar CodeCombat. Program ini benar-benar melibatkan siswa dengan platform gaya permainan yang menghibur dan instruksional pada saat yang sama. Pertahankan kerja bagus, CodeCombat ! "
# quotes_quote5: "Even though the class starts every Saturday at 7am, my son is so excited that he wakes up before me! CodeCombat creates a pathway for my son to advance his coding skills."
# quotes_quote5_author: "Latthaphon Pohpon, Parent"
see_example: "Lihat contoh"
slogan: "Game untuk belajar pemrograman paling menyenangkan."
# slogan_power_of_play: "Learn to Code Through the Power of Play"
teach_cs1_free: "Ajarkan CS1 Gratis"
teachers_love_codecombat_title: "Guru Suka CodeCombat"
teachers_love_codecombat_blurb1: "Laporkan bahwa siswanya senang menggunakan CodeCombat untuk mempelajari cara membuat kode"
teachers_love_codecombat_blurb2: "Akan merekomendasikan CodeCombat kepada guru ilmu komputer lainnya"
teachers_love_codecombat_blurb3: "Katakan bahwa CodeCombat membantu mereka mendukung kemampuan pemecahan masalah siswa"
teachers_love_codecombat_subblurb: "Bekerja sama dengan McREL International, pemimpin dalam panduan berbasis penelitian dan evaluasi teknologi pendidikan."
top_banner_blurb: "Para orang tua, berikan anak Anda hadiah coding dan pengajaran yang dipersonalisasi dengan pengajar langsung kami!"
# top_banner_summer_camp: "Enrollment now open for our summer coding camps–ask us about our week-long virtual sessions starting at just $199."
# top_banner_blurb_funding: "New: CARES Act funding resources guide to ESSER and GEER funds for your CS programs."
try_the_game: "Coba permainan"
classroom_edition: "Edisi Ruang Kelas:"
learn_to_code: "Belajar membuat kode:"
play_now: "Mainkan Sekarang"
im_a_parent: "Saya Orang Tua"
im_an_educator: "Saya seorang Pendidik"
im_a_teacher: "Aku seorang guru"
im_a_student: "Aku seorang siswa"
learn_more: "Pelajari lebih lanjut"
classroom_in_a_box: "Sebuah ruangan kelas di-dalam-kotak untuk belajar ilmu komputer."
codecombat_is: "CodeCombat adalah sebuah wadah <strong>untuk para siswa<strong> untuk belajar ilmu komputer sambil bermain permainan yang sesungguhnya."
our_courses: "Kursus kami telah diuji oleh para pemain secara khusus untuk <strong>menjadi lebih baik di ruang kelas</strong>, bahkan oleh para guru yang mempunyai sedikit atau tanpa pengalaman pemrograman sebelumnya."
watch_how: "Saksikan CodeCombat mentransformasi cara orang-orang belajar ilmu komputer."
top_screenshots_hint: "Para siswa menulis kode dan melihat mereka mengganti secara langsung"
designed_with: "Dirancang untuk para guru"
real_code: "Kode asli yang diketik"
from_the_first_level: "dari tingkat pertama"
getting_students: "Mengajak siswa untuk mengetik kode secepat mungkin sangatlah penting untuk mempelajari sintaks pemrograman dan struktur yang tepat."
educator_resources: "Sumber pendidik"
course_guides: "dan panduan rangkaian pelajaran"
teaching_computer_science: "Mengajari ilmu komputer tidak memerlukan gelar yang mahal, karena kami menyediakan peralatan untuk menunjang pendidik dari segala macam latar belakang."
accessible_to: "Dapat diakses oleh"
everyone: "semua orang"
democratizing: "Mendemokrasikan proses belajar membuat kode adalah inti dari filosofi kami. Semua orang yang mampu untuk belajar membuat kode."
forgot_learning: "Saya pikir mereka benar-benar lupa bahwa mereka sebenarnya belajar tentang sesuatu."
wanted_to_do: "Belajar membuat kode adalah sesuatu yang selalu saya ingin lakukan, dan saya tidak pernah berpikir saya akan bisa mempelajarinya di sekolah."
builds_concepts_up: "Saya suka bagaimana CodeCombat membangun konsep. Sangat mudah dipahami dan menyenangkan."
why_games: "Mengapa belajar melalui bermain sangatlah penting?"
games_reward: "Permainan memberikan imbalan terhadap perjuangan yang produktif."
encourage: "Gaming adalah perantara yang mendorong interaksi, penemuan, dan mencoba-coba. Sebuah permainan yang baik menantang pemain untuk menguasai keterampilan dari waktu ke waktu, yang merupakan proses penting sama yang dilalui siswa saat mereka belajar."
excel: "Permainan unggul dalam memberikan prestasi"
struggle: "Perjuangan yang produktif"
kind_of_struggle: "jenis perjuangan yang menghasilkan pembelajaran yang menarik dan"
motivating: "memotivasi"
not_tedious: "tidak membosankan."
gaming_is_good: "Studi menunjukkan permainan itu baik untuk otak anak-anak. (itu benar!)"
game_based: "Ketika sistem pembelajaran berbasis permainan"
compared: "dibandingkan"
conventional: "terhadap metode pengajaran konvensional, perbedaannya jelas: permainan merupakan pilihan yang lebih baik untuk membantu siswa mempertahankan pengetahuan, berkonsentrasi dan"
perform_at_higher_level: "tampil di tingkat yang lebih tinggi dari prestasi"
feedback: "Permainan juga memberikan umpan balik langsung yang memungkinkan siswa untuk menyesuaikan solusi cara mereka dan memahami konsep-konsep yang lebih holistik, daripada hanya terbatas dengan jawaban “benar” atau “salah” saja."
real_game: "Sebuah permainan yang sebenarnya, dimainkan dengan pengkodean yang nyata."
great_game: "Sebuah permainan yang hebat merupakan lebih dari sekedar lencana dan prestasi - melainkan tentang perjalanan pemain, teka-teki yang dirancang dengan baik, dan kemampuan untuk mengatasi tantangan dengan kepercayaan diri."
agency: "CodeCombat adalah permainan yang memberikan pemain kepercayaan diri dengan mesin ketik kode kami yang kuat, yang membantu pemula dan lanjutan mahasiswa menulis kode yang valid, dan tepat."
request_demo_title: "Ajak siswa-siswamu mulai sekarang!"
request_demo_subtitle: "Meminta demonstrasi dan ajak siswa-siswamu memulai kurang dari satu jam."
get_started_title: "Atur kelas kamu sekarang"
get_started_subtitle: "Atur kelas, tambahkan siswa-siswamu dan pantau perkembangan mereka selama mereka belajar ilmu komputer."
request_demo: "Minta demonstrasi"
request_quote: "Minta Penawaran"
setup_a_class: "Atur Kelas"
have_an_account: "Sudah mempunyai akun?"
logged_in_as: "Kamu saat ini masuk sebagai"
computer_science: "Kursus cepat kami mencakup sintaks dasar sampai konsep lanjutan"
ffa: "Gratis untuk semua siswa"
coming_soon: "Segera hadir!"
courses_available_in: "Kursus tersedia dalam JavaScript dan Python. Kursus Pengembangan Web menggunakan HTML, CSS, dan jQuery"
boast: "Teka-teki yang cukup kompleks untuk memikat pemain dan pengkode."
winning: "Kombinasi yang unggul dari permainan RPG dan pemrograman pekerjaan rumah yang berhasil membuat pendidikan ramah anak yang pasti menyenangkan."
run_class: "Semua yang Anda butuhkan untuk menjalankan kelas ilmu komputer di sekolah Anda hari ini, latar belakang IT tidak diperlukan."
goto_classes: "Pergi ke Kelasku"
view_profile: "Lihat Profilku"
view_progress: "Lihat Kemajuan"
go_to_courses: "Pergi ke Kursusku"
want_coco: "Mau CodeCombat ada di sekolahmu?"
educator: "Pendidik"
student: "Siswa"
our_coding_programs: "Program Coding Kami"
codecombat: "CodeCombat"
ozaria: "Ozaria"
codecombat_blurb: "Game coding asli kami. Direkomendasikan untuk orang tua, individu, pendidik, dan siswa yang ingin merasakan salah satu game coding yang paling disukai di dunia."
ozaria_blurb: "Sebuah game petualangan dan program Ilmu Komputer tempat siswa menguasai keajaiban coding yang hilang untuk menyelamatkan dunia mereka. Direkomendasikan untuk pengajar dan siswa."
try_codecombat: "Coba CodeCombat"
try_ozaria: "Coba Ozaria"
# explore_codecombat: "Explore CodeCombat"
# explore_ai_league: "Explore AI League"
# explore_ozaria: "Explore Ozaria"
# explore_online_classes: "Explore Online Classes"
# explore_pd: "Explore Professional Development"
# new_adventure_game_blurb: "Ozaria is our brand new adventure game and your turnkey solution for teaching Computer science. Our student-facing __slides__ and teacher-facing notes make planning and delivering lessons easier and faster."
# lesson_slides: "lesson slides"
# pd_blurb: "Learn the skills to effectively teach computer science with our self-directed, CSTA-accredited professional development course. Earn up to 40 credit hours any time, from any device. Pairs well with Ozaria Classroom."
# ai_league_blurb: "Competitive coding has never been so epic with this educational esports league, uniquely both an AI battle simulator and game engine for learning real code."
# codecombat_live_online_classes: "CodeCombat Live Online Classes"
# learning_technology_blurb: "Our original game teaches real-world skills through the power of play. The scaffolded curriculum systematically builds on student’s experiences and knowledge as they progress."
# learning_technology_blurb_short: "Our innovative game-based learning technology has transformed the way students learn to code."
# online_classes_blurb: "Our online coding classes combine the power of gameplay and personalized instruction for an experience your child will love. With both private or group options available, this is remote learning that works."
# for_educators: "For Educators"
# for_parents: "For Parents"
# for_everyone: "For Everyone"
# what_our_customers_are_saying: "What Our Customers Are Saying"
# game_based_learning: "Game-Based Learning"
# unique_approach_blurb: "With our unique approach, students embrace learning as they play and write code from the very start of their adventure, promoting active learning and a growth mindset."
# text_based_coding: "Text-Based Coding"
# custom_code_engine_blurb: "Our custom code engine and interpreter is designed for beginners, teaching true Python, JavaScript, and C++ programming languages using human, beginner-friendly terms."
# student_impact: "Student Impact"
# help_enjoy_learning_blurb: "Our products have helped over 20 million students enjoy learning Computer Science, teaching them to be critical, confident, and creative learners. We engage all students, regardless of experience, helping them to realize a pathway to success in Computer Science."
# global_community: "Join Our Global Community"
# million: "__num__ Million"
# billion: "__num__ Billion"
nav:
educators: "Pendidik"
follow_us: "Ikuti Kami"
general: "Utama"
map: "Peta"
play: "Tingkatan" # The top nav bar entry where players choose which levels to play
community: "Komunitas"
courses: "Kursus"
blog: "Blog"
forum: "Forum"
account: "Akun"
my_account: "Akunku"
profile: "Profil"
home: "Beranda"
contribute: "Kontribusi"
legal: "Hukum"
privacy: "Pemberitahuan Privasi"
about: "Tentang"
impact: "Pengaruh"
contact: "Kontak"
twitter_follow: "Ikuti"
my_classrooms: "Kelasku"
my_courses: "Kursusku"
my_teachers: "Guruku"
careers: "Karir"
facebook: "Facebook"
twitter: "Twitter"
create_a_class: "Buat sebuah kelas"
other: "Lain-lain"
learn_to_code: "Belajar membuat kode!"
toggle_nav: "Aktifkan navigasi"
schools: "Sekolah"
get_involved: "Ambil Andil"
open_source: "Open source (GitHub)"
support: "Bantuan"
faqs: "Tanya Jawab"
copyright_prefix: "Hak Cipta"
copyright_suffix: "Seluruh Hak Cipta"
help_pref: "Butuh bantuan? Email"
help_suff: "dan kita akan menghubungi!"
resource_hub: "Pusat Sumber Daya"
apcsp: "Fundamental AP CS"
parent: "Orang Tua"
esports: "Esports"
browser_recommendation: "Untuk pengalaman yang lebih baik, kami merekomendasikan menggunakan browser chrome terbaru. Download browser disini"
# ozaria_classroom: "Ozaria Classroom"
# codecombat_classroom: "CodeCombat Classroom"
# ozaria_dashboard: "Ozaria Dashboard"
# codecombat_dashboard: "CodeCombat Dashboard"
# professional_development: "Professional Development"
# new: "New!"
# admin: "Admin"
# api_dashboard: "API Dashboard"
# funding_resources_guide: "Funding Resources Guide"
modal:
close: "Tutup"
okay: "Baik"
cancel: "Batal"
not_found:
page_not_found: "Laman tidak ditemukan"
diplomat_suggestion:
title: "Bantu menerjemahkan CodeCombat!" # This shows up when a player switches to a non-English language using the language selector.
sub_heading: "Kami membutuhkan kemampuan berbahasamu."
pitch_body: "Kami mengembangkan CodeCombat dalam bahasa Inggris, tapi kami sudah memiliki pemain di seluruh dunia. Banyak dari mereka ingin bermain di Indonesia, tetapi tidak berbicara bahasa Inggris, jadi jika Anda dapat menguasai kedua bahasa tersebut, silakan mempertimbangkan untuk mendaftar untuk menjadi Diplomat dan membantu menerjemahkan kedua situs CodeCombat dan semua tingkatan ke Bahasa Indonesia."
missing_translations: "Hingga kami bisa menerjemahkan semuanya ke dalam bahasa Indonesia, Anda akan melihat bahasa Inggris ketika bahasa Indonesia belum tersedia."
learn_more: "Pelajari lebih lanjut tentang menjadi seorang Diplomat"
subscribe_as_diplomat: "Berlangganan sebagai seorang Diplomat"
# new_home_faq:
# what_programming_languages: "What programming languages are available?"
# python_and_javascript: "We currently support Python and JavaScript."
# why_python: "Why should you choose Python?"
# why_python_blurb: "Python is both beginner-friendly and currently used by major corporations (such as Google). If you have younger or first-time learners, we strongly recommend Python."
# why_javascript: "Why should you choose JavaScript?"
# why_javascript_blurb: "JavaScript is the language of the web and is used across nearly every website. You may prefer to choose JavaScript if you are planning to also study web development. We’ve also made it easy for students to transition from Python to JavaScript-based web development."
# javascript_versus_python: "JavaScript’s syntax is a little more difficult for beginners than Python, so if you cannot decide between the two, we recommend Python."
# how_do_i_get_started: "How do I get started?"
# getting_started_1: "Create your Teacher Account"
# getting_started_2: "Create a class"
# getting_started_3: "Add students"
# getting_started_4: "Sit back and watch your students have fun learning to code"
# main_curriculum: "Can I use CodeCombat or Ozaria as my main curriculum?"
# main_curriculum_blurb: "Absolutely! We’ve spent time consulting with education specialists to craft classroom curriculum and materials specifically for teachers who are using CodeCombat or Ozaria without any prior computer science experience themselves. Many schools are implementing CodeCombat and/or Ozaria as the main computer science curriculum."
# clever_instant_login: "Does CodeCombat and Ozaria support Clever Instant Login?"
# clever_instant_login_blurb: "Yes! Check out our __clever__ for more details on how to get started."
# clever_integration_faq: "Clever Integration FAQ"
# google_classroom: "What about Google Classroom?"
# google_classroom_blurb1: "Yup! Be sure to use the Google Single Sign-On (SSO) Modal to sign up for your teacher account. If you already have an account using your Google email, use the Google SSO modal to log in next time. In the Create Class modal, you will see an option to Link Google Classroom. We only support rostering via Google Classroom at this time."
# google_classroom_blurb2: "Note: you must use Google SSO to sign up or log in at least once in order to see the Google Classroom integration option."
# how_much_does_it_cost: "How much does it cost to access all of the available courses and resources?"
# how_much_does_it_cost_blurb: "We customize solutions for schools and districts and work with you to understand your use case, context, and budget. __contact__ for further details! See also our __funding__ for how to leverage CARES Act funding sources like ESSER and GEER."
# recommended_systems: "Is there a recommended browser and operating system?"
# recommended_systems_blurb: "CodeCombat and Ozaria run best on computers with at least 4GB of RAM, on a modern browser such as Chrome, Safari, Firefox, or Edge. Chromebooks with 2GB of RAM may have minor graphics issues in later courses. A minimum of 200 Kbps bandwidth per student is required, although 1+ Mbps is recommended."
# other_questions: "If you have any other questions, please __contact__."
play:
title: "Mainkan Level CodeCombat - Pelajari Python, JavaScript, dan HTML"
meta_description: "Pelajari pemrograman dengan permainan pengkodean untuk pemula. Pelajari Python atau JavaScript saat Anda memecahkan labirin, membuat game Anda sendiri, dan naik level. Tantang teman Anda di level arena multipemain!"
level_title: "__level__ - Belajar Membuat Kode dengan Python, JavaScript, HTML"
video_title: "__video__ | Tingkat Video"
game_development_title: "__level__ | Pengembangan Game"
web_development_title: "__level__ | Pengembangan Web"
anon_signup_title_1: "CodeCombat memiliki"
anon_signup_title_2: "Versi Ruang Kelas!"
anon_signup_enter_code: "Masukkan Kode Kelas:"
anon_signup_ask_teacher: "Belum punya? Tanya guru Anda!"
anon_signup_create_class: "Ingin membuat kelas?"
anon_signup_setup_class: "Siapkan kelas, tambahkan siswa Anda, dan pantau kemajuan!"
anon_signup_create_teacher: "Buat akun guru gratis"
play_as: "Main sebagai" # Ladder page
get_course_for_class: "Berikan Pengembangan Game dan lainnya ke kelasmu!"
request_licenses: "Hubungi spesialis sekolah kami untuk rinciannya"
compete: "Bertanding!" # Course details page
spectate: "Tonton" # Ladder page
simulate_all: "Simulasikan Semua"
players: "pemain" # Hover over a level on /play
hours_played: "jam bermain" # Hover over a level on /play
items: "Barang" # Tooltip on item shop button from /play
unlock: "Buka" # For purchasing items and heroes
confirm: "Konfirmasi"
owned: "Dipunyai" # For items you own
locked: "Terkunci"
available: "Tersedia"
skills_granted: "Kemampuan Diberikan" # Property documentation details
heroes: "Jagoan" # Tooltip on hero shop button from /play
achievements: "Prestasi" # Tooltip on achievement list button from /play
settings: "Pengaturan" # Tooltip on settings button from /play
poll: "Poll" # Tooltip on poll button from /play
next: "Lanjut" # Go from choose hero to choose inventory before playing a level
change_hero: "Ganti Jagoan" # Go back from choose inventory to choose hero
change_hero_or_language: "Ganti Jagoan atau Bahasa"
buy_gems: "Beli Permata"
subscribers_only: "Hanya untuk yang pelanggan!"
subscribe_unlock: "Berlangganan untuk membuka!"
subscriber_heroes: "Berlangganan sekarang untuk segera membuka Amara, Hushbaum, and Hattori!"
subscriber_gems: "Berlangganan sekarang untuk membeli jagoan ini dengan permata!"
anonymous: "Pemain tak bernama"
level_difficulty: "Kesulitan: "
awaiting_levels_adventurer_prefix: "Kami meliris level baru setiap minggunya"
awaiting_levels_adventurer: "Daftar sebagai seorang Petualang"
awaiting_levels_adventurer_suffix: "Untuk menjadi yang pertama memainkan level baru."
adjust_volume: "Atur suara"
campaign_multiplayer: "Arena Multipemain"
campaign_multiplayer_description: "... dimana kamu membuat kode satu lawan satu melawan pemain lainnya."
brain_pop_done: "Kamu telah mengalahkan Raksasa dengan kode! Kamu menang!"
brain_pop_challenge: "Tantang dirimu untuk bermain lagi menggunakan bahasa pemrograman yang berbeda!"
replay: "Ulang"
back_to_classroom: "Kembali ke Kelas"
teacher_button: "Untuk Guru"
get_more_codecombat: "Dapatkan Lebih Lagi CodeCombat"
code:
if: "jika" # Keywords--these translations show up on hover, so please translate them all, even if it's kind of long. (In the code editor, they will still be in English.)
else: "lainnya"
elif: "jika lainnya"
while: "selama"
loop: "ulangi"
for: "untuk"
break: "berhenti"
continue: "lanjutkan"
pass: "lewati"
return: "kembali"
then: "kemudian"
do: "lakukan"
end: "selesai"
function: "fungsi"
def: "definisi"
var: "variabel"
self: "diri"
hero: "pahlawan"
this: "ini"
or: "atau"
"||": "atau"
and: "dan"
"&&": "dan"
not: "bukan"
"!": "tidak"
"=": "menentukan"
"==": "sama dengan"
"===": "sama persis"
"!=": "tidak sama dengan"
"!==": "tidak sama persis"
">": "lebih besar dari"
">=": "lebih besar dari atau sama dengan"
"<": "kurang dari"
"<=": "kurang dari atau sama"
"*": "dikalikan dengan"
"/": "dibagi dengan"
"+": "penambahan"
"-": "pengurangan"
"+=": "tambahkan dan tetapkan"
"-=": "kurangi dan tetapkan"
True: "Betul"
true: "betul"
False: "Salah"
false: "salah"
undefined: "tidak didefinisikan"
null: "null"
nil: "nihil"
None: "Tidak ada"
share_progress_modal:
blurb: "Kamu membuat kemajuan yang besar! Beritahu orang tuamu berapa banyak kamu telah pelajari dengan CodeCombat."
email_invalid: "Alamat email tidak valid."
form_blurb: "Masukkan alamat email orang tuamu dibawah dan kami akan beritahu mereka!"
form_label: "Alamat Email"
placeholder: "alamat email"
title: "Kerja yang sangat bagus, Murid"
login:
sign_up: "Buat Akun"
email_or_username: "Email atau username"
log_in: "Masuk"
logging_in: "Sedang masuk"
log_out: "Keluar"
forgot_password: "Lupa dengan passwordmu?"
finishing: "Finishing"
sign_in_with_facebook: "Masuk dengan Facebook"
sign_in_with_gplus: "Masuk dengan Google"
signup_switch: "Ingin membuat akun?"
accounts_merge_confirmation: "Akun tersebut telah digunakan oleh akun google yang lain. Apakah anda ingin menggabungkan kedua akun tersebut?"
signup:
complete_subscription: "Berlanggangan Penuh"
create_student_header: "Membuat Akun Siswa"
create_teacher_header: "Membuat Akun Guru"
create_individual_header: "Membuat Akun Individual"
email_announcements: "Menerima berita mengenai level CodeCombat dan fitur yang baru!"
sign_in_to_continue: "Masuk atau buat akun baru untuk lanjut"
# create_account_to_submit_multiplayer: "Create a free account to rank your multiplayer AI and explore the whole game!"
teacher_email_announcements: "Selalu berikan informasi saya materi, kurikulum, dan kursus!"
creating: "Membuat Akun..."
sign_up: "Masuk"
log_in: "masuk dengan kata sandi"
login: "Masuk"
required: "Kamu wajib masuk sebelum bisa melanjutkannya"
login_switch: "Sudah memiliki akun?"
optional: "opsional"
connected_gplus_header: "Kamu berhasil terhubung dengan Google+"
connected_gplus_p: "Selesaikan pendaftaran supaya kamu bisa masuk dengan akun Google+ milikmu"
connected_facebook_header: "Kamu berhasil terhubung dengan Facebook!"
connected_facebook_p: "Selesaikan pendaftaran supaya kamu bisa terhubung dengan akun Facebook milikmu"
hey_students: "Murid-murid, silakan masukkan kode kelas dari gurumu"
birthday: "Tanggal lahir"
parent_email_blurb: "Kamu tahu bahwa kamu tidak dapat menunggu untuk belajar pemrograman — kamipun juga sangat senang! Orang tua kalian akan menerima email dengan instruksi lebih lanjut tentang membuat akun untukmu. Silakan email {{email_link}} jika kamu memiliki pertanyaan."
classroom_not_found: "Tidak ada kelas dengan Kode Kelas ini. Cek kembali penulisannya atau mintalah bantuan kepada gurumu"
checking: "Sedang mengecek..."
account_exists: "Email ini telah digunakan:"
sign_in: "Masuk"
email_good: "Email dapat digunakan!"
name_taken: "Nama pengguna sudah diambil! Ingin mencoba {{suggestedName}}?"
name_available: "Nama pengguna tersedia!"
name_is_email: "Nama pengguna tidak boleh berupa email"
choose_type: "Pilih tipe akunmu:"
teacher_type_1: "Mengajarkan pemrograman menggunakan CodeCombat!"
teacher_type_2: "Mempersiapkan kelasmu"
teacher_type_3: "Mengakses Panduan Kursus"
teacher_type_4: "Melihat perkembangan siswa"
signup_as_teacher: "Masuk sebagai guru"
student_type_1: "Mempelajari cara pemrograman sambil bermain sebuah permainan yang menarik!"
student_type_2: "Bermain dengan kelasmu"
student_type_3: "Bersaing dalam arena"
student_type_4: "Pilih jagoanmu!"
student_type_5: "Persiapkan Kode Kelasmu!"
signup_as_student: "Masuk sebagai siswa"
individuals_or_parents: "Individu dan Orang Tua"
individual_type: "Untuk pemain yang belajar kode di luar kelas. Para orang tua harus mendaftar akun di sini"
signup_as_individual: "Daftar sebagai individu"
enter_class_code: "Masukkan Kode Kelas kamu"
enter_birthdate: "Masukkan tanggal lahirmu:"
parent_use_birthdate: "Para orang tua, gunakan tanggal lahirmu."
ask_teacher_1: "Tanyakan gurumu untuk Kode Kelas kamu"
ask_teacher_2: "Bukan bagian dari kelas? Buatlah"
ask_teacher_3: "Akun Individu"
ask_teacher_4: " sebagai gantinya."
about_to_join: "Kamu akan bergabung:"
enter_parent_email: "Masukkan email orang tua kamu:"
parent_email_error: "Terjadi kesalahan ketika mencoba mengirim email. Cek alamat email dan coba lagi."
parent_email_sent: "Kamu telah mengirim email dengan instruksi lebih lanjut tentang cara membuat akun. Tanyakan orang tua kamu untuk mengecek kotak masuk mereka."
account_created: "Akun Telah Dibuat!"
confirm_student_blurb: "Tulislah informasi kamu supaya kamu tidak lupa. Gurumu juga dapat membantu untuk mereset kata sandi kamu setiap saat."
confirm_individual_blurb: "Tulis informasi masuk kamu jika kamu membutuhkannya lain waktu. Verifikasi email kamu supaya kamu dapat memulihkan akun kamu jika kamu lupa kata sandimu - check kotak masukmu!"
write_this_down: "Tulislah ini:"
start_playing: "Mulai Bermain!"
sso_connected: "Berhasil tersambung dengan:"
select_your_starting_hero: "Pilihlah Jagoan Awalmu:"
you_can_always_change_your_hero_later: "Kamu dapat mengganti jagoanmu nanti."
finish: "Selesai"
teacher_ready_to_create_class: "Kamu telah siap untuk membuat kelas pertamamu!"
teacher_students_can_start_now: "Siswa-siswamu dapat mulai bermain di kursus pertama, Pengenalan dalam Ilmu Komputer, segera."
teacher_list_create_class: "Di layar berikut, kamu akan dapat membuat sebuah kelas."
teacher_list_add_students: "Tambahkan siswa-siswa ke dalam kelas dengan mengklik link Lihat Kelas, lalu kirimkan siswa-siswamu ke dalam Kode Kelas atau URL. Kamu juga dapat mengundang mereka dari email jika mereka memiliki alamat email."
teacher_list_resource_hub_1: "Periksalah"
teacher_list_resource_hub_2: "Petunjuk Kursus"
teacher_list_resource_hub_3: "Untuk penyelesaian di setiap level, dan"
teacher_list_resource_hub_4: "Pusat Materi"
teacher_list_resource_hub_5: "untuk panduan kurikulum, aktifitas, dan lainnya!"
teacher_additional_questions: "Itu saja! Jika kamu memerlukan tambahan bantuan atau pertanyaan, jangkaulah di __supportEmail__."
dont_use_our_email_silly: "Jangan taruh email kami di sini! Taruhlah di email orangtuamu"
want_codecombat_in_school: "Ingin bermain CodeCombat setiap saat?"
eu_confirmation: "Saya setuju untuk mengizinkan CodeCombat menyimpan data saya di server AS."
eu_confirmation_place_of_processing: "Pelajari lebih lanjut tentang kemungkinan risikonya"
eu_confirmation_student: "Jika Anda tidak yakin, tanyakan pada guru Anda."
eu_confirmation_individual: "Jika Anda tidak ingin kami menyimpan data Anda di server AS, Anda dapat terus bermain secara anonim tanpa menyimpan kode Anda."
password_requirements: "8 hingga 64 karakter tanpa pengulangan"
invalid: "Tidak valid"
invalid_password: "Kata sandi salah"
with: "dengan"
want_to_play_codecombat: "Tidak, saya tidak punya satu pun tapi ingin bermain CodeCombat!"
have_a_classcode: "Punya Kode Kelas?"
yes_i_have_classcode: "Ya, saya memiliki Kode Kelas!"
enter_it_here: "Masukkan di sini:"
recover:
recover_account_title: "Pulihkan Akun"
send_password: "Kirim Pemulihan Kata Sandi"
recovery_sent: "Email pemulihan telah dikirim"
items:
primary: "Primer"
secondary: "Sekunder"
armor: "Baju Pelindung"
accessories: "Aksesoris"
misc: "Lain-lain"
books: "Buku-buku"
common:
default_title: "CodeCombat - Coding game untuk belajar Python dan JavaScript"
default_meta_description: "Pelajari kode yang diketik melalui permainan pemrograman. Pelajari Python, JavaScript, dan HTML sambil Anda memecahkan teka-teki dan belajar membuat game dan situs web pengkodean Anda sendiri."
back: "Kembali" # When used as an action verb, like "Navigate backward"
coming_soon: "Segera Hadir!"
continue: "Lanjutkan" # When used as an action verb, like "Continue forward"
next: "Selanjutnya"
default_code: "Kode Asli"
loading: "Memuat..."
overview: "Ikhtisar"
processing: "Memproses..."
solution: "Solusi"
table_of_contents: "Daftar Isi"
intro: "Pengenalan"
saving: "Menyimpan..."
sending: "Mengirim..."
send: "Kirim"
sent: "Terkirim"
cancel: "Batal"
save: "Simpan"
publish: "Publikasi"
create: "Buat"
fork: "Cabangkan"
play: "Mainkan" # When used as an action verb, like "Play next level"
retry: "Coba Lagi"
actions: "Aksi-aksi"
info: "Info"
help: "Bantuan"
watch: "Tonton"
unwatch: "Berhenti Menonton"
submit_patch: "Kirim Perbaikan"
submit_changes: "Kirim Perubahan"
save_changes: "Simpan Perubahan"
required_field: "wajib"
submit: "Kirim"
replay: "Ulangi"
complete: "Selesai"
# pick_image: "Pick Image"
general:
and: "dan"
name: "Nama"
date: "Tanggal"
body: "Badan"
version: "Versi"
pending: "Tertunda"
accepted: "Diterima"
rejected: "Ditolak"
withdrawn: "Ditarik"
accept: "Terima"
accept_and_save: "Terima&Simpan"
reject: "Tolak"
withdraw: "Tarik"
submitter: "Yang Mengajukan"
submitted: "Diajukan"
commit_msg: "Pesan Perubahan"
version_history: "Histori Versi"
version_history_for: "Histori Versi Untuk: "
select_changes: "Pilih dua perubahan dibawah untuk melihat perbedaan."
undo_prefix: "Urung"
undo_shortcut: "(Ctrl+Z)"
redo_prefix: "Ulangi"
redo_shortcut: "(Ctrl+Shift+Z)"
play_preview: "Mainkan pratinjau untuk level saat ini"
result: "Hasil"
results: "Hasil"
description: "Deskripsi"
or: "atau"
subject: "Subjek"
email: "Email"
password: "Kata Kunci"
confirm_password: "Konfirmasi Kata Kunci"
message: "Pesan"
code: "Kode"
ladder: "Tangga"
when: "Ketika"
opponent: "Lawan"
rank: "Peringkat"
score: "Skor"
win: "Menang"
loss: "Kalah"
tie: "Imbang"
easy: "Mudah"
medium: "Sedang"
hard: "Sulit"
player: "Pemain"
player_level: "Level" # Like player level 5, not like level: Dungeons of Kithgard
warrior: "Kesatria"
ranger: "Pemanah"
wizard: "Penyihir"
first_name: "Nama Awal"
last_name: "Nama Akhir"
last_initial: "Inisial Akhir"
username: "Username"
contact_us: "Hubungi Kami"
close_window: "Tutup Jendela"
learn_more: "Pelajari Lagi"
more: "Lebih Banyak"
fewer: "Lebih Sedikit"
with: "dengan"
chat: "Obrolan"
chat_with_us: "Bicaralah dengan kami"
email_us: "Kirimkan email kepada kami"
sales: "Penjualan"
support: "Dukungan"
# here: "here"
units:
second: "detik"
seconds: "detik"
sec: "dtk"
minute: "menit"
minutes: "menit"
hour: "jam"
hours: "jam"
day: "hari"
days: "hari"
week: "minggu"
weeks: "minggu"
month: "bulan"
months: "bulan"
year: "tahun"
years: "tahun"
play_level:
back_to_map: "Kembali ke Peta"
directions: "Arah"
edit_level: "Edit Level"
keep_learning: "Terus Belajar"
explore_codecombat: "Jelajahi CodeCombat"
finished_hoc: "Saya sudah menyelesaikan Jam Code saya"
get_certificate: "Dapatkan sertifikatmu!"
level_complete: "Level Tuntas"
completed_level: "Level yang terselesaikan:"
course: "Kursus:"
done: "Selesai"
next_level: "Level Selanjutnya"
combo_challenge: "Combo Tantangan"
concept_challenge: "Tantangan Konsep"
challenge_unlocked: "Tantangan Terbuka"
combo_challenge_unlocked: "Tantangan Combo Terbuka"
concept_challenge_unlocked: "Tantangan Konsep Terbuka"
concept_challenge_complete: "Tantangan Konsep Selesai!"
combo_challenge_complete: "Tantangan Combo Selesai!"
combo_challenge_complete_body: "Kerja bagus, sepertinya kamu telah mengerti __concept__ dengan baik dalam perjalananmu!"
replay_level: "Ulang Level"
combo_concepts_used: "__complete__/__total__ Konsep Digunakan"
combo_all_concepts_used: "Kamu telah menggunakan semua kemungkinan konsep untuk memecahkan tantangannya. Kerja Bagus!"
combo_not_all_concepts_used: "Kamu telah menggunakan __complete__ dari __total__ kemungkinan konsep untuk menyelesaikan tantangan. Cobalah untuk menggunakan semua __total__ konsep di lain waktu!"
start_challenge: "Memulai Tantangan"
next_game: "Permainan berikutnya"
languages: "Bahasa"
programming_language: "Bahasa pemrograman"
show_menu: "Tampilkan menu permainan"
home: "Beranda" # Not used any more, will be removed soon.
level: "Level" # Like "Level: Dungeons of Kithgard"
skip: "Lewati"
game_menu: "Menu Permainan"
restart: "Mengulang"
goals: "Tujuan"
goal: "Tujuan"
challenge_level_goals: "Tujuan Tantangan Level"
challenge_level_goal: "Tujuan Tantangan Level"
concept_challenge_goals: "Tujuan Tantangan Konsep"
combo_challenge_goals: "Tujuan Tantangan Level"
concept_challenge_goal: "Tujuan Tantangan Konsep"
combo_challenge_goal: "Tujuan Tantangan Level"
running: "Jalankan..."
success: "Berhasil!"
incomplete: "Belum selesai"
timed_out: "Kehabisan waktu"
failing: "Gagal"
reload: "Muat Ulang"
reload_title: "Muat Ulang Semua Kode?"
reload_really: "Apakah kamu yakin ingin memuat ulang semua level kembali ke awal mula?"
reload_confirm: "Muat Ulang Semua"
restart_really: "Anda yakin ingin memulai ulang level? Anda akan kehilangan semua kode yang Anda tulis."
restart_confirm: "Ya, Muat Ulang"
test_level: "Tes Level"
victory: "Menang"
victory_title_prefix: ""
victory_title_suffix: " Selesai"
victory_sign_up: "Daftar untuk Menyimnpan Proses"
victory_sign_up_poke: "Ingin menyimpan kodemu? Buatlah akun gratis!"
victory_rate_the_level: "Seberapa menyenangkan level ini?"
victory_return_to_ladder: "Kembali ke Tingkatan"
victory_saving_progress: "Menyimpan Perkembangan"
victory_go_home: "Kembali ke Beranda"
victory_review: "Beritahu kami lebih lagi!"
victory_review_placeholder: "Bagaimana dengan levelnya?"
victory_hour_of_code_done: "Apakah Kamu Selesai?"
victory_hour_of_code_done_yes: "Ya, saya telah menyelesaikan Jam Kode saya"
victory_experience_gained: "XP Didapat"
victory_gems_gained: "Permata Didapat"
victory_new_item: "Barang Baru"
victory_new_hero: "Jagoan Baru"
victory_viking_code_school: "Ya ampun, Itu adalah level yang sulit yang telah kamu selesaikan! Jika kamu belum menjadi pengembang perangkat lunak, kamu seharusnya jadi. Kamu mendapatkan jalur cepat untuk diterima di Viking Code School, dimana kamu dapat mengambil kemampuanmu di level berikutnya dan menjadi pengembang web profesional dalam 14 minggu."
victory_become_a_viking: "Menjadi seorang Viking"
victory_no_progress_for_teachers: "Perkembangan tidak dapat disimpan untuk guru. Tetapi kamu dapat menambahkan akun siswa ke dalam kelasmu untuk dirimu"
tome_cast_button_run: "Jalankan"
tome_cast_button_running: "Berjalan"
tome_cast_button_ran: "Telah berjalan"
tome_cast_button_update: "Perbarui"
tome_submit_button: "Submit"
tome_reload_method: "Memuat ulang kode asli untuk mengulang level"
tome_your_skills: "Kemampuan Kamu"
hints: "Petunjuk"
videos: "Video"
hints_title: "Petunjuk {{number}}"
code_saved: "Kode disimpan"
skip_tutorial: "Lewati (esc)"
keyboard_shortcuts: "Tombol Pintas"
loading_start: "Memulai Level"
loading_start_combo: "Memulai Tantangan Combo"
loading_start_concept: "Memulai Tantangan Konsep"
problem_alert_title: "Perbaiki Kode Kamu"
time_current: "Sekarang:"
time_total: "Maks:"
time_goto: "Menuju ke:"
non_user_code_problem_title: "Tidak dapat memuat ulang Level"
infinite_loop_title: "Perulangan Tak Terhingga Terdeteksi"
infinite_loop_description: "Kode awal untuk membangun dunia tidak pernah selesai. Kemungkinan karena sangat lambat atau terjadi perulangan tak terhingga. Atau mungkin ada kesalahan. Kamu dapat mencoba menjalankan kode ini kembali atau mengulang kode ke keadaan semula. Jika masih tidak bisa, tolong beritahu kami."
check_dev_console: "Kamu dapat membuka developer console untuk melihat apa yang menjadi penyebab kesalahan"
check_dev_console_link: "(instruksi-instruksi)"
infinite_loop_try_again: "Coba Lagi"
infinite_loop_reset_level: "Mengulang Level"
infinite_loop_comment_out: "Mengkomentari Kode Saya"
tip_toggle_play: "Beralih mulai/berhenti dengan Ctrl+P"
tip_scrub_shortcut: "Gunakan Ctrl+[ dan Ctrl+] untuk memutar ulang dan mempercepat."
tip_guide_exists: "Klik panduan, di dalam menu (di bagian atas halaman), untuk info yang bermanfaat."
tip_open_source: "CodeCombat adalah bagian dari komunitas sumber terbuka!"
tip_tell_friends: "Menikmati CodeCombat? Ceritakan kepada temanmu mengenai kami!"
tip_beta_launch: "CodeCombat diluncurkan beta di Oktober 2013."
tip_think_solution: "Pikirkan solusinya, bukan masalahnya."
tip_theory_practice: "Dalam teori, tidak ada perbedaan antara teori dan praktek. Tetapi dalam praktek, ada bedanya. - Yogi Berra"
tip_error_free: "Ada dua cara untuk menulis program yang bebas dari error; tetapi hanya cara ketiga yang berhasil. - Alan Perlis"
tip_debugging_program: "Jika men-debug adalah proses menghilangkan bugs, maka memprogram pastilah proses menaruhnya kembali. - Edsger W. Dijkstra"
tip_forums: "Pergilah menuju ke forum dan ceritakan apa yang kamu pikirkan!"
tip_baby_coders: "Di masa depan, bahkan para bayi akan menjadi Penyihir Tinggi."
tip_morale_improves: "Proses pemuatan akan dilanjutkan sampai moral naik."
tip_all_species: "Kami percaya bahwa ada kesempatan yang sama untuk belajar pemrograman untuk semua spesies."
tip_reticulating: "Retikulasi tulang belakang."
tip_harry: "Kamu seorang penyihir, "
tip_great_responsibility: "Dengan kemampuan koding yang besar, timbul tanggung jawab men-debug yang besar."
tip_munchkin: "Jika kamu tidak memakan sayuranmu, maka seekor munchkin akan datang kepadamu selagi kamu tertidur."
tip_binary: "Hanya ada 10 tipe orang yang ada di dunia: Mereka yang mengerti biner, dan mereka yang tidak."
tip_commitment_yoda: "Seorang programmer harus memiliki komitmen yang paling dalam, pikiran yang paling serius. ~ Yoda"
tip_no_try: "Lakukan. Atau tidak. Tidak ada coba-coba. - Yoda"
tip_patience: "Kesabaran kamu harus miliki, Padawan muda. - Yoda"
tip_documented_bug: "Sebuah dokumentasi bugs bukanlah bugs; tetapi sebuah fitur."
tip_impossible: "Selalu saja terlihat tidak mungkin sampai hal itu berhasil. - Nelson Mandela"
tip_talk_is_cheap: "Bicara itu mudah. Tunjukkan kepadaku kodenya. - Linus Torvalds"
tip_first_language: "Hal malapetaka yang pernah kamu pelajari adalah bahasa pemrograman pertamamu. - Alan Kay"
tip_hardware_problem: "Q: Berapa banyak programmer yang dibutuhkan untuk mengganti bohlam lampu? A: Tidak ada, Itu adalah masalah perangkat keras."
tip_hofstadters_law: "Hukum Hofstadter: Selalu saja lebih lama dari yang kamu perkirakan, bahkan ketika kamu memperhitungkan Hukum Hofstadter."
tip_premature_optimization: "Optimasi yang prematur adalah akar dari semua keburukan. - Donald Knuth"
tip_brute_force: "Jika ragu-ragu, gunakanlah kebrutalan. - Ken Thompson"
tip_extrapolation: "Ada dua tipe orang: mereka yang mampu mengekstrapolasi dari data yang tidak lengkap..."
tip_superpower: "Koding adalah hal yang paling dekat bahwa kita memiliki kekuatan super."
tip_control_destiny: "Dalam sumber terbuka sebenarnya, kamu memiliki hak untuk mengontrol nasibmu. Linus Torvalds"
tip_no_code: "Tanpa kode lebih cepat daripada tidak tidak mengkode"
tip_code_never_lies: "Kode tidak pernah berbohong, tetapi komentar kadang-kadang. - Ron Jeffries"
tip_reusable_software: "Sebelum perangkat lunak dapat digunakan kembali, pertama-tama dia harus bisa digunakan."
tip_optimization_operator: "Semua pemrograman memiliki operator yang dioptimasi. Dalam semua bahasa operator tersebut adalah ‘//’"
tip_lines_of_code: "Mengukur kemajuan pemrograman dari jumlah baris kode sama seperti mengukur proses pembuatan pesawat terbang dari beratnya. - Bill Gates"
tip_source_code: "Aku ingin mengubah dunia tetapi mereka tidak memberikan aku kode sumbernya."
tip_javascript_java: "Java adalah untuk JavaScript sama seperti Bis dengan Biskuit. - Chris Heilmann"
tip_move_forward: "Apapun yang telah kamu lakukan, tetaplah bergerak ke depan. - Martin Luther King Jr."
tip_google: "Punya masalah yang tidak dapat kamu pecahkan? Google saja!"
tip_adding_evil: "Menambahkan sejumput kejahatan."
tip_hate_computers: "Ada sesuatu mengenai orang yang berpikir bahwa mereka benci komputer. Tetapi yang mereka benci sebenarnya adalah programmer yang buruk. - Larry Niven"
tip_open_source_contribute: "Kamu dapat membantu CodeCombat menjadi lebih baik!"
tip_recurse: "Mengulang adalah manusiawi, Rekursi adalah ilahi. - L. Peter Deutsch"
tip_free_your_mind: "Kamu harus membiarkan semua berlalu, Neo. Ketakutan, keraguan, ketidak percayaan. Bebaskan pikiranmu - Morpheus"
tip_strong_opponents: "Bahkan lawan yang paling kuat sekalipun selalu memiliki kelemahan. Itachi Uchiha"
tip_paper_and_pen: "Sebelum kamu memulai mengkode, kamu dapat selalu berencana dengan sebuah kertas dan sebuah pena."
tip_solve_then_write: "Pertama-tama, pecahkan masalah. Lalu, tulislah kodenya. - John Johnson"
tip_compiler_ignores_comments: "Kadang-kadang saya berpikir bahwa compiler acuh kepada komentar saya."
tip_understand_recursion: "Salah satu cara untuk mengerti rekursif adalah mengerti apa itu rekursif"
tip_life_and_polymorphism: "Sumber Terbuka adalah seperti banyak bentuk struktur yang heterogen: Semua tipe dipersilakan."
tip_mistakes_proof_of_trying: "Kesalahan di kode kamu hanyalah sebuah bukti bahwa kamu sedang mencoba."
tip_adding_orgres: "Membulatkan raksasa."
tip_sharpening_swords: "Menajamkan pedang-pedang"
tip_ratatouille: "Kamu tidak boleh membiarkan semua orang mendefinisikan batasmu, karena tempat asalmu. Batasmu hanyalah jiwamu. - Gusteau, Ratatouille"
tip_nemo: "Ketika kehidupan membuatmu patah semangat, ingin tahu apa yang harus kamu lakukan? Tetaplah berenang, tetaplah berenang. Dory, Finding Nemo"
tip_internet_weather: "Baru saja pindah ke internet, di sini sangatlah baik. Kami bisa hidup di dalam di mana cuaca selalu luar biasa. - John Green"
tip_nerds: "Kutu buku diperbolehkan untuk menyukai sesuatu, seperti melompat-naik-turun-di-kursi-tidak-dapat-mengontrol-diri suka sekali. - John Green"
tip_self_taught: "Saya mengajari diri saya 90% dari apa yang telah saya pelajari. Dan itu normal! - Hank Green"
tip_luna_lovegood: "Jangan khawatir, karena kamu sama warasnya dengan aku. - Luna Lovegood"
tip_good_idea: "Cara terbaik untuk memiliki ide baik adalah memiliki ide yang sangat banyak. - Linus Pauling"
tip_programming_not_about_computers: "Ilmu Komputer tidak hanya mengenai komputer sama seperti astronomi tidak hanya seputar teropong. - Edsger Dijkstra"
tip_mulan: "Percayalah apa yang kamu bisa, maka kamu bisa. - Mulan"
project_complete: "Proyek Selesai!"
share_this_project: "Bagikan proyek ini dengan teman-teman atau keluarga:"
ready_to_share: "Siap untuk mempublikasikan proyekmu?"
click_publish: "Klik \"Publikasi\" untuk membuatnya muncul di galeri kelas, lalu cek apakah yang teman sekelasmu buat! Kamu dapat kembali lagi dan melanjutkan proyek ini. Segala perubahan akan secara otomatis disimpan dan dibagikan ke teman sekelas."
already_published_prefix: "Perubahan kamu telah dipublikasikan ke galeri kelas"
already_published_suffix: "Tetaplah bereksperimen dan membuat proyek ini menjadi lebih baik, atau apa saja yang kelasmu telah buat! Perubahanmu akan secara otomatis disimpan dan dibagikan dengan seluruh teman sekelasmu."
view_gallery: "Lihat Galeri"
project_published_noty: "Level kamu telah dipublikasikan!"
keep_editing: "Tetap Sunting"
learn_new_concepts: "Pelajari konsep baru"
watch_a_video: "Tonton video di __concept_name__"
concept_unlocked: "Konsep Tidak Terkunci"
use_at_least_one_concept: "Gunakan setidaknya satu konsep:"
command_bank: "Bank Perintah"
learning_goals: "Tujuan belajar"
start: "Mulai"
vega_character: "Karakter Vega"
click_to_continue: "Klik untuk Melanjutkan"
fill_in_solution: "Isi solusi"
# play_as_humans: "Play As Red"
# play_as_ogres: "Play As Blue"
apis:
methods: "Metode"
events: "Event"
handlers: "Penangan"
properties: "Properti"
snippets: "Cuplikan"
spawnable: "Spawnable"
html: "HTML"
math: "Matematika"
array: "Array"
object: "Objek"
string: "String"
function: "Fungsi"
vector: "Vektor"
date: "Tanggal"
jquery: "jQuery"
json: "JSON"
number: "Number"
webjavascript: "JavaScript"
amazon_hoc:
title: "Terus Belajar dengan Amazon!"
congrats: "Selamat, Anda telah menaklukkan Hour of Code yang menantang itu!"
educate_1: "Sekarang, teruslah belajar tentang coding dan komputasi cloud dengan AWS Educate, program menarik dan gratis dari Amazon untuk siswa dan guru. Dengan AWS Educate, Anda dapat memperoleh lencana keren saat mempelajari dasar-dasar cloud dan pemotongan teknologi canggih seperti game, realitas virtual, dan Alexa. "
educate_2: "Pelajari lebih lanjut dan daftar di sini"
future_eng_1: "Anda juga dapat mencoba membangun keterampilan fakta sekolah Anda sendiri untuk Alexa"
future_eng_2: "di sini"
future_eng_3: "(perangkat tidak diperlukan). Aktivitas Alexa ini dipersembahkan oleh"
future_eng_4: "Insinyur Masa Depan Amazon"
future_eng_5: "program yang menciptakan kesempatan belajar dan bekerja bagi semua siswa K-12 di Amerika Serikat yang ingin mengejar ilmu komputer."
live_class:
title: "Terima kasih!"
content: "Luar biasa! Kami baru saja meluncurkan kelas online langsung."
link: "Siap melanjutkan pengkodean Anda?"
code_quest:
great: "Hebat!"
join_paragraph: "Bergabunglah dengan turnamen pengkodean Python AI internasional terbesar untuk segala usia dan berkompetisi untuk menduduki peringkat teratas papan peringkat! Pertarungan global selama sebulan ini dimulai 1 Agustus dan termasuk hadiah senilai $5.000 dan penghargaan penghargaan tempat kami di virtual mengumumkannya pemenang dan kenali keterampilan pengkodean Anda. "
link: "Klik di sini untuk mendaftar dan belajar lebih lanjut"
global_tournament: "Turnamen Global"
register: "Daftar"
date: "1 Agustus - 31 Agustus"
play_game_dev_level:
created_by: "Dibuat oleh {{name}}"
created_during_hoc: "Dibuat ketika Hour of Code"
restart: "Mengulang Level"
play: "Mainkan Level"
play_more_codecombat: "Mainkan Lebih CodeCombat"
default_student_instructions: "Klik untuk mengontrol jagoan kamu dan menangkan game kamu!"
goal_survive: "Bertahan hidup."
goal_survive_time: "Bertahan hidup selama __seconds__ detik."
goal_defeat: "Kalahkan semua musuh."
goal_defeat_amount: "Kalahkan __amount__ musuh."
goal_move: "Bergerak ke semua tanda X merah"
goal_collect: "Kumpulkan semua barang-barang"
goal_collect_amount: "Kumpulkan __amount__ barang."
game_menu:
inventory_tab: "Inventaris"
save_load_tab: "Simpan/Muat"
options_tab: "Opsi"
guide_tab: "Panduan"
guide_video_tutorial: "Panduan Video"
guide_tips: "Saran"
multiplayer_tab: "Multipemain"
auth_tab: "Daftar"
inventory_caption: "Pakai jagoanmu"
choose_hero_caption: "Memilih jagoan, bahasa"
options_caption: "Mengkonfigurasi pengaturan"
guide_caption: "Dokumen dan saran"
multiplayer_caption: "Bermain bersama teman-teman!"
auth_caption: "Simpan perkembanganmu"
leaderboard:
view_other_solutions: "Lihat Peringkat Pemain"
scores: "Skor"
top_players: "Permain teratas dalam"
day: "Hari ini"
week: "Minggu ini"
all: "Sepanjang waktu"
latest: "Terakhir"
time: "Waktu menang"
damage_taken: "Kerusakan yang Diterima"
damage_dealt: "Kerusakan yang Diberikan"
difficulty: "Kesulitan"
gold_collected: "Emas yang dikumpulkan"
survival_time: "Bertahan Hidup"
defeated: "Lawan yang Dikalahkan"
code_length: "Baris Kode"
score_display: "__scoreType__: __score__"
inventory:
equipped_item: "Terpakai"
required_purchase_title: "Wajib"
available_item: "Tersedia"
restricted_title: "Terlarang"
should_equip: "(klik ganda untuk memakai)"
equipped: "(terpakai)"
locked: "(terkunci)"
restricted: "(terlarang di level ini)"
equip: "Pakai"
unequip: "Lepas"
warrior_only: "Kesatria Saja"
ranger_only: "Pemanah Saja"
wizard_only: "Penyihir Saja"
buy_gems:
few_gems: "Sedikit permata"
pile_gems: "Tumpukan permata"
chest_gems: "Peti penuh permata"
purchasing: "Membeli..."
declined: "Kartumu ditolak"
retrying: "Terjadi kesalahan di server, mencoba kembali"
prompt_title: "Permata Tidak Cukup"
prompt_body: "Ingin mendapatkan lebih?"
prompt_button: "Masuk Toko"
recovered: "Pembelian permata sebelumnya dipulihkan. Silakan perbaharui halaman."
price: "x{{gems}} / bln"
buy_premium: "Beli Premium"
purchase: "Membeli"
purchased: "Terbeli"
subscribe_for_gems:
prompt_title: "Permata Tidak Cukup!"
prompt_body: "Berlangganan Premium untuk mendapatkan permata dan akses ke lebih banyak level!"
earn_gems:
prompt_title: "Permata Tidak Cukup"
prompt_body: "Tetap bermain untuk mendapatkan lebih!"
subscribe:
best_deal: "Transaksi Terbaik!"
confirmation: "Selamat! Kamu telah berlangganan CodeCombat Premium!"
premium_already_subscribed: "Kamu telah berlangganan Premium"
subscribe_modal_title: "CodeCombat Premium"
comparison_blurb: "Menjadi Penguasa Kode - berlangganan <b>Premium</b> hari ini!"
must_be_logged: "Kamu harus masuk terlebih dahulu. Silakan buat akun atau masuk dari menu di atas"
subscribe_title: "Berlangganan" # Actually used in subscribe buttons, too
unsubscribe: "Berhenti Berlangganan"
confirm_unsubscribe: "Konfirmasi Berhenti Berlangganan"
never_mind: "Tidak masalah, Aku Masih Suka Kamu"
thank_you_months_prefix: "Terima kasih telah mendukung kami hingga saat ini"
thank_you_months_suffix: "bulan."
thank_you: "Terima kasih telah mendukung CodeCombat."
sorry_to_see_you_go: "Kami sedih melihat kamu pergi! Tolong beritahu, apa yang bisa kami lakukan untuk menjadi lebih baik."
unsubscribe_feedback_placeholder: "Oh, apa yang telah kami lakukan?"
stripe_description: "Berlangganan Bulanan"
stripe_yearly_description: "Langganan Tahunan"
buy_now: "Beli Sekarang"
subscription_required_to_play: "Kamu butuh berlangganan untuk memainkan level ini."
unlock_help_videos: "Berlangganan untuk membuka semua panduan video."
personal_sub: "Langganan Pribadi" # Accounts Subscription View below
loading_info: "Memuat informasi langganan..."
managed_by: "Diatur oleh"
will_be_cancelled: "Akan dibatalkan"
currently_free: "Kamu memiliki langganan gratis"
currently_free_until: "Kamu saat ini memiliki langganan hingga"
free_subscription: "Berlangganan gratis"
was_free_until: "Kamu memiliki langganan gratis hingga"
managed_subs: "Mengatur Langganan"
subscribing: "Berlangganan..."
current_recipients: "Penerima Saat Ini"
unsubscribing: "Berhenti Berlangganan"
subscribe_prepaid: "Klik Berlangganan untuk menggunakan kode prabayar"
using_prepaid: "Menggunakan kode prabayar untuk berlangganan bulanan"
feature_level_access: "Akses 300+ level tersedia"
feature_heroes: "Membuka jagoan dan peliharaan ekslusif"
feature_learn: "Belajar membuat permainan dan situs web"
feature_gems: "Terima permata __gems__ per bulan"
month_price: "$__price__" # {change}
first_month_price: "Hanya $__price__ untuk bulan pertamamu!"
lifetime: "Akses Seumur Hidup"
lifetime_price: "$__price__"
year_subscription: "Berlangganan Tahunan"
year_price: "$__price__/year" # {change}
support_part1: "Membutuhkan bantuan pembayaran atau memilih PayPal? Email"
support_part2: "support@codecombat.com"
announcement:
now_available: "Sekarang tersedia untuk pelanggan!"
subscriber: "pelanggan"
cuddly_companions: "Sahabat yang Menggemaskan!" # Pet Announcement Modal
kindling_name: "Kindling Elemental"
kindling_description: "Kindling Elementals hanya ingin membuat Anda tetap hangat di malam hari. Dan di siang hari. Sepanjang waktu, sungguh."
griffin_name: "Baby Griffin"
griffin_description: "Griffin adalah setengah elang, setengah singa, semuanya menggemaskan."
raven_name: "Raven"
raven_description: "Burung gagak sangat ahli dalam mengumpulkan botol berkilau yang penuh dengan kesehatan untuk Anda."
mimic_name: "Mimic"
mimic_description: "Mimik dapat mengambil koin untuk Anda. Pindahkan ke atas koin untuk meningkatkan persediaan emas Anda."
cougar_name: "Cougar"
cougar_description: "Para cougar ingin mendapatkan gelar PhD dengan Mendengkur dengan Bahagia Setiap Hari."
fox_name: "Rubah Biru"
fox_description: "Rubah biru sangat pintar dan suka menggali tanah dan salju!"
pugicorn_name: "Pugicorn"
pugicorn_description: "Pugicorn adalah salah satu makhluk paling langka dan bisa merapal mantra!"
wolf_name: "Anjing Serigala"
wolf_description: "Anak anjing serigala unggul dalam berburu, mengumpulkan, dan memainkan permainan petak umpet!"
ball_name: "Bola Berderit Merah"
ball_description: "ball.squeak()"
collect_pets: "Kumpulkan hewan peliharaan untuk pahlawanmu!"
each_pet: "Setiap hewan memiliki kemampuan penolong yang unik!"
upgrade_to_premium: "Menjadi {{subscriber}} untuk melengkapi hewan peliharaan."
play_second_kithmaze: "Mainkan {{the_second_kithmaze}} untuk membuka kunci Anjing Serigala!"
the_second_kithmaze: "Kithmaze Kedua"
keep_playing: "Terus bermain untuk menemukan hewan peliharaan pertama!"
coming_soon: "Segera hadir"
ritic: "Ritic the Cold" # Ritic Announcement Modal
ritic_description: "Ritic the Cold. Terjebak di Kelvintaph Glacier selama berabad-abad, akhirnya bebas dan siap merawat para ogre yang memenjarakannya."
ice_block: "Satu balok es"
ice_description: "Tampaknya ada sesuatu yang terperangkap di dalam ..."
blink_name: "Blink"
blink_description: "Ritika menghilang dan muncul kembali dalam sekejap mata, hanya meninggalkan bayangan."
shadowStep_name: "Shadowstep"
shadowStep_description: "Seorang pembunuh bayaran tahu bagaimana berjalan di antara bayang-bayang."
tornado_name: "Tornado"
tornado_description: "Sebaiknya ada tombol setel ulang saat penutup seseorang meledak."
wallOfDarkness_name: "Wall of Darkness"
wallOfDarkness_description: "Bersembunyi di balik dinding bayangan untuk mencegah tatapan mata yang mengintip."
avatar_selection:
pick_an_avatar: "Pilih avatar yang akan mewakili Anda sebagai pemain"
premium_features:
get_premium: "Dapatkan<br>CodeCombat<br>Premium" # Fit into the banner on the /features page
master_coder: "Menjadi seorang Master Kode dengan berlangganan sekarang!"
paypal_redirect: "Kamu akan dialihkan ke PayPal untuk menyelesaikan proses berlanggangan."
subscribe_now: "Berlangganan Sekarang"
hero_blurb_1: "Dapatkan akses ke __premiumHeroesCount__ jagoan pengisian-super khusus-pelanggan! Manfaatkan kekuatan tak terbendung dari Okar Stompfoot, keakuratan yang mematikan dari Naria si Daun, atau memanggil \"menggemaskan\" kerangka oleh Nalfar Cryptor."
hero_blurb_2: "Kesatria Premium membuka kemampuan beladiri yang menakjubkan seperti Warcry, Stomp, dan Hurl Enemy. Atau, bermain sebagai Pemanah, menggunakan panah dan tidak terdeteksi, melempar pisau, jebakan! Coba kemampuanmu sebagai Penyihir sejati, dan melepaskan susunan Primodial yang kuat, Ilmu Nujum ataupun Elemen Ajaib!"
hero_caption: "Hero baru yang menarik!"
pet_blurb_1: "Peliharaan tidak hanya sebagai teman yang menggemaskan, tetapi mereka juga menyediakan fungsionalitas dan metode unik. Bayi Grifon dapat membawa unit melalui udara, Anak Serigala bermain tangkap dengan panah musuh, Puma suka mengejar raksasa, dan Mimic menarik koin seperti magnet!"
pet_blurb_2: "Koleksi semua peliharaan untuk mengetahui kemampuan unik mereka!"
pet_caption: "Asuh peliharaanmu untuk menemani jagoanmu!"
game_dev_blurb: "Belajar menulis game dan membangun level baru untuk dibagikan kepada teman-temanmu! Taruh barang yang kamu mau, tulis kode untuk logika unit dan tingkah laku, lalu saksikan apakah temanmu dapat menyelesaikan level itu!"
game_dev_caption: "Desain gamemu sendiri untuk menantang teman-temanmu!"
everything_in_premium: "Semuanya kamu dapatkan di CodeCombat Premium:"
list_gems: "Dapatkan bonus permata untuk membeli perlengkapan, peliharaan, dan jagoan"
list_levels: "Dapatkan akses untuk __premiumLevelsCount__ level lebih banyak"
list_heroes: "Membuka jagoan eksklusif, termasuk kelas Pemanah dan Penyihir"
list_game_dev: "Buat dan bagikan game dengan teman-teman"
list_web_dev: "Bangun situs web dan aplikasi interaktif"
list_items: "Pakai benda Premium seperti peliharaan"
list_support: "Dapatkan bantuan Premium untuk menolongmu men-debug kode yang rumit"
list_clans: "Buatlah klan pribadi untuk mengundang teman-temanmu dan berkompetisi di grup peringkat pemain"
choose_hero:
choose_hero: "Pilih Jagoan Kamu"
programming_language: "Bahasa Pemrograman"
programming_language_description: "Bahasa pemrograman mana yang ingin kamu gunakan?"
default: "Bawaan"
experimental: "Eksperimental"
python_blurb: "Sederhana tapi kuat, cocok untuk pemula dan ahli."
javascript_blurb: "Bahasa untuk web. (Tidak sama dengan Java.)"
coffeescript_blurb: "Sintaksis JavaScript yang lebih bagus"
lua_blurb: "Bahasa untuk Skrip Permainan"
java_blurb: "(Khusus Pelanggan) Android dan perusahaan."
cpp_blurb: "(Khusus Pelanggan) Pengembangan game dan komputasi kinerja tinggi."
status: "Status"
weapons: "Senjata"
weapons_warrior: "Pedang - Jarak Dekat, Tanpa Sihir"
weapons_ranger: "Busur Silang, Senapan - Jarak Jauh, Tanpa Sihir"
weapons_wizard: "Tongkat pendek, Tongkat panjang - Jarak Jauh, Sihir"
attack: "Kerusakan" # Can also translate as "Attack"
health: "Kesehatan"
speed: "Kecepatan"
regeneration: "Regenerasi"
range: "Jarak" # As in "attack or visual range"
blocks: "Tangkisan" # As in "this shield blocks this much damage"
backstab: "Tusukan Belakang" # As in "this dagger does this much backstab damage"
skills: "Kemampuan"
attack_1: "Memberikan"
attack_2: "sejumlah"
attack_3: "kerusakan senjata."
health_1: "Mendapatkan"
health_2: "sejumlah"
health_3: "sekehatan dari baju besi."
speed_1: "Bergerak sejauh"
speed_2: "meter perdetik."
available_for_purchase: "Tersedia untuk Dibeli" # Shows up when you have unlocked, but not purchased, a hero in the hero store
level_to_unlock: "Level untuk dibuka:" # Label for which level you have to beat to unlock a particular hero (click a locked hero in the store to see)
restricted_to_certain_heroes: "Hanya beberapa jagoan yang bisa memainkan level ini."
char_customization_modal:
heading: "Sesuaikan Pahlawan Anda"
body: "Badan"
name_label: "Nama Pahlawan"
hair_label: "Warna Rambut"
skin_label: "Warna Kulit"
skill_docs:
function: "fungsi" # skill types
method: "metode"
snippet: "snippet"
number: "nomor"
array: "larik"
object: "objek"
string: "string"
writable: "dapat ditulis" # Hover over "attack" in Your Skills while playing a level to see most of this
read_only: "hanya-bisa-dibaca"
action: "Tindakan"
spell: "Mantra"
action_name: "nama"
action_cooldown: "Membawa"
action_specific_cooldown: "Tenang"
action_damage: "Kerusakan"
action_range: "Jangkauan"
action_radius: "Radius"
action_duration: "Durasi"
example: "Contoh"
ex: "contoh" # Abbreviation of "example"
current_value: "Nilai Saat Ini"
default_value: "Nilai default"
parameters: "Parameter"
required_parameters: "Parameter Wajib"
optional_parameters: "Parameter Opsional"
returns: "Mengembalikan"
granted_by: "Diberikan oleh"
still_undocumented: "Masih tidak berdokumen, maaf."
save_load:
granularity_saved_games: "Tersimpan"
granularity_change_history: "Riwayat"
options:
general_options: "Opsi Umum" # Check out the Options tab in the Game Menu while playing a level
volume_label: "Suara"
music_label: "Musik"
music_description: "Mengubah musik latar menyala/mati."
editor_config_title: "Konfigurasi Editor"
editor_config_livecompletion_label: "Otomatisasi Komplit"
editor_config_livecompletion_description: "Menunjukkan saran otomatis komplit selagi mengetik"
editor_config_invisibles_label: "Tunjukkan yang Kasat Mata"
editor_config_invisibles_description: "Menunjukkan yang kasat mata seperti spasi ataupun tabulasi."
editor_config_indentguides_label: "Tunjukkan Panduan Indentasi"
editor_config_indentguides_description: "Menunjukkan garis vertikal untuk melihat indentasi lebih baik."
editor_config_behaviors_label: "Bantuan Cerdas"
editor_config_behaviors_description: "Otomatis komplit tanda kurung, kurung kurawal, dan tanda petik."
about:
title: "Tentang CodeCombat - Melibatkan Siswa, Memberdayakan Guru, Kreasi yang Menginspirasi"
meta_description: "Misi kami adalah meningkatkan ilmu komputer melalui pembelajaran berbasis game dan membuat pengkodean dapat diakses oleh setiap pelajar. Kami percaya pemrograman adalah keajaiban dan ingin para pelajar diberdayakan untuk menciptakan berbagai hal dari imajinasi murni."
learn_more: "Pelajari lebih lanjut"
main_title: "Jika kamu ingin belajar memprogram, kamu membutuhkan menulis (banyak) kode."
main_description: "Dalam CodeCombat, tugas kamu adalah memastikan kamu melakukannya dengan senyum diwajahmu."
mission_link: "Misi"
team_link: "Tim"
story_link: "Cerita"
press_link: "Pers"
mission_title: "Misi kami: membuat pemrogramman dapat diakses oleh semua siswa di Bumi."
mission_description_1: "<strong>Pemrograman itu ajaib!</strong>. Kemampuannya untuk membuat sesuatu dari imajinasi. Kami memulai CodeCombat untuk memberikan para pelajar kekuatan ajaib yang berada di ujung jemari dengan menggunakan <strong>kode yang ditulis</strong>."
mission_description_2: "Metode ini membuat siswa belajar lebih cepat. JAUH lebih cepat. Seperti sedang bercakap-cakap, bukan seperti membaca buku petunjuk. Kami ingin membawa percakapan tersebut ke setiap sekolah dan ke <strong>semua siswa</strong>, karena semuanya harus memiliki kesempatan untuk belajar keajaiban pemrograman."
team_title: "Bertemu dengan tim CodeCombat"
team_values: "Kami menghargai dialog terbuka dan sopan, dimana ide terbaiklah yang menang. Keputusan kami didasari dari riset pelanggan dan proses kami berfokus pada penyerahan hasil yang jelas kepada mereka. Semuanya turut serta mulai dari CEO sampai ke kontributor Github, karena kami menghargai perkembangan dan pembelajaran dalam tim kami."
nick_title: "Cofounder, CEO"
# csr_title: "Customer Success Representative"
csm_title: "Manajer Kesuksesan Pelanggan"
scsm_title: "Manajer Sukses Pelanggan Senior"
ae_title: "Akun Eksekutif"
sae_title: "Akun Eksekutif Senior"
sism_title: "Manajer Penjualan Senior"
shan_title: "Kepala Pemasaran, CodeCombat Greater China"
run_title: "Kepala Operasi, CodeCombat Greater China"
lance_title: "Kepala Teknologi, CodeCombat Greater China"
zhiran_title: "Kepala Kurikulum, CodeCombat Greater China"
yuqiang_title: "Kepala Inovasi, CodeCombat Greater China"
swe_title: "Insinyur Perangkat Lunak"
sswe_title: "Insinyur Perangkat Lunak Senior"
css_title: "Pakar Dukungan Pelanggan"
css_qa_title: "Dukungan Pelanggan / Spesialis QA"
maya_title: "Pengembang Kurikulum Senior"
bill_title: "Manajer Umum, CodeCombat Greater China"
pvd_title: "Produk dan Desainer Visual"
spvd_title: "Produk Senior dan Desainer Visual"
daniela_title: "Manajer Pemasaran"
bobby_title: "Perancang Game"
brian_title: "Manajer Desain Game Senior"
stephanie_title: "Pakar Dukungan Pelanggan"
sdr_title: "Perwakilan Pengembangan Penjualan"
retrostyle_title: "Ilustrasi"
retrostyle_blurb: "Permainan RetroStyle"
community_title: "...dan komunitas sumber terbuka kami"
# lgd_title: "Lead Game Designer"
oa_title: "Operations Associate"
ac_title: "Koordinator Administratif"
ea_title: "Asisten Eksekutif"
om_title: "Manajer Operasi"
mo_title: "Manajer, Operasi"
smo_title: "Manajer Senior, Operasi"
# do_title: "Director of Operations"
scd_title: "Pengembang Kurikulum Senior"
lcd_title: "Pimpinan Pengembang Kurikulum"
# de_title: "Director of Education"
vpm_title: "Wakil Presiden, Pemasaran"
# oi_title: "Online Instructor"
# aoim_title: "Associate Online Instructor Manager"
# bdm_title: "Business Development Manager"
community_subtitle: "Lebih dari 500 kontributor telah membantu membangun CodeCombat, dan lebih banyak lagi yang bergabung tiap minggunya!" # {change}
community_description_3: "CodeCombat adalah"
community_description_link_2: "proyek komunitas"
community_description_1: " dengan ratusan jumlah pemain suka rela membuat level, berkontribusi dengan kode kami dan menambahkan fitur, memperbaiki bugs, mengetes, dan juga mengalihbahasakan game ke dalam 50 bahasa sampai saat ini. Karyawan, kontributor dan perolehan situs dari berbagi ide dan usaha bersama, sebagaimana komunitas sumber terbuka umumnya. Situs ini dibuat dari berbagai proyek sumber terbuka, dan kami membuka sumber untuk diberikan kembali kepada komunitas dan menyediakan pemain yang penasaran-dengan-kode proyek yang mudah untuk dieksplorasi dan dijadikan eksperimen. Semua dapat bergabung di komunitas CodeCombat! Cek "
community_description_link: "halaman kontribusi"
community_description_2: "untuk info lebih lanjut."
number_contributors: "Lebih dri 450 kontributor telah meminjamkan dukungan dan waktu untuk proyek ini." # {change}
story_title: "Kisah kami sejauh ini"
story_subtitle: "Dari 2013, CodeCombat telah berkembang dari sekedar kumpulan sketsa sampai ke permainan yang hidup dan berkembang."
story_statistic_1a: "20,000,000+"
story_statistic_1b: "total pemain"
story_statistic_1c: "telah memulai perjalanan pemrograman mereka melalui CodeCombat"
story_statistic_2a: "Kami telah menerjemahkan ke lebih dari 50 bahasa - pemain kami berasal"
story_statistic_2b: "190+ negara"
story_statistic_3a: "Bersama, mereka telah menulis"
story_statistic_3b: "1 miliar baris kode dan terus bertambah"
story_statistic_3c: "di banyak bahasa pemrograman yang berbeda"
story_long_way_1: "Kami melalui perjalanan yang panjang..."
story_sketch_caption: "Sketsa paling pertama milik Nick menggambarkan permainan pemrograman sedang beraksi."
story_long_way_2: "masih banyak yang harus kami lakukan sebelum menyelesaikan pencarian kami, jadi..."
jobs_title: "Mari bekerja bersama kami dan membantu menulis sejarah CodeCombat!"
jobs_subtitle: "Tidak cocok tetapi berminat untuk tetap berhubungan? Lihat daftar \"Buat Sendiri\" kami"
jobs_benefits: "Keuntungan Karyawan"
jobs_benefit_4: "Liburan tanpa batas"
jobs_benefit_5: "Pengembangan profesional dan dukungan melanjutkan pendidikan - buku gratis dan permainan!"
jobs_benefit_6: "Pengobatan (level emas), perawatan gigi, perawatan mata, perjalanan, 401K"
jobs_benefit_7: "Meja duduk-berdiri untuk semua"
jobs_benefit_9: "Jendela latihan opsional 10 tahun"
jobs_benefit_10: "Cuti Kelahiran (Wanita): 12 minggu dibayar, 6 berikutnya @ 55% gaji"
jobs_benefit_11: "Cuti Kelahiran (Pria): 12 minggu dibayar"
jobs_custom_title: "Buat Sendiri"
jobs_custom_description: "Apakah kamu berhasrat dengan CodeCombat tetapi tidka melihat daftar pekerjaan yang sesuai dengan kualifikasimu? Tulis dan tunjukkan kami, bagaimana kamu pikir kamu dapat berkontribusi di tim kami. Kami ingin mendengarnya darimu!"
jobs_custom_contact_1: "Kirim kami catatan di"
jobs_custom_contact_2: "perkenalkan dirimu dan kami mungkin dapat menghubungi di kemudian hari!"
contact_title: "Kontak & Pers"
contact_subtitle: "Butuh informasi lebih lanjut? Hubungi kami di"
screenshots_title: "Tangkapan Layar Game"
screenshots_hint: "(klik untuk melihat ukuran penuh)"
downloads_title: "Unduh Aset & Informasi"
about_codecombat: "Mengenai CodeCombat"
logo: "Logo"
screenshots: "Tangkapan layar"
character_art: "Seni Karakter"
download_all: "Unduh Semua"
previous: "Sebelum"
location_title: "Kamu berada di pusat kota San Fransisco:"
teachers:
licenses_needed: "Lisensi dibutuhkan"
special_offer:
special_offer: "Penawaran Spesial"
project_based_title: "Kursus Berbasis Proyek"
project_based_description: "Proyek Akhir Fitur Kursus Web dan Pengembangan Permainan yang dapat dibagikan"
great_for_clubs_title: "Sangat baik untuk klub dan kelompok belajar"
great_for_clubs_description: "Guru dapat membeli sampai __maxQuantityStarterLicenses__ Lisensi Awal."
low_price_title: "Hanya __starterLicensePrice__ persiswa"
low_price_description: "Lisensi awal akan aktif selama __starterLicenseLengthMonths__ bulan dari pembelian."
three_great_courses: "Tiga kursus terbaik yang termasuk ke dalam Lisensi Awal:"
license_limit_description: "Guru dapat membeli sampai __maxQuantityStarterLicenses__ Lisensi Awal. Kamu telah membeli __quantityAlreadyPurchased__. Jika kamu membutuhkan lebih, hubungi __supportEmail__. Lisensi awal akan valid selama __starterLicenseLengthMonths__ bulan."
student_starter_license: "Lisensi Awal Siswa"
purchase_starter_licenses: "Membeli Lisensi Awal"
purchase_starter_licenses_to_grant: "Membeli Lisensi Awal untuk mendapatkan akses ke __starterLicenseCourseList__"
starter_licenses_can_be_used: "Lisensi Awal dapat digunakan untuk mendaftar ke kursus tambahan segera setelah pembelian."
pay_now: "Bayar Sekarang"
we_accept_all_major_credit_cards: "Kami menerima semua jenis kartu kredit."
cs2_description: "membangun diatas fondasi dari Pengenalan Ilmu Komputer, menuju ke if-statement, functions, event, dan lainnya."
wd1_description: "memperkenalkan dasar dari HTML dan CSS selagi mengajarkan kemampuan yang dibutuhkan siswa untuk membangun halaman web mereka yang pertama."
gd1_description: "menggunakan sintaks yang siswa sudah kenal dengan menunjukkan mereka bagaimana cara membuat dan membagikan level permainan yang dapat dimainkan."
see_an_example_project: "lihat contoh proyek"
get_started_today: "Mulailah sekarang!"
want_all_the_courses: "Ingin semua kursus? Minta informasi ke Lisensi Penuh kami."
compare_license_types: "Bandingkan Tipe Lisensi:"
cs: "Ilmu Komputer"
wd: "Mengembangkan Web"
wd1: "Mengembangkan Web 1"
gd: "Mengembangkan Permainan"
gd1: "Mengembangkan Permainan 1"
maximum_students: "Maksimum # Siswa"
unlimited: "Tak terbatas"
priority_support: "Bantuan prioritas"
yes: "Ya"
price_per_student: "__price__ persiswa"
pricing: "Harga"
free: "Gratis"
purchase: "Beli"
courses_prefix: "Kursus"
courses_suffix: ""
course_prefix: "Kursus"
course_suffix: ""
teachers_quote:
subtitle: "Pelajari lebih lanjut tentang CodeCombat dengan panduan interaktif tentang produk, harga, dan implementasi!"
email_exists: "User telah ada dengan email ini."
phone_number: "Nomor telepon"
phone_number_help: "Dimanakah kami dapat menjangkau kamu ketika hari bekerja?"
primary_role_label: "Peran Utama Kamu"
role_default: "Pilih Peran"
primary_role_default: "Pilih Peran Utama"
purchaser_role_default: "Pilih Peran Pembeli"
tech_coordinator: "Koordinator Teknologi"
advisor: "Spesialis Kurikulum/Penasihat"
principal: "Kepala Sekolah"
superintendent: "Pengawas"
parent: "Orang Tua"
purchaser_role_label: "Peran Pembeli Kamu"
influence_advocate: "Mempengaruhi/Menganjurkan"
evaluate_recommend: "Evaluasi/Rekomendasi"
approve_funds: "Menerima Dana"
no_purchaser_role: "Tidak ada peran dalam pemilihan pembelian"
district_label: "Wilayah"
district_name: "Nama Wilayah"
district_na: "Masukkan N/A jika tidak ada"
organization_label: "Sekolah"
school_name: "Nama Sekolah"
city: "Kota"
state: "Provinsi / Wilayah"
country: "Negara"
num_students_help: "Berapa banyak siswa yang akan menggunakan CodeCombat"
num_students_default: "Pilih Jumlah"
education_level_label: "Level Edukasi Siswa"
education_level_help: "Pilih sebanyak yang akan mendaftar."
elementary_school: "Sekolah Dasar"
high_school: "Sekolah Menengah Atas"
please_explain: "(Tolong Dijabarkan)"
middle_school: "Sekolah Menengah Pertama"
college_plus: "Mahasiswa atau lebih tinggi"
referrer: "Bagaimana kamu mengetahui mengenai kami?"
referrer_help: "Sebagai contoh: dari guru lain, dari konferensi, dari siswa anda, Code.org, dsb."
referrer_default: "Pilih Salah Satu"
referrer_conference: "Konferensi (misalnya ISTE)"
referrer_hoc: "Code.org/Hour of Code"
referrer_teacher: "Guru"
referrer_admin: "Administrator"
referrer_student: "Siswa"
referrer_pd: "Pelatihan profesional/workshops"
referrer_web: "Google"
referrer_other: "Lainnya"
anything_else: "Kelas yang seperti apa yang kamu perkirakan untuk menggunakan CodeCombat?"
anything_else_helper: ""
thanks_header: "Permintaan Diterima!"
thanks_sub_header: "Terima kasih telah menyatakan ketertarikan dalam CodeCombat untuk sekolahmu."
thanks_p: "Kamu akan menghubungi segera! Jika kamu membutuhkan kontak, kamu bisa menghubungi di:"
back_to_classes: "Kembali ke Kelas"
finish_signup: "Selesai membuat akun gurumu:"
finish_signup_p: "Membuat akun untuk mempersiapkan kelas, menambah siswamu, dan mengawasi perkembangan mereka selagi mereka belajar ilmu komputer."
signup_with: "Masuk dengan:"
connect_with: "Terhubung dengan:"
conversion_warning: "PERHATIAN: Akunmu saat ini adalah <em>Akun Siswa</em>. Setelah kamu mengirim form ini, akunmu akan diubah menjadi akun Guru"
learn_more_modal: "Akun guru di CodeCombat memiliki kemampuan untuk mengawasi perkembangan siswa, menetapkan lisensi, dan mengatur ruang kelas. Akun guru tidak dapat menjadi bagian dari kelas - Jika kamu saat ini mengikuti kelas menggunakan akun ini, maka kamu tidak dapat lagi mengaksesnya setelah kamu mengubahnya menjadi Akun Guru"
create_account: "Membuat Akun Guru"
create_account_subtitle: "Dapatkan akses peralatan hanya untuk guru jika menggunakan CodeCombat di ruang kelas. <strong>Mempersiapkan kelas</strong>, menambah siswamu, dan <strong>mengawasi perkembangan mereka</strong>!"
convert_account_title: "Ubah ke Akun Guru"
not: "Tidak"
full_name_required: "Diperlukan nama depan dan belakang"
versions:
save_version_title: "Simpan Versi Baru"
new_major_version: "Versi Mayor Baru"
submitting_patch: "Mengirim Perbaikan..."
cla_prefix: "Untuk menyimpan perubahan, pertama-tama kamu harus setuju dengan"
cla_url: "CLA"
cla_suffix: "."
cla_agree: "SAYA SETUJU"
owner_approve: "Pemilik akan menerimanya sebelum kamu perubahanmu akan terlihat"
contact:
contact_us: "Hubungi CodeCombat"
welcome: "Senang mendengar dari kamu! Gunakanlah form ini untuk mengirim kami email. "
forum_prefix: "Untuk segala sesuatu yang bersifat umum, silakan coba "
forum_page: "forum kami"
forum_suffix: "."
faq_prefix: "Selain itu, ada juga"
faq: "FAQ"
subscribe_prefix: "Jika kamu membutuhkan bantuan untuk mencari tau sebuah level, silakan"
subscribe: "beli langganan CodeCombat"
subscribe_suffix: "dan kamu akan dengan senang membantu kamu dengan kodemu."
subscriber_support: "Karena kamu adalah seorang pelanggan CodeCombat, emailmu akan menerima dukungan prioritas dari kami."
screenshot_included: "Tangkapan layar termasuk."
where_reply: "Dimanakah kamu harus membalas?"
send: "Kirim Umpan Balik"
account_settings:
title: "Pengaturan Akun"
not_logged_in: "Masuk atau buat akun untuk mengganti pengaturanmu."
me_tab: "Saya"
picture_tab: "Gambar"
delete_account_tab: "Hapus Akunmu"
wrong_email: "Email Salah"
wrong_password: "Kata Kunci Salah"
delete_this_account: "Hapus akun ini permanen"
reset_progress_tab: "Ulang Semua Perkembangan"
reset_your_progress: "Hapus semua perkembanganmu dan memulai lagi dari awal"
god_mode: "Mode Dewa"
emails_tab: "Email"
admin: "Admin"
manage_subscription: "Klik di sini untuk mengatur langganganmu."
new_password: "Kata Kunci Baru"
new_password_verify: "Verifikasi"
type_in_email: "Ketik dalam email atau nama penggunamu untuk memastikan penghapusan akun."
type_in_email_progress: "Tulis di emailmu untuk memastikan penghapusan kemajuan kamu."
type_in_password: "Dan juga ketik kata kuncimu"
email_subscriptions: "Langganan Email"
email_subscriptions_none: "Tidak ada Langganan Email."
email_announcements: "Pengumuman"
email_announcements_description: "Dapatkan email untuk berita terakhir dan pengembangan dari CodeCombat"
email_notifications: "Pemberitahuan"
email_notifications_summary: "Atur untuk pengaturan pribadi, email pemberitahuan otomatis terkait dengan aktivitas CodeCombatmu."
email_any_notes: "Semua Pemberitahuan"
email_any_notes_description: "Nonaktifkan untuk berhenti semua aktivitas pemberitahuan email"
email_news: "Berita"
email_recruit_notes: "Lowongan Pekerjaan"
email_recruit_notes_description: "Jika kamu bermain dengan baik, kami akan memberitahumu mengenai lowongan (yang lebih baik) pekerjaan."
contributor_emails: "Email Kontributor Kelas"
contribute_prefix: "Kami mencari orang-orang untuk bergabung dengan tim kami. Cek "
contribute_page: "halaman kontribusi"
contribute_suffix: " untuk mengetahui lebih lanjut."
email_toggle: "Ubah Alih Semuanya"
error_saving: "Gagal Menyimpan"
saved: "Perubahan Disimpan"
password_mismatch: "Kata sandi tidak sama."
password_repeat: "Tolong ulang kata sandimu."
keyboard_shortcuts:
keyboard_shortcuts: "Tombol Pintas Keyboard"
space: "Spasi"
enter: "Enter"
press_enter: "tekan enter"
escape: "Escape"
shift: "Shift"
run_code: "Jalankan kode saat ini."
run_real_time: "Jalankan dalam waktu nyata."
continue_script: "Melanjutkan melewati skrip saat ini."
skip_scripts: "Lewati semua skrip yang dapat dilewati."
toggle_playback: "Beralih mulai/berhenti."
scrub_playback: "Menggeser mundur dan maju melewati waktu."
single_scrub_playback: "Menggeser mundur dan maju melewati waktu dalam sebuah frame."
scrub_execution: "Menggeser melalui eksekusi mantera saat ini"
toggle_debug: "Beralih tampilan debug."
toggle_grid: "Beralih lembaran kotak-kotak."
toggle_pathfinding: "Beralih lembaran mencari jalan."
beautify: "Percantik kodemu dengan menstandarisasi formatnya."
maximize_editor: "Memaksimalkan/meminimalisasi editor kode."
cinematic:
click_anywhere_continue: "klik di mana saja untuk melanjutkan"
community:
main_title: "Komunitas CodeCombat"
introduction: "Cek cara kamu dapat terlibat di bawah ini dan putuskan apa yang terdengar paling menyenangkan. Kami berharap dapat bekerja dengan kamu!"
level_editor_prefix: "Gunakan CodeCombat"
level_editor_suffix: "untuk membuat dan mengubah level. Pengguna dapat membuat level untuk kelas mereka, teman, hackathons, para siswa, dan saudara. Jika membuat sebuah level baru terdengar mengintimidasi, kamu bisa memulainya dengan membuat cabang salah satu dari milik kami!"
thang_editor_prefix: "Kami memanggil unit dalam game 'thangs'. Gunakan"
thang_editor_suffix: "untuk memodifikasi CodeCombat sumber karya seni. Perbolehkan unit untuk melempar proyektil, mengubah arah dari animasi, mengganti hit point unit, atau mengunggah vektor sprite milikmu."
article_editor_prefix: "Melihat ada kesalahan dalam dokumentasi kami? Ingin membuat beberapa instruksi untuk karakter buatanmu? Lihat"
article_editor_suffix: "dan bantu pemain CodeCombat untuk mendapatkan hasil maksimal dari waktu bermain mereka."
find_us: "Temukan kami di situs-situs berikut"
social_github: "Lihat semua kode kami di Github"
social_blog: "Baca blog CodeCombat"
social_discource: "Bergabung dalam diskusi di forum Discourse kami"
social_facebook: "Like CodeCombat di Facebook"
social_twitter: "Follow CodeCombat di Twitter"
social_slack: "Mengobrol bersama kami di channel publik Slack CodeCombat"
contribute_to_the_project: "Berkontribusi pada proyek"
clans:
title: "Bergabung dengan Klan CodeCombat - Belajar Membuat Kode dengan Python, JavaScript, dan HTML"
clan_title: "__clan__ - Bergabung dengan Klan CodeCombat dan Belajar Membuat Kode"
meta_description: "Bergabunglah dengan Klan atau bangun komunitas pembuat kode Anda sendiri. Mainkan level arena multipemain dan tingkatkan pahlawan serta keterampilan pengkodean Anda."
clan: "Klan"
clans: "Klan"
new_name: "Nama baru klan"
new_description: "Deskripsi baru klan"
make_private: "Buat klan menjadi privat"
subs_only: "hanya pelanggan"
create_clan: "Buat klan baru"
private_preview: "Tinjau"
private_clans: "Klan Privat"
public_clans: "Klan Publik"
my_clans: "Klan Saya"
clan_name: "Nama Klan"
name: "Nama"
chieftain: "Kepala Suku"
edit_clan_name: "Ubah Nama Klan"
edit_clan_description: "Ubah Deskripsi Klan"
edit_name: "ubah nama"
edit_description: "ubah deskripsi"
private: "(privat)"
summary: "Rangkuman"
average_level: "Level Rata-rata"
average_achievements: "Prestasi Rata-rata"
delete_clan: "Hapus Klan"
leave_clan: "Tinggalkan Klan"
join_clan: "Gabung Klan"
invite_1: "Undang:"
invite_2: "*Undang pemain untuk klan ini dengan mengirimkan mereka tautan."
members: "Anggota"
progress: "Perkembangan"
not_started_1: "belum mulai"
started_1: "mulai"
complete_1: "selesai"
exp_levels: "Perluas level"
rem_hero: "Melepaskan Hero"
status: "Status"
complete_2: "Lengkapi"
started_2: "Dimulai"
not_started_2: "Belum Dimulai"
view_solution: "Klik untuk melihat solusi."
view_attempt: "Klik untuk melihat percobaan."
latest_achievement: "Prestasi Terakhir"
playtime: "Waktu bermain"
last_played: "Yang terakhir dimainkan"
leagues_explanation: "Bermain dalam liga melawan anggota klan lain di instansi arena multipemain."
track_concepts1: "Mengikuti konsep"
track_concepts2a: "dipelajari oleh setiap siswa"
track_concepts2b: "dipelajari oleh setiap anggota"
track_concepts3a: "Mengikuti level yang sudah selesai untuk setiap siswa"
track_concepts3b: "Mengikuti level yang sudah selesai untuk setiap anggota"
track_concepts4a: "Lihat siswa kamu'"
track_concepts4b: "Lihat anggota kamu'"
track_concepts5: "solusi"
track_concepts6a: "Urutkan siswa berdasarkan nama atau perkembangan"
track_concepts6b: "Urutkan anggota berdasarkan nama atau perkembangan"
track_concepts7: "Membutuhkan undangan"
track_concepts8: "untuk bergabung"
private_require_sub: "Klan privat membutuhkan langganan untuk membuat atau bergabung."
courses:
create_new_class: "Buat Kelas Baru"
hoc_blurb1: "Coba"
hoc_blurb2: "Kode, Mainkan, Bagikan"
hoc_blurb3: "aktivitas! Buat empat game mini yang berbeda untuk mempelajari dasar-dasar pengembangan game, lalu buat sendiri!"
solutions_require_licenses: "Solusi level akan tersedia bagi guru yang memiliki lisensi"
unnamed_class: "Kelas Tanpa Nama"
edit_settings1: "Ubah Pengaturan Kelas"
add_students: "Tambah Siswa"
stats: "Statistik"
student_email_invite_blurb: "Siswa-siswa anda juga bisa menggunakan kode kelas <strong>__classCode__</strong> ketika membuat Akun Siswa, tanpa membutuhkan email."
total_students: "Jumlah siswa:"
average_time: "Rata-rata waktu bermain level:"
total_time: "Total waktu bermain:"
average_levels: "Rata-rata level yang terselesaikan:"
total_levels: "Total level yang terselesaikan:"
students: "Siswa-siswa"
concepts: "Konsep-konsep"
play_time: "Waktu bermain:"
completed: "Terselesaikan:"
enter_emails: "Pisahkan tiap alamat email dengan jeda baris ataupun koma"
send_invites: "Undang Siswa"
number_programming_students: "Jumlah Siswa Programming"
number_total_students: "Jumlah Siswa di Sekolah/Wilayah"
enroll: "Daftar"
enroll_paid: "Daftarkan Siswa di Kursus Berbayar"
get_enrollments: "Dapatkan Lisensi Lebih"
change_language: "Mengganti Bahasa"
keep_using: "Tetap Menggunakan"
switch_to: "Mengganti Menjadi"
greetings: "Hai!"
back_classrooms: "Kembali ke ruang kelasku"
back_classroom: "Kembali ke ruang kelas"
back_courses: "Kembali ke kursusku"
edit_details: "Ubah detail kelas"
purchase_enrollments: "Membeli Lisensi Siswa"
remove_student: "hapus siswa"
assign: "Daftarkan"
to_assign: "daftarkan kursus berbayar."
student: "Siswa"
teacher: "Guru"
arena: "Arena"
available_levels: "Level yang Tersedia"
started: "dimulai"
complete: "selesai"
practice: "latihan"
required: "wajib"
welcome_to_courses: "Para petualang, selamat datang di Kursus!" # {change}
ready_to_play: "Siap untuk bermain?"
start_new_game: "Memulai Permainan Baru"
play_now_learn_header: "Bermain sekarang untuk belajar"
play_now_learn_1: "sintaks dasar untuk mengontrol karaktermu"
play_now_learn_2: "perulangan untuk memecahkan puzzle yang menganggu"
play_now_learn_3: "strings & variabel-variabel untuk mengatur tindakan-tindakan"
play_now_learn_4: "bagaimana cara mengalahkan raksasa (keahlian hidup yang penting!)"
my_classes: "Kelas Saat Ini"
class_added: "Kelas berhasil ditambahkan!"
view_map: "lihap peta"
view_videos: "lihat video"
view_project_gallery: "lihat proyek teman kelasku"
join_class: "Bergabung Ke Kelas"
join_class_2: "Ikut Kelas"
ask_teacher_for_code: "Tanya ke gurumu jika kamu memiliki kode kelas CodeCombat! Jika iya, masukkan kode di:"
enter_c_code: "<Masukkan Kode Kelas>"
join: "Bergabung"
joining: "Ikuti kelas"
course_complete: "Kursus Selesai"
play_arena: "Arena Bermain"
view_project: "Lihat Proyek"
start: "Mulai"
last_level: "Level terakhir yang dimainkan"
not_you: "Bukan Kamu?"
continue_playing: "Lanjutkan Bermain"
option1_header: "Undang Siswa Melalui Email"
remove_student1: "Hapus Siswa"
are_you_sure: "Apakah anda yakin ingin menghapus siswa ini dari kelas ini?"
remove_description1: "Siswa akan kehilangan akses untuk kelas ini dan kelas yang diikuti. Perkembangan dan gameplay TIDAK hilang, dan siswa dapat dimasukkan kembali ke kelas kapanpun"
remove_description2: "Lisensi berbayar yang telah aktif tidak dapat dikembalikan."
license_will_revoke: "Lisensi berbayar siswa ini akan dicabut dan menjadi tersedia untuk diberikan ke siswa lain."
keep_student: "Simpan Siswa"
removing_user: "Menghapus siswa"
subtitle: "Mengulas ikhtisar kursus dan level" # Flat style redesign
select_language: "Pilih bahasa"
select_level: "Pilih level"
play_level: "Mainkan Level"
concepts_covered: "Konsep tercakup"
view_guide_online: "Level Ikhtisar dan Solusi"
# lesson_slides: "Lesson Slides"
grants_lifetime_access: "Berikan akses ke semua Kursus."
enrollment_credits_available: "Lisensi Tersedia:"
language_select: "Pilih bahasa" # ClassroomSettingsModal
language_cannot_change: "Bahasa tidak dapat diganti setelah siswa bergabung ke kelas."
avg_student_exp_label: "Pengalaman Pemrograman Rata-rata Siswa"
avg_student_exp_desc: "Ini akan membantu kita mengerti bagaimana cara menjalankan kursus lebih baik."
avg_student_exp_select: "Pilih opsi terbaik"
avg_student_exp_none: "Belum Berpengalaman - sedikit atau belum berpengalaman"
avg_student_exp_beginner: "Pemula - memiliki beberapa pemaparan atau basis-blok"
avg_student_exp_intermediate: "Menengah - ada pengalaman dengan mengetik kode"
avg_student_exp_advanced: "Lanjutan - pengalaman luas dengan mengetik kode"
avg_student_exp_varied: "Level Variasi Pengalaman"
student_age_range_label: "Jarak Usia Siswa"
student_age_range_younger: "Lebih muda dari 6"
student_age_range_older: "Lebih tua dari 18"
student_age_range_to: "sampai"
estimated_class_dates_label: "Perkiraan Tanggal Kelas"
estimated_class_frequency_label: "Estimasi Frekuensi Kelas"
classes_per_week: "kelas per minggu"
minutes_per_class: "menit per kelas"
create_class: "Buat Kelas"
class_name: "Nama Kelas"
teacher_account_restricted: "Akun kamu adalah akun guru dan tidak dapat mengakses konten siswa."
account_restricted: "Akun siswa diperlukan untuk mengakses halaman ini."
update_account_login_title: "Masuk atau perbaharui akunmu"
update_account_title: "Akunmu membutuhkan perhatian!"
update_account_blurb: "Sebelum kamu dapat mengakses kelasmu, pilihlah bagaimana kamu ingin menggunakan akun ini."
update_account_current_type: "Tipe Akun Saat Ini:"
update_account_account_email: "Akun Email/Username:"
update_account_am_teacher: "Saya adalah seorang guru"
update_account_keep_access: "Pertahankan akses ke kelas yang saya buat"
update_account_teachers_can: "Akun guru dapat:"
update_account_teachers_can1: "Membuat/mengatur/menambah kelas"
update_account_teachers_can2: "Tentukan/daftarkan siswa dalam kursus"
update_account_teachers_can3: "Membuka semua level kursus untuk mencoba"
update_account_teachers_can4: "Akses fitur terbaru hanya untuk guru ketika kita mengeluarkan fitur tersebut"
update_account_teachers_warning: "Perhatian: Kamu akan dihapus dari semua kelas yang kamu telah ikuti sebelumnya dan tidak akan dapat bermain kembali sebagai siswa."
update_account_remain_teacher: "Tetap Sebagai Guru"
update_account_update_teacher: "Perbaharui Sebagai Guru"
update_account_am_student: "Saya adalah seorang siswa"
update_account_remove_access: "Hapus akses ke kelas yang telah saya buat"
update_account_students_can: "Akun siswa dapat:"
update_account_students_can1: "Bergabung ke kelas"
update_account_students_can2: "Bermain melalui kursus sebagai siswa dan merekam proses milikmu"
update_account_students_can3: "Bersaing dengan teman kelas di arena"
update_account_students_can4: "Mengakses fitur baru hanya untuk siswa selagi kita mengeluarkan fitur tersebut"
update_account_students_warning: "Perhatian: Kamu tidak dapat mengatur kelas manapun yang telah kamu buat sebelumnya ataupun membuat kelas baru."
unsubscribe_warning: "Perhatian: Kamu akan berhenti berlangganan dari langganan bulananmu."
update_account_remain_student: "Tetap sebagai Siswa"
update_account_update_student: "Perbaharui sebagai Siswa"
need_a_class_code: "Kamu akan membutuhkan Kode Kelas untuk kelas yang kamu ikuti:"
update_account_not_sure: "Tidak yakin yang mana yang dipilih? Email"
update_account_confirm_update_student: "Apakah kamu yakin ingin memperbaharui akunmu menjadi sebuah pengalaman Siswa?"
update_account_confirm_update_student2: "Kamu akan tidak dapat mengatur kelas manapun yang kamu buat sebelumnya atau membuat kelas baru. Kelas yang terbuat sebelumnya olehmu akan dihapus dari CodeCombat dan tidak dapat dikembalikan."
instructor: "Pengajar: "
youve_been_invited_1: "Kamu telah diundang untuk bergabung "
youve_been_invited_2: ", dimana kamu akan belajar "
youve_been_invited_3: " dengan teman kelasmu di CodeCombat."
by_joining_1: "Dengan bergabung "
by_joining_2: "akan dapat membantu mengulang kata kunci kamu jika kamu lupa atau menghilangkannya. Kamu juga dapat melakukan verifikasi emailmu sehingga kamu dapat mengulang kata kuncimu sendiri!"
sent_verification: "Kami telah mengirim verifikasi email ke:"
you_can_edit: "Kamu dapat mengganti alamat emailmu di "
account_settings: "Pengaturan Akun"
select_your_hero: "Pilih Jagoan Kamu"
select_your_hero_description: "Kamu dapat selalu mengganti jagoanmu dengan pergi ke halaman Kursus dan memilih \"Ganti Jagoan\""
select_this_hero: "Pilih Jagoan Ini"
current_hero: "Jagoan Saat Ini:"
current_hero_female: "Jagoan Saat Ini:"
web_dev_language_transition: "Semua kelas program dalam HTML / JavaScript untuk kursus ini. Kelas yang telah menggunakan Python akan mulai dengan level pengenalan extra JavaScript untuk mempermudah transisi. Kelas yang telah menggunakan JavaScript akan melewati level pengenalan."
course_membership_required_to_play: "Kamu butuh bergabung dengan sebuah kursus untuk memainkan level ini."
license_required_to_play: "Tanyakan gurumu untuk memberikan lisensi ke kamu supaya kamu dapat melanjutkan bermain CodeCombat!"
update_old_classroom: "Tahun ajaran baru, level baru!"
update_old_classroom_detail: "Untuk memastikan kamu mendapatkan level paling baru, pastikan kamu membuat kelas baru untuk semester ini dengan menekan Buat Kelas Baru di "
teacher_dashboard: "beranda guru"
update_old_classroom_detail_2: "dan berikan siswa-siswa Kelas Kode yang baru muncul"
view_assessments: "Lihat Penilaian"
view_challenges: "lihat level tantangan"
challenge: "Tantangan:"
challenge_level: "Level Tantangan:"
status: "Status:"
assessments: "Penilaian"
challenges: "Tantangan"
level_name: "Nama Level:"
keep_trying: "Terus Mencoba"
start_challenge: "Memulai Tantangan"
locked: "Terkunci"
concepts_used: "Konsep yang Digunakan:"
show_change_log: "Tunjukkan perubahan pada level kursus ini"
hide_change_log: "Sembunyikan perubahan pada level kursus ini"
concept_videos: "Video Konsep"
concept: "Konsep:"
basic_syntax: "Sintaks Dasar"
while_loops: "While Loops"
variables: "Variabel"
basic_syntax_desc: "Sintaks adalah cara kita menulis kode. Sama seperti ejaan dan tata bahasa penting dalam menulis narasi dan esai, sintaksis penting saat menulis kode. Manusia pandai memahami arti sesuatu, meskipun tidak sepenuhnya benar, tetapi komputer tidak sepintar itu, dan mereka membutuhkan Anda untuk menulis dengan sangat tepat. "
while_loops_desc: "Perulangan adalah cara mengulangi tindakan dalam program. Anda dapat menggunakannya sehingga Anda tidak perlu terus menulis kode berulang, dan jika Anda tidak tahu persis berapa kali suatu tindakan perlu terjadi menyelesaikan tugas. "
variables_desc: "Bekerja dengan variabel seperti mengatur berbagai hal dalam kotak sepatu. Anda memberi nama kotak sepatu, seperti \"Perlengkapan Sekolah\", lalu Anda memasukkannya ke dalamnya. Isi sebenarnya dari kotak dapat berubah seiring waktu, tetapi apa pun yang ada di dalamnya akan selalu disebut \"Perlengkapan Sekolah\". Dalam pemrograman, variabel adalah simbol yang digunakan untuk menyimpan data yang akan berubah selama program berlangsung. Variabel dapat menampung berbagai jenis data, termasuk angka dan string. "
locked_videos_desc: "Terus mainkan game untuk membuka kunci video konsep __concept_name__."
unlocked_videos_desc: "Tinjau video konsep __concept_name__."
video_shown_before: "ditampilkan sebelum __level__"
link_google_classroom: "Tautkan Google Kelas"
select_your_classroom: "Pilih Kelas Anda"
no_classrooms_found: "Tidak ditemukan ruang kelas"
create_classroom_manually: "Buat kelas secara manual"
classes: "Kelas"
certificate_btn_print: "Cetak"
certificate_btn_toggle: "Alihkan"
ask_next_course: "Ingin bermain lebih banyak? Minta akses guru Anda ke kursus berikutnya."
set_start_locked_level: "Kunci level dimulai dari"
no_level_limit: "- (tidak ada level yang dikunci)"
# ask_teacher_to_unlock: "Ask Teacher To Unlock"
# ask_teacher_to_unlock_instructions: "To play the next level, ask your teacher to unlock it on their Course Progress screen"
# play_next_level: "Play Next Level"
# play_tournament: "Play Tournament"
# levels_completed: "Levels Completed: __count__"
# ai_league_team_rankings: "AI League Team Rankings"
# view_standings: "View Standings"
# view_winners: "View Winners"
# classroom_announcement: "Classroom Announcement"
project_gallery:
no_projects_published: "Jadilah yang pertama mempublikasi proyek di kursus ini!"
view_project: "Lihat Proyek"
edit_project: "Ubah Project"
teacher:
assigning_course: "Menetapkan kursus"
back_to_top: "Kembali ke Atas"
click_student_code: "Klik di level manapun yang siswa telah mulai atau selesaikan dibawah ini untuk melihat kode yang mereka tulis."
code: "Kode __name__'"
complete_solution: "Solusi Lengkap"
course_not_started: "Siswa belum memulai kursus ini."
hoc_happy_ed_week: "Selamat Minggu Pendidikan Ilmu Komputer!"
hoc_blurb1: "Pelajari tentang yang gratis"
hoc_blurb2: "Kode, Mainkan, Bagikan"
hoc_blurb3: "aktivitas, unduh rencana pelajaran guru baru, dan beri tahu siswa Anda untuk masuk untuk bermain!"
hoc_button_text: "Lihat Aktivitas"
no_code_yet: "Siswa belum menulis kode apapun di level ini."
open_ended_level: "Level Akhir-Terbuka"
partial_solution: "Solusi Sebagian"
capstone_solution: "Solusi Capstone"
removing_course: "Menghapus kursus"
solution_arena_blurb: "Para siswa didorong untuk memecahkan level arena secara kreatif. Solusi yang tersedia di bawah memenuhi persyaratan level arena."
solution_challenge_blurb: "Para siswa didorong untuk memecahkan tantangan level akhir-terbuka secara kreatif. Salah satu solusi kemungkinan ditampilkan di bawah."
solution_project_blurb: "Para siswa didorong untuk membangun proyek kreatif di level ini. Solusi yang tersedia di bawah memenuhi persyaratan level proyek."
students_code_blurb: "Solusi yang benar untuk setiap level tersedia jika perlu. Dalam beberapa kasus, memungkinkan jika siswa memecahkan level dengan kode yang berbeda. Solusi tidak ditampilkan untuk level di mana siswa belum memulainya."
course_solution: "Solusi Kursus"
level_overview_solutions: "Ikhtisar Level dan Solusi"
no_student_assigned: "Tidak ada siswa yang ditetapkan di kursus ini."
paren_new: "(baru)"
student_code: "Kode Siswa __name__"
teacher_dashboard: "Beranda Guru" # Navbar
my_classes: "Kelasku"
courses: "Panduan Kursus"
enrollments: "Lisensi Siswa"
resources: "Sumber Daya"
help: "Bantuan"
language: "Bahasa"
edit_class_settings: "ubah setingan kelas"
access_restricted: "Wajib Perbaharui Akun"
teacher_account_required: "akun guru dibutuhkan untuk mengakses konten ini."
create_teacher_account: "Buat Akun Guru"
what_is_a_teacher_account: "Apakah Akun Guru?"
teacher_account_explanation: "Akun Guru CodeCombat memungkinkan kamu mmempersiapkan ruang kelas, memonitor perkembangan siswa selagi mereka mengerjakan kursus, mengatur lisensi dan mengakses sumber daya untuk membantu membangun kurikulummu."
current_classes: "Kelas Saat Ini"
archived_classes: "Kelas yang Diarsipkan"
# shared_classes: "Shared Classes"
archived_classes_blurb: "Kelas dapat diarsip untuk referensi kedepan. Membuka arsip kelas untuk melihatnya di daftar Kelas Saat Ini."
view_class: "lihat kelas"
# view_ai_league_team: "View AI League team"
archive_class: "arsip kelas"
unarchive_class: "buka arsip kelas"
unarchive_this_class: "Buka arsip kelas ini"
no_students_yet: "Kelas ini belum memiliki siswa."
no_students_yet_view_class: "Lihat kelas untuk menambahkan siswa."
try_refreshing: "(Kamu mungkin harus membuka ulang page ini)"
create_new_class: "Buat Kelas Baru"
class_overview: "Ikhtisar Kelas" # View Class page
avg_playtime: "Rata-rata waktu bermain level"
total_playtime: "Total waktu bermain"
avg_completed: "Rata-rata level yang terselesaikan"
total_completed: "Total level yang terselesaikan"
created: "Dibuat"
concepts_covered: "Pencakupan konsep"
earliest_incomplete: "Level awal yang belum selesai"
latest_complete: "Level akhir yang terselesaikan"
enroll_student: "Daftar siswa"
apply_license: "Gunakan Lisensi"
revoke_license: "Cabut Lisensi"
revoke_licenses: "Cabut Semua Lisensi"
course_progress: "Perkembangan Kursus"
not_applicable: "Tidak Tersedia"
edit: "ubah"
edit_2: "Ubah"
remove: "hapus"
latest_completed: "Terakhir terselesaikan:"
sort_by: "Urutkan berdasar"
progress: "Perkembangan"
concepts_used: "Konsep digunakan oleh Siswa:"
concept_checked: "Konsep diperiksa:"
completed: "Selesai"
practice: "Latihan"
started: "Mulai"
no_progress: "Belum ada perkembangan"
not_required: "Tidak wajib"
view_student_code: "Klik untuk melihat kode siswa"
select_course: "Pilih kursus untuk melihat"
progress_color_key: "Warna kunci perkembangan:"
level_in_progress: "Perkembangan di Level"
level_not_started: "Level Belum Dimulai"
project_or_arena: "Proyek atau Arena"
students_not_assigned: "Siswa yang belum ditetapkan {{courseName}}"
course_overview: "Ikhtisar Kursus"
copy_class_code: "Salin Kode Kelas"
class_code_blurb: "Para Siswa dapat bergabung di kelas kamu menggunakan Kode Kelas. Tidak membutuhkan alamat email ketika membuat akun siswa dengan Kode Kelas ini."
copy_class_url: "Salin URL Kelas"
class_join_url_blurb: "Kamu juga dapat mengirim URL Kelas unik ini ke halaman web bersama."
add_students_manually: "Undang Siswa dengan Email"
bulk_assign: "Pilih kursus"
assigned_msg_1: "{{numberAssigned}} siswa di ditetapkan {{courseName}}."
assigned_msg_2: "{{numberEnrolled}} lisensi dipakai."
assigned_msg_3: "Kamu sekarang memiliki {{remainingSpots}} sisa lisensi yang tersedia."
assign_course: "Daftarkan Kursus"
removed_course_msg: "{{numberRemoved}} siswa telah dihapus dari {{courseName}}."
remove_course: "Hapus Kursus"
not_assigned_msg_1: "Tidak dapat menambahkan pengguna ke contoh kursus sampai mereka ditambahkan ke prabayar yang mencakup kursus ini"
not_assigned_modal_title: "Kursus belum ditetapkan"
not_assigned_modal_starter_body_1: "Kursus ini membutuhkan Lisensi Awal. Kamu tidak memiliki cukup Lisensi Awal yang tersedia untuk menetapkan kursus ini ke semua __selected__ siswa terpilih."
not_assigned_modal_starter_body_2: "Beli Lisensi Awal untuk berikan akses ke kursus ini"
not_assigned_modal_full_body_1: "Kursus ini membutuhkan Lisensi Penuh. Kamu tidak memiliki cukup Lisensi Penuh yang tersedia untuk menetapkan kursus ke semua __selected__ siswa terpilih."
not_assigned_modal_full_body_2: "Kamu hanya memiliki __numFullLicensesAvailable__ Lisensi Penuh yang tersedia (__numStudentsWithoutFullLicenses__ siswa saat ini tidak memiliki Lisensi Penuh yang aktif)."
not_assigned_modal_full_body_3: "Silakan memilih siswa yang lebih sedikit, atau jangkau ke __supportEmail__ untuk bantuan."
assigned: "Tetapkan"
enroll_selected_students: "Daftar Siswa Terpilih"
no_students_selected: "Tidak ada siswa yang terpilih."
show_students_from: "Tampilkan siswa dari" # Enroll students modal
apply_licenses_to_the_following_students: "Gunakan Lisensi untuk Siswa Berikut"
select_license_type: "Pilih Jenis Lisensi untuk Diterapkan"
students_have_licenses: "Siswa berikut telah memiliki lisensi:"
all_students: "Semua Siswa"
apply_licenses: "Pakai Lisensi"
not_enough_enrollments: "Lisensi yang tersedia tidak cukup."
enrollments_blurb: "Para siswa diwajibkan untuk memiliki lisensi untuk mengakses konton manapun setelah kursus pertama."
how_to_apply_licenses: "Bagaimana cara Menggunakan Lisensi"
export_student_progress: "Ekspor Perkembangan Siswa (CSV)"
send_email_to: "Kirim Pemulihan Kata Kunci ke Email:"
email_sent: "Email terkirim"
send_recovery_email: "Kirim pemulihan email"
enter_new_password_below: "Masukkan kata kunci baru di bawah:"
change_password: "Ganti Kata Kunci"
changed: "Terganti"
available_credits: "Lisensi Tersedia"
pending_credits: "Lisensi Tertunda"
empty_credits: "Lisensi Habis"
license_remaining: "lisensi yang tersisa"
licenses_remaining: "lisensi yang tersisa"
student_enrollment_history: "Riwayat Pendaftaran Siswa"
enrollment_explanation_1: "The"
enrollment_explanation_2: "Riwayat Pendaftaran Siswa"
enrollment_explanation_3: "menampilkan jumlah total siswa unik yang terdaftar di semua guru dan ruang kelas yang ditambahkan ke dasbor Anda. Ini termasuk siswa di ruang kelas yang diarsipkan dan yang tidak diarsipkan dengan tanggal pembuatan kelas antara tanggal 1- Juli 30 setiap tahun sekolah masing-masing. "
enrollment_explanation_4: "Ingat"
enrollment_explanation_5: "kelas dapat diarsipkan dan lisensi dapat digunakan kembali sepanjang tahun ajaran, jadi tampilan ini memungkinkan administrator untuk memahami berapa banyak siswa yang benar-benar berpartisipasi dalam program secara keseluruhan."
one_license_used: "1 dari __totalLicenses__ lisensi telah digunakan"
num_licenses_used: "__numLicensesUsed__ dari __totalLicenses__ lisensi telah digunakan"
starter_licenses: "lisensi awal"
start_date: "tanggal mulai:"
end_date: "tanggal berakhir:"
get_enrollments_blurb: " Kami membantu anda membangun solusi yang memenuhi kebutuhan kelas, sekolah, ataupun wilayah kamu."
# see_also_our: "See also our"
# for_more_funding_resources: "for how to leverage CARES Act funding sources like ESSER and GEER."
how_to_apply_licenses_blurb_1: "Ketika guru menetapkan kursus untuk siswa untuk pertamakali, kami secara otomatis menggunakan lisensi. Gunakan penetapan-masal tarik-turun di ruang kelasmu untuk menetapkan kursus untuk siswa yang terpilih:"
how_to_apply_licenses_blurb_2: "Dapatkan saya menggunakan lisensi tanpa menetapkan ke sebuah kursus?"
how_to_apply_licenses_blurb_3: "Ya - pergi ke label Status Lisensi di ruang kelasmu dan klik \"Pakai Lisensi\" ke siswa manapun yang tidak memiliki lisensi aktif."
request_sent: "Permintaan Dikirim!"
assessments: "Penilaian"
license_status: "Status Lisensi"
status_expired: "Kadaluarsa pada {{date}}"
status_not_enrolled: "Belum Terdaftar"
status_enrolled: "Kadaluarsa pada {{date}}"
select_all: "Pilih Semua"
project: "Proyek"
project_gallery: "Galeri Proyek"
view_project: "Lihat Proyek"
unpublished: "(belum terpublikasi)"
view_arena_ladder: "Lihat Tangga Arena"
resource_hub: "Pusat Sumber Daya"
pacing_guides: "Panduang Berulang Ruang-Kelas-di-Dalam-Kotak"
pacing_guides_desc: "Belajar bagaimana menggabungkan semua sumber daya CodeCombat untuk merancang tahun sekolahmu!"
pacing_guides_elem: "Panduang Berulang Sekolah Dasar"
pacing_guides_middle: "Panduan Berulang Sekolah Menengah Pertama"
pacing_guides_high: "Panduang Berulang Sekolah Menengah Atas"
getting_started: "Memulai"
educator_faq: "FAQ Pengajar"
educator_faq_desc: "Pertanyaan yang paling sering diajukan mengenai menggunakan CodeCombat di kelas atau di sekolahmu."
teacher_getting_started: "Panduan Guru untuk Memulai"
teacher_getting_started_desc: "Baru di CodeCombat? Unduh Panduan Guru untuk Memulai ini untuk mempersiapkan akunmu, membuat kelas pertamamu, dan mengundang siswa untuk kursus pertama."
student_getting_started: "Panduan Memulai Cepat Siswa"
student_getting_started_desc: "Kamu dapat membagikan panduan ini kepada siswamu sebelum memulai CodeCombat supaya mereka dapat membiasakan diri mereka dengan editor kode. Panduan ini dapat digunakan baik untuk kelas Python dan JavaScript."
standardized_curricula: "Kurikulum Standar"
ap_cs_principles: "Kepala Sekolah Ilmu Komputer AP"
ap_cs_principles_desc: "Kepala Sekolah Ilmu Komputer AP memberikan siswa pengenalan luas mengenai kekuatan, pengaruh, dan kemungkinan dalam Ilmu Komputer. Kursus menekankan pemikiran komputasional dan pemecahan masalah sambil mengajar dasar pemrograman."
cs1: "Pengenalan Ilmu Komputer"
cs2: "Ilmu Komputer 2"
cs3: "Ilmu Komputer 3"
cs4: "Ilmu Komputer 4"
cs5: "Ilmu Komputer 5"
cs1_syntax_python: "Kursus 1 Panduan Sintaks Python"
cs1_syntax_python_desc: "Contekan dengan referensi sintaks Python yang umum dimana siswa akan belajar di Pengenalan Ilmu Komputer."
cs1_syntax_javascript: "Kursus 1 Panduan Sintaks JavaScript"
cs1_syntax_javascript_desc: "Contekan dengan referensi sintaks JavaScript yang umum dimana siswa akan belajar di Pengenalan Ilmu Komputer."
coming_soon: "Panduan tambahan segera akan datang!"
engineering_cycle_worksheet: "Lembar Kerja Siklus Teknis"
engineering_cycle_worksheet_desc: "Gunakan lembar kerja ini untuk mengajar para siswa dasar dari siklus teknis: menilai, mendesain, mengimplementasi, dan mendebug. Lihat lembar kerja yang selesai sebagai panduan."
engineering_cycle_worksheet_link: "Lihat contoh"
progress_journal: "Jurnal Perkembangan"
progress_journal_desc: "Mendorong siswa untuk mengikuti terus perkembangan mereka via jurnal perkembangan."
cs1_curriculum: "Pengenalan Ilmu Komputer - Panduan Kurikulum"
cs1_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 1."
arenas_curriculum: "Level Arena - Panduan Guru"
arenas_curriculum_desc: "Instruksi untuk menjalankan Wakka Maul, Cross Bones, dan Power Peak multiplayer arena dengan kelasmu."
assessments_curriculum: "Tingkat Penilaian - Panduan Guru"
assessments_curriculum_desc: "Pelajari cara menggunakan Level Tantangan dan level Tantangan Kombo untuk menilai hasil belajar siswa."
cs2_curriculum: "Ilmu Komputer 2 - Panduan Kurikulum"
cs2_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 2"
cs3_curriculum: "Ilmu Komputer 3 - Panduan Kurikulum"
cs3_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 3"
cs4_curriculum: "Ilmu Komputer 4 - Panduan Kurikulum"
cs4_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 4"
cs5_curriculum_js: "Ilmu Komputer 5 - Panduan Kurikulum (JavaScript)"
cs5_curriculum_desc_js: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk kelas Kursus 5 menggunakan JavaScript."
cs5_curriculum_py: "Ilmu Komputer 5 - Panduan Kurikulum (Python)"
cs5_curriculum_desc_py: "Cakupan dan urutan, rencana pelajaran, aktivitas, dan lainnya untuk kelas Kursus 5 menggunakan Python."
cs1_pairprogramming: "Aktivitas Pemrograman Berpasangan"
cs1_pairprogramming_desc: "Mengenalkan siswa untuk berlatih pemrograman berpasangan yang mampu membantu mereka menjadi pendengar dan pembicara yang lebih baik."
gd1: "Pengembangan Permainan 1"
gd1_guide: "Pengembangan Permainan 1 - Panduan Proyek"
gd1_guide_desc: "Gunakan panduan ini untuk siswa anda selagi mereka membuat proyek permainan pertama yang bisa dibagikan dalam 5 hari"
gd1_rubric: "Pengembangan Permainan 1 - Rubrik Proyek"
gd1_rubric_desc: "Gunakan rubrik ini untuk menilai proyek siswa di akhir Pengembangan Permainan 1."
gd2: "Pengembangan Permainan 2"
gd2_curriculum: "Pengembangan Permainan 2 - Panduan Kurikulum"
gd2_curriculum_desc: "Rencana belajar untuk Pengembangan Permainan 2."
gd3: "Pengembangan Permainan 3"
gd3_curriculum: "Pengembangan Permainan 3 - Panduan Kurikulum"
gd3_curriculum_desc: "Rencana belajar untuk Pengembangan Permainan 3."
wd1: "Pengembangan Web 1"
wd1_curriculum: "Pengembangan Web 1 - Panduan Kurikulum"
wd1_curriculum_desc: "Lingkup dan urutan, rencana pelajaran, aktivitas, dan lainnya untuk Pengembangan Web 1."
wd1_headlines: "Aktivitas Pokok Bahasan dan Header"
wd1_headlines_example: "Lihat contoh solusi"
wd1_headlines_desc: "Mengapa paragraf dan tag header sangat penting? Gunakan aktivitas ini untuk menunjukkan header yang terpilih dengan baik membuat halaman web lebih mudah dibaca. Ada banyak solusi tepat untuk ini!"
wd1_html_syntax: "Panduan Sintaks HTML"
wd1_html_syntax_desc: "Referensi satu halaman untuk bentuk HTML yang para siswa pelajari dalam Pengembangan Web 1."
wd1_css_syntax: "Panduan Sintaks CSS"
wd1_css_syntax_desc: "Referensi satu halaman untuk CSS dan bentuk sintaks yang para siswa pelajari dalam Pengembangan Web 1."
wd2: "Pengembangan Web 2"
wd2_jquery_syntax: "Panduan Sintaks Fungsi jQuery"
wd2_jquery_syntax_desc: "Referensi satu halaman untuk fungsi jQuery yang para siswa pelajari di Pengembangan Web 2."
wd2_quizlet_worksheet: "Lembar Kerja Perencanaan Quiz"
wd2_quizlet_worksheet_instructions: "Lihat instruksi dan contoh"
wd2_quizlet_worksheet_desc: "Sebelum siswa anda membangun proyek quiz kepribadian mereka di akhir Pengembangan Web 2, mereka harus merencanakan pertanyaan quiz mereka, hasil dan respon menggunakan lembar kerja ini. Guru akan mendistribusikan instruksi dan contoh rujukan kepada siswa."
student_overview: "Ikhtisar"
student_details: "Detail Siswa"
student_name: "Nama Siswa"
no_name: "Tidak ada nama."
no_username: "Tidak ada username."
no_email: "Siswa tidak menulis alamat email."
student_profile: "Profil Siswa"
playtime_detail: "Detail Waktu Bermain"
student_completed: "Siswa yang Selesai"
student_in_progress: "Siswa yang Mengerjakan"
class_average: "Rata-rata Kelas"
not_assigned: "belum ditetapkan ke kursus berikut"
playtime_axis: "Waktu Bermain dalam Detik"
levels_axis: "Level dalam"
student_state: "Bagaimana"
student_state_2: "melakukannya?"
student_good: "melakukannya dengan baik"
student_good_detail: "Siswa ini mampu mengikuti kecepatan waktu penyelesaian level rata-rata kelas."
student_warn: "mungkin membutuhkan bantuan"
student_warn_detail: "Waktu penyelesaian level rata-rata siswanya menunjukkan bahwa mereka mungkin memerlukan bantuan dengan konsep baru yang telah diperkenalkan dalam kursus ini."
student_great: "sangat bagus"
student_great_detail: "Siswa ini mungkin merupakan kandidat yang baik untuk membantu siswa lain mengerjakan kursus ini, berdasarkan waktu penyelesaian level rata-rata."
full_license: "Lisensi Penuh"
starter_license: "Lisensi Awal"
customized_license: "Lisensi Khusus"
trial: "Percobaan"
hoc_welcome: "Selamat Pekan Pendidikan Ilmu Komputer"
hoc_title: "Hour of Code Games - Aktivitas Gratis untuk Mempelajari Bahasa Coding yang Sebenarnya"
hoc_meta_description: "Buat game Anda sendiri atau buat kode untuk keluar dari penjara bawah tanah! CodeCombat memiliki empat aktivitas Hour of Code yang berbeda dan lebih dari 60 level untuk mempelajari kode, bermain, dan menciptakan sesuatu."
hoc_intro: "Ada tiga jalan untuk supaya kelasmu dapat berpartisipasi dalam Hour of Code dengan CodeCombat"
hoc_self_led: "Permainan Mandiri"
hoc_self_led_desc: "Siswa dapat bermain sampai dua jam pengajaran Kode CodeCombat secara mandiri"
hoc_game_dev: "Pengembangan Permainan"
hoc_and: "dan"
hoc_programming: "Pemrograman JavaScript/Python"
hoc_teacher_led: "Pelajaran yang dipimpin oleh Guru"
hoc_teacher_led_desc1: "Unduh"
hoc_teacher_led_link: "Rencana pembelajaran Pengenalan Ilmu Komputer" # {change}
hoc_teacher_led_desc2: "Untuk mengenalan para siswa untuk konsep pemrograman menggunakan aktivitas luring"
hoc_group: "Permainan Kelompok"
hoc_group_desc_1: "Guru dapat menggunakan pelajaran sebagai penghubung dengan kursus Pengenalam Ilmu Komputer kami untuk merekam perkembangan siswa. Lihat"
hoc_group_link: "Panduan Memulai"
hoc_group_desc_2: "untuk lebih detail"
hoc_additional_desc1: "Untuk tambahan sumber daya dan aktivitas CodeCombat, lihat"
hoc_additional_desc2: "Pertanyaan"
hoc_additional_contact: "Hubungi"
# regenerate_class_code_tooltip: "Generate a new Class Code"
# regenerate_class_code_confirm: "Are you sure you want to generate a new Class Code?"
revoke_confirm: "Apakah kamu ingin mencabut Lisensi Penuh dari {{student_name}}? Lisensi tersebut akan tersedia untuk dipasang ke siswa lainnya."
revoke_all_confirm: "Apakah anda ingin mencabut Lisensi Penuh dari semua siswa di kelas ini?"
revoking: "Mencabut..."
unused_licenses: "Kamu memiliki lisensi yang tidak digunakan yang memungkinkan anda untuk menetapkan siswa pada kursus berbayar ketika mereka siap untuk belajar lebih!"
remember_new_courses: "Ingatlah untuk menetapkan kursus baru!"
more_info: "Info Lanjut"
how_to_assign_courses: "Bagaimana cara Menetapkan Kursus"
select_students: "Pilih Siswa"
select_instructions: "Klik pada kotak centang sebelah siswa yang ingin anda pasang di kursus."
choose_course: "Pilih Kursus"
choose_instructions: "Pilih kursus dari menu tarik bawah yang kamu ingin tetapkan, lalu klik “Tetapkan Ke Siswa yang Dipilih”."
push_projects: "Kami merekomendasikan mengikuti Pengembangan Web 1 atau Pengembangan Permainan 1 setelah siswa menyelesaikan Pengenalan Ilmu Komputer! Lihat {{resource_hub}} untuk lebih lanjut mengenai kursus tersebut."
teacher_quest: "Pencarian Guru untuk Sukses"
quests_complete: "Pencarian Selesai"
teacher_quest_create_classroom: "Buat Ruang Kelas"
teacher_quest_add_students: "Tambahkan Siswa"
teacher_quest_teach_methods: "Bantu siswa anda belajar bagaimana cara `memanggil method`."
teacher_quest_teach_methods_step1: "Dapatkan minimal 75% dari satu kelas untuk melewati level pertama, Dungeons of Kithgard"
teacher_quest_teach_methods_step2: "Cetak [Panduan Memulai Cepat Siswa](http://files.codecombat.com/docs/resources/StudentQuickStartGuide.pdf) di Pusat Sumber Daya."
teacher_quest_teach_strings: "Jangan melupakan siswa Anda, ajari mereka `string`."
teacher_quest_teach_strings_step1: "Dapatkan minimal 75% dari satu kelas melalui True Names."
teacher_quest_teach_strings_step2: "Gunakan Pemilih Level Guru di halaman [Panduan Kursus](/teachers/courses) untuk melihat True Names."
teacher_quest_teach_loops: "Jaga siswa anda dalam perulangan lingkaran mengenai `perulangan`"
teacher_quest_teach_loops_step1: "Dapatkan minimal 75% dari satu kelas melalui Fire Dancing."
teacher_quest_teach_loops_step2: "Gunakan Loops Activity di [Panduan Kurikulum IlKom1](/teachers/resources/cs1) untuk memperkuat konsep ini."
teacher_quest_teach_variables: "Ubahlah dengan `pengubah`"
teacher_quest_teach_variables_step1: "Dapatkan minimal 75% dari satu kelas melalui Known Enemy."
teacher_quest_teach_variables_step2: "Dorong kolaborasi dengan [Aktivitas Pemrograman Berpasangan](/teachers/resources/pair-programming)."
teacher_quest_kithgard_gates_100: "Kabur dari Kithgard Gates dengan kelasmu."
teacher_quest_kithgard_gates_100_step1: "Dapatkan minimal 75% dari satu kelas melalui Kithgard Gates."
teacher_quest_kithgard_gates_100_step2: "Pandu siswa anda untuk memikirkan masalah-masalah sukar dengan menggunakan [Lembar Kerja Siklus Teknis](http://files.codecombat.com/docs/resources/EngineeringCycleWorksheet.pdf)."
teacher_quest_wakka_maul_100: "Bersiap-siap untuk bertarung di Wakka Maul."
teacher_quest_wakka_maul_100_step1: "Dapatkan minimal 75% dari satu kelas melalui Wakka Maul."
teacher_quest_wakka_maul_100_step2: "Lihat [Panduan Arena](/teachers/resources/arenas) di [Pusat Sumber Daya](/teachers/resources) untuk tip-tip tentang cara menjalankan hari arena yang sukses."
teacher_quest_reach_gamedev: "Jelajahi dunia baru!"
teacher_quest_reach_gamedev_step1: "[Dapatkan lisensi](/teachers/licenses) supaya siswa anda dapat menjelajahi dunia baru, seperti Pengembangan Permainan dan Pengembangan Web!"
teacher_quest_done: "Ingin siswa anda belajar kode lebh lagi? Hubungi [spesialis sekolah](mailto:schools@codecombat.com) kami hari ini!"
teacher_quest_keep_going: "Teruskan! Inilah yang dapat anda lakukan berikutnya:"
teacher_quest_more: "Lihat semua pencarian"
teacher_quest_less: "Lihat lebih sedikit pencarian"
refresh_to_update: "(muat ulang halaman untuk melihat pembaharuan)"
view_project_gallery: "Lihat Galeri Proyek"
office_hours: "Webinars Guru"
office_hours_detail: "Belajar bagaimana cara mengikuti perkembangan siswa anda selagi mereka membuat permainan dan memulai perjalanan koding mereka! Datang dan hadiri"
office_hours_link: "webinar guru"
office_hours_detail_2: "sesi."
success: "Sukses"
in_progress: "Dalam Pengembangan"
not_started: "Belum Mulai"
mid_course: "Pertengahan Kursus"
end_course: "Akhir Kursus"
none: "Belum terdeteksi"
explain_open_ended: "Catatan: Siswa didorong untuk memecahkan level ini dengan kreatif - salah satu kemungkinan solusi tersedia dibawah."
level_label: "Level:"
time_played_label: "Waktu Bermain:"
back_to_resource_hub: "Kembali ke Pusat Sumber Daya"
back_to_course_guides: "Kembali ke Panduan Kursus"
print_guide: "Cetak panduan ini"
combo: "Kombo"
combo_explanation: "Siswa melewati tantangan level Combo dengan menggunakan salah satu konsep yang terdaftar. Tinjau kode siswa dengan mengklik titik perkembangan."
concept: "Konsep"
sync_google_classroom: "Sinkronkan Google Kelas"
try_ozaria_footer: "Coba game petualangan baru kami, Ozaria!"
try_ozaria_free: "Coba Ozaria gratis"
ozaria_intro: "Memperkenalkan Program Ilmu Komputer Baru Kami"
# share_class: "share class"
# permission: "Permission"
# not_write_permission: "You don't have write permission to the class"
# not_read_permission: "You don't have read permission to the class"
teacher_ozaria_encouragement_modal:
title: "Membangun Keterampilan Ilmu Komputer untuk Menyelamatkan Ozaria"
sub_title: "Anda diundang untuk mencoba game petualangan baru dari CodeCombat"
cancel: "Kembali ke CodeCombat"
accept: "Coba Unit Pertama Gratis"
bullet1: "Mempererat hubungan siswa untuk belajar melalui kisah epik dan alur game yang imersif"
bullet2: "Ajarkan dasar-dasar Ilmu Komputer, Python atau JavaScript, dan keterampilan abad ke-21"
bullet3: "Buka kreativitas melalui proyek batu penjuru"
bullet4: "Mendukung petunjuk melalui sumber daya kurikulum khusus"
you_can_return: "Anda selalu dapat kembali ke CodeCombat"
educator_signup_ozaria_encouragement:
recommended_for: "Direkomendasikan untuk:"
independent_learners: "Pembelajar mandiri"
homeschoolers: "homeschooler"
educators_continue_coco: "Pengajar yang ingin terus menggunakan CodeCombat di kelasnya"
continue_coco: "Lanjutkan dengan CodeCombat"
ozaria_cta:
title1: "Standar Kurikulum Inti yang Disejajarkan"
description1: "Kurikulum berbasis cerita yang imersif yang memenuhi semua standar CSTA kelas 6 - 8"
title2: "Rencana Pelajaran Turnkey"
description2: "Presentasi dan lembar kerja mendalam bagi guru untuk membimbing siswa melalui tujuan pembelajaran."
title3: "Dasbor Baru untuk Admin & Guru"
description3: "Semua wawasan yang dapat ditindaklanjuti yang dibutuhkan pengajar dalam sekejap, seperti kemajuan siswa dan pemahaman konsep."
share_licenses:
share_licenses: "Bagikan Lisensi"
shared_by: "Dibagikan Oleh:"
add_teacher_label: "Masukan email guru yang tepat:"
add_teacher_button: "Tambahkan Guru"
subheader: "Anda dapat membuat lisensi anda tersedia bagi guru lain di organisasi anda. Setiap lisensi akan hanya digunakan oleh satu siswa dalam satu waktu."
teacher_not_found: "Guru tidak ditemukan. Harap pastikan guru ini telah membuat Akun Guru."
teacher_not_valid: "Ini bukan Akun Guru yang valid. Hanya akun guru yang bisa membagikan lisensi."
already_shared: "Anda telah membagikan lisensi dengan guru tersebut."
have_not_shared: "Anda belum berbagi lisensi ini dengan guru Anda."
teachers_using_these: "Guru yang dapat mengakses lisensi ini:"
footer: "Ketika guru mencabut lisensi dari siswa, lisensi akan dikembalikan ke kumpulan lisensi untuk digunakan oleh guru lainnya di dalam grup."
you: "(Kamu)"
one_license_used: "(1 lisensi digunakan)"
licenses_used: "(__licensesUsed__ lisensi digunakan)"
more_info: "Info lanjut"
sharing:
game: "Permainan"
webpage: "Halaman Web"
your_students_preview: "Siswa anda akan mengeklik di sini untuk melihat proyek yang mereka selesaikan. Tidak tersedia dalam pratinjau guru."
unavailable: "Berbagi tautan tidak tersedia dalam pratinjau guru."
share_game: "Bagikan Permainan Ini"
share_web: "Bagikan Halaman Web Ini"
victory_share_prefix: "Bagikan tautan ini untuk mengundang teman dan keluarga kamu untuk"
victory_share_prefix_short: "Undang orang untuk"
victory_share_game: "bermain level permainanmu"
victory_share_web: "melihat halaman web kamu"
victory_share_suffix: "."
victory_course_share_prefix: "Tautan ini memungkinkan teman & keluarga kamu"
victory_course_share_game: "bermain permainan"
victory_course_share_web: "melihat halaman web"
victory_course_share_suffix: "yang kamu buat."
copy_url: "Salin URL"
share_with_teacher_email: "Kirimkan ke gurumu"
# share_ladder_link: "Share Multiplayer Link"
# ladder_link_title: "Share Your Multiplayer Match Link"
# ladder_link_blurb: "Share your AI battle link so your friends and family can play versus your code:"
game_dev:
creator: "Pembuat"
web_dev:
image_gallery_title: "Galeri Gambar"
select_an_image: "Pilih gambar yang mau kamu gunakan"
scroll_down_for_more_images: "(Gulirkan kebawah untuk melihat image lebih banyak)"
copy_the_url: "Salin URL di bawah"
copy_the_url_description: "Berguna jika kamu ingin mengganti gambar saat ini."
copy_the_img_tag: "Salin tag <img>"
copy_the_img_tag_description: "Berguna jika anda ingin memasukkan gambar yang baru."
copy_url: "Salin URL"
copy_img: "Salin <img>"
how_to_copy_paste: "Bagaimana cara Salin/Tempel"
copy: "Salin"
paste: "Tempel"
back_to_editing: "Kembali ke Sunting"
classes:
archmage_title: "Penyihir Tinggi"
archmage_title_description: "(Koder)"
archmage_summary: "Jika kamu seorang pengembang yang tertarik dalam membuat kode permainan edukasi, jadilah Penyihir Tinggi untuk membantu kami membangun CodeCombat!"
artisan_title: "Pengerajin"
artisan_title_description: "(Pembangun Level)"
artisan_summary: "Bangun dan bagikan level untuk anda dan teman anda untuk dimainkan. Menjadi seorang Pengerajin untuk belajar seni mengajar orang lain untuk memprogram."
adventurer_title: "Petualang"
adventurer_title_description: "(Penguji Level Permainan)"
adventurer_summary: "Dapatkan level terbaru kami (bahkan untuk konten pelanggan) lebih awal secara gratis seminggu dan bantu kami mengatasi bug sebelum rilis ke publik."
scribe_title: "Penulis"
scribe_title_description: "(Editor Artikel)"
scribe_summary: "Kode yang bagus membutuhkan dokumentasi yang baik. Tulis, ubah, dan perbaiki dokument yang dibaca oleh jutaan pemain di seluruh dunia."
diplomat_title: "Diplomat"
diplomat_title_description: "(Alih Bahasa)"
diplomat_summary: "CodeCombat di lokalkan dalam 45+ bahasa oleh Diplomat kami. Bantu kami dan berkontribusilah dalam alih bahasa."
ambassador_title: "Duta Besar"
ambassador_title_description: "(Pendukung)"
ambassador_summary: "Pandu pengguna forum kami dan berikan arahan bagi mereka yang memiliki pertanyaan. Duta Besar kami mewakili CodeCombat kepada dunia."
teacher_title: "Guru"
editor:
main_title: "Editor CodeCombat"
article_title: "Editor Artikel"
thang_title: "Editor Thang"
level_title: "Editor Level"
course_title: "Editor Kursus"
achievement_title: "Editor Prestasi"
poll_title: "Editor Jajak Pendapat"
back: "Kembali"
revert: "Kembalikan"
revert_models: "Kembalikan Model"
pick_a_terrain: "Pilih Medan"
dungeon: "Ruang Bawah Tanah"
indoor: "Dalam ruangan"
desert: "Gurun"
grassy: "Rumput"
mountain: "Gunung"
glacier: "Gletser"
small: "Kecil"
large: "Besar"
fork_title: "Fork Versi Baru"
fork_creating: "Membuat Fork ..."
generate_terrain: "Buat Medan"
more: "Lainnya"
wiki: "Wiki"
live_chat: "Obrolan Langsung"
thang_main: "Utama"
thang_spritesheets: "Spritesheets"
thang_colors: "Warna"
level_some_options: "Beberapa Opsi?"
level_tab_thangs: "Thang"
level_tab_scripts: "Script"
level_tab_components: "Komponen"
level_tab_systems: "Sistem"
level_tab_docs: "Dokumentasi"
level_tab_thangs_title: "Thang Saat Ini"
level_tab_thangs_all: "Semua"
level_tab_thangs_conditions: "Kondisi Awal"
level_tab_thangs_add: "Tambahkan Thangs"
level_tab_thangs_search: "Telusuri"
add_components: "Tambahkan Komponen"
component_configs: "Konfigurasi Komponen"
config_thang: "Klik dua kali untuk mengkonfigurasi thang"
delete: "Hapus"
duplicate: "Duplikat"
stop_duplicate: "Hentikan Duplikat"
rotate: "Putar"
level_component_tab_title: "Komponen Saat Ini"
level_component_btn_new: "Buat Komponen Baru"
level_systems_tab_title: "Sistem Saat Ini"
level_systems_btn_new: "Buat Sistem Baru"
level_systems_btn_add: "Tambahkan Sistem"
level_components_title: "Kembali ke Semua Hal"
level_components_type: "Tipe"
level_component_edit_title: "Edit Komponen"
level_component_config_schema: "Skema Konfigurasi"
level_system_edit_title: "Edit Sistem"
create_system_title: "Buat Sistem Baru"
new_component_title: "Buat Komponen Baru"
new_component_field_system: "Sistem"
new_article_title: "Buat Artikel Baru"
new_thang_title: "Buat Jenis Thang Baru"
new_level_title: "Buat Tingkat Baru"
new_article_title_login: "Masuk untuk Membuat Artikel Baru"
new_thang_title_login: "Masuk untuk Membuat Jenis Thang Baru"
new_level_title_login: "Masuk untuk Membuat Tingkat Baru"
new_achievement_title: "Ciptakan Prestasi Baru"
new_achievement_title_login: "Masuk untuk Menciptakan Prestasi Baru"
new_poll_title: "Buat Jajak Pendapat Baru"
new_poll_title_login: "Masuk untuk Membuat Jajak Pendapat Baru"
article_search_title: "Telusuri Artikel Di Sini"
thang_search_title: "Telusuri Jenis Thang Di Sini"
level_search_title: "Telusuri Tingkat Di Sini"
achievement_search_title: "Pencapaian Penelusuran"
poll_search_title: "Telusuri Jajak Pendapat"
read_only_warning2: "Catatan: Anda tidak dapat menyimpan hasil edit apa pun di sini, karena Anda belum masuk."
no_achievements: "Belum ada pencapaian yang ditambahkan untuk level ini."
achievement_query_misc: "Pencapaian utama dari bermacam-macam"
achievement_query_goals: "Pencapaian utama dari target level"
level_completion: "Penyelesaian Level"
pop_i18n: "Isi I18N"
tasks: "Tugas"
clear_storage: "Hapus perubahan lokal Anda"
add_system_title: "Tambahkan Sistem ke Tingkat"
done_adding: "Selesai Menambahkan"
article:
edit_btn_preview: "Pratijau"
edit_article_title: "Ubah Artikel"
polls:
priority: "Prioritas"
contribute:
page_title: "Berkontribusi"
intro_blurb: "CodeCombat adalah bagian dari komunitas open source! Ratusan pemain yang berdedikasi telah membantu kami membangun game seperti sekarang ini. Bergabunglah dengan kami dan tulis bab berikutnya dalam misi CodeCombat untuk mengajari dunia kode!"
alert_account_message_intro: "Halo!"
alert_account_message: "Untuk berlangganan email kelas, Anda harus masuk terlebih dahulu."
archmage_introduction: "Salah satu bagian terbaik tentang membuat game adalah mereka mensintesis banyak hal yang berbeda. Grafik, suara, jaringan waktu nyata, jaringan sosial, dan tentu saja banyak aspek pemrograman yang lebih umum, dari pengelolaan basis data tingkat rendah , dan administrasi server untuk desain yang dihadapi pengguna dan pembuatan antarmuka. Ada banyak hal yang harus dilakukan, dan jika Anda seorang programmer berpengalaman dengan keinginan untuk benar-benar menyelami seluk beluk CodeCombat, kelas ini mungkin cocok untuk Anda. Kami akan senang untuk mendapatkan bantuan Anda dalam membuat game pemrograman terbaik. "
class_attributes: "Atribut Kelas"
archmage_attribute_1_pref: "Pengetahuan dalam"
archmage_attribute_1_suf: ", atau keinginan untuk belajar. Sebagian besar kode kami dalam bahasa ini. Jika Anda penggemar Ruby atau Python, Anda akan merasa seperti di rumah sendiri. Ini JavaScript, tetapi dengan sintaks yang lebih baik."
archmage_attribute_2: "Beberapa pengalaman dalam pemrograman dan inisiatif pribadi. Kami akan membantu Anda berorientasi, tetapi kami tidak dapat menghabiskan banyak waktu untuk melatih Anda."
how_to_join: "Cara Bergabung"
join_desc_1: "Siapa pun dapat membantu! Lihat saja di "
join_desc_2: "untuk memulai, dan centang kotak di bawah ini untuk menandai diri Anda sebagai Archmage pemberani dan mendapatkan berita terbaru melalui email. Ingin mengobrol tentang apa yang harus dilakukan atau bagaimana cara untuk terlibat lebih dalam?"
join_desc_3: ", atau temukan kami di"
join_desc_4: "dan kita akan pergi dari sana!"
join_url_email: "Email kami"
join_url_slack: "saluran Slack publik"
archmage_subscribe_desc: "Dapatkan email tentang pengumuman dan peluang pengkodean baru."
artisan_introduction_pref: "Kita harus membangun level tambahan! Orang-orang berteriak-teriak meminta lebih banyak konten, dan kami hanya dapat membuat sendiri begitu banyak. Saat ini workstation Anda berada di level satu; editor level kami hampir tidak dapat digunakan bahkan oleh pembuatnya, jadi waspadalah. Jika Anda memiliki visi kampanye yang mencakup beberapa putaran hingga "
artisan_introduction_suf: ", maka kelas ini mungkin cocok untuk Anda."
artisan_attribute_1: "Pengalaman apa pun dalam membuat konten seperti ini akan menyenangkan, seperti menggunakan editor level Blizzard. Tapi tidak wajib!"
artisan_attribute_2: "Ingin sekali melakukan banyak pengujian dan pengulangan. Untuk membuat level yang baik, Anda perlu membawanya ke orang lain dan melihat mereka memainkannya, dan bersiaplah untuk menemukan banyak hal untuk diperbaiki."
artisan_attribute_3: "Untuk saat ini, ketahanan setara dengan seorang Petualang. Editor Tingkat kami sangat awal dan membuat frustasi untuk digunakan. Anda telah diperingatkan!"
artisan_join_desc: "Gunakan Editor Tingkat dalam langkah-langkah ini, memberi atau menerima:"
artisan_join_step1: "Baca dokumentasinya."
artisan_join_step2: "Buat level baru dan jelajahi level yang ada."
artisan_join_step3: "Temukan kami di saluran Slack publik kami untuk mendapatkan bantuan."
artisan_join_step4: "Posting level Anda di forum untuk mendapatkan masukan."
artisan_subscribe_desc: "Dapatkan email tentang pengumuman dan pembaruan editor level."
adventurer_introduction: "Mari perjelas tentang peran Anda: Anda adalah tanknya. Anda akan menerima kerusakan parah. Kami membutuhkan orang untuk mencoba level baru dan membantu mengidentifikasi cara membuat segalanya lebih baik. Rasa sakitnya akan luar biasa; membuat game yang bagus adalah proses yang panjang dan tidak ada yang melakukannya dengan benar pada kali pertama. Jika Anda bisa bertahan dan memiliki skor konstitusi yang tinggi, maka kelas ini mungkin cocok untuk Anda. "
adventurer_attribute_1: "Haus untuk belajar. Anda ingin belajar cara membuat kode dan kami ingin mengajari Anda cara membuat kode. Anda mungkin akan melakukan sebagian besar pengajaran dalam kasus ini."
adventurer_attribute_2: "Karismatik. Bersikaplah lembut tetapi jelaskan tentang apa yang perlu ditingkatkan, dan tawarkan saran tentang cara meningkatkan."
adventurer_join_pref: "Kumpulkan (atau rekrut!) seorang Artisan dan bekerja dengan mereka, atau centang kotak di bawah ini untuk menerima email ketika ada level baru untuk diuji. Kami juga akan memposting tentang level untuk ditinjau di jaringan kami seperti "
adventurer_forum_url: "forum kami"
adventurer_join_suf: "jadi jika Anda lebih suka diberi tahu dengan cara itu, daftar di sana!"
adventurer_subscribe_desc: "Dapatkan email saat ada level baru untuk diuji."
scribe_introduction_pref: "CodeCombat tidak hanya berupa sekumpulan level. Ini juga akan menyertakan sumber daya untuk pengetahuan, wiki konsep pemrograman yang dapat digunakan oleh level. Dengan cara itu, setiap Artisan tidak harus menjelaskan secara detail apa a operator perbandingan adalah, mereka dapat dengan mudah menautkan level mereka ke Artikel yang menjelaskan mereka yang sudah ditulis untuk pendidikan pemain. Sesuatu di sepanjang baris apa "
scribe_introduction_url_mozilla: "Jaringan Pengembang Mozilla"
scribe_introduction_suf: "telah dibangun. Jika ide Anda tentang kesenangan adalah mengartikulasikan konsep pemrograman dalam bentuk Penurunan Harga, maka kelas ini mungkin cocok untuk Anda."
scribe_attribute_1: "Keterampilan dalam kata-kata adalah semua yang Anda butuhkan. Tidak hanya tata bahasa dan ejaan, tetapi juga mampu menyampaikan ide yang rumit kepada orang lain."
contact_us_url: "Hubungi Kami"
scribe_join_description: "ceritakan sedikit tentang diri Anda, pengalaman Anda dengan pemrograman, dan hal-hal apa yang ingin Anda tulis. Kami akan mulai dari sana!"
scribe_subscribe_desc: "Dapatkan email tentang pengumuman penulisan artikel."
diplomat_introduction_pref: "Jadi, jika ada satu hal yang kami pelajari dari"
diplomat_introduction_url: "komunitas sumber terbuka"
diplomat_introduction_suf: "karena ada minat yang cukup besar terhadap CodeCombat di negara lain! Kami sedang membangun korps penerjemah yang ingin mengubah satu rangkaian kata menjadi rangkaian kata lain agar CodeCombat dapat diakses di seluruh dunia sebanyak mungkin. Jika Anda suka melihat sekilas konten yang akan datang dan menyampaikan level ini ke sesama warga negara secepatnya, maka kelas ini mungkin cocok untuk Anda. "
diplomat_attribute_1: "Kefasihan dalam bahasa Inggris dan bahasa tujuan menerjemahkan. Saat menyampaikan ide yang rumit, penting untuk memiliki pemahaman yang kuat tentang keduanya!"
diplomat_i18n_page_prefix: "Anda dapat mulai menerjemahkan level kami dengan membuka"
diplomat_i18n_page: "halaman terjemahan"
diplomat_i18n_page_suffix: ", atau antarmuka dan situs web kami di GitHub."
diplomat_join_pref_github: "Temukan file lokal bahasa Anda"
diplomat_github_url: "di GitHub"
diplomat_join_suf_github: ", edit secara online, dan kirim pull request. Juga, centang kotak di bawah ini untuk mengikuti perkembangan internasionalisasi baru!"
diplomat_subscribe_desc: "Dapatkan email tentang perkembangan i18n dan level untuk diterjemahkan."
ambassador_introduction: "Ini adalah komunitas yang kami bangun, dan Anda adalah koneksinya. Kami memiliki forum, email, dan jaringan sosial dengan banyak orang untuk diajak bicara dan membantu mengenal game dan belajar darinya. Jika Anda ingin membantu orang-orang untuk terlibat dan bersenang-senang, serta merasakan denyut nadi CodeCombat dan kemana tujuan kita, maka kelas ini mungkin cocok untuk Anda. "
ambassador_attribute_1: "Keterampilan komunikasi. Mampu mengidentifikasi masalah yang dialami pemain dan membantu mereka menyelesaikannya. Selain itu, beri tahu kami semua tentang apa yang dikatakan pemain, apa yang mereka sukai dan tidak sukai, dan inginkan lebih banyak!"
ambassador_join_desc: "ceritakan sedikit tentang diri Anda, apa yang telah Anda lakukan, dan apa yang ingin Anda lakukan. Kami akan mulai dari sana!"
ambassador_join_step1: "Baca dokumentasinya."
ambassador_join_step2: "Temukan kami di saluran Slack publik kami."
ambassador_join_step3: "Bantu orang lain dalam kategori Duta."
ambassador_subscribe_desc: "Dapatkan email tentang pembaruan dukungan dan perkembangan multipemain."
teacher_subscribe_desc: "Dapatkan email tentang pembaruan dan pengumuman untuk guru."
changes_auto_save: "Perubahan disimpan secara otomatis saat Anda mengaktifkan kotak centang."
diligent_scribes: "Penulis Rajin Kami:"
powerful_archmages: "Archmages Kuat Kami:"
creative_artisans: "Pengrajin Kreatif Kami:"
brave_adventurers: "Petualang Berani Kami:"
translating_diplomats: "Diplomat Penerjemah Kami:"
helpful_ambassadors: "Duta Kami yang Suka Menolong:"
ladder:
title: "Arena Multipemain"
arena_title: "__arena__ | Arena Multipemain"
my_matches: "Pertandingan Saya"
simulate: "Simulasikan"
simulation_explanation: "Dengan mensimulasikan game, Anda bisa mendapatkan peringkat game Anda lebih cepat!"
simulation_explanation_leagues: "Anda terutama akan membantu mensimulasikan game untuk pemain sekutu di klan dan kursus Anda."
simulate_games: "Simulasikan Game!"
games_simulated_by: "Game yang Anda simulasi:"
games_simulated_for: "Game yang disimulasikan untuk Anda:"
games_in_queue: "Game saat ini dalam antrean:"
games_simulated: "Game yang disimulasikan"
games_played: "Game dimainkan"
ratio: "Rasio"
leaderboard: "Papan Peringkat"
battle_as: "Bertempur sebagai"
summary_your: "Milik Anda"
summary_matches: "Cocok -"
summary_wins: "Menang"
summary_losses: "Kekalahan"
rank_no_code: "Tidak Ada Kode Baru untuk Diperingkat"
rank_my_game: "Rangking Game Saya!"
rank_submitting: "Mengirim ..."
rank_submitted: "Dikirim untuk Pemeringkatan"
rank_failed: "Gagal Ranking"
rank_being_ranked: "Game Menjadi Peringkat"
rank_last_submitted: "Kirim"
help_simulate: "Membantu mensimulasikan game?"
code_being_simulated: "Kode baru Anda sedang disimulasikan oleh pemain lain untuk peringkat. Ini akan menyegarkan saat pertandingan baru masuk."
no_ranked_matches_pre: "Tidak ada peringkat yang cocok untuk"
no_ranked_matches_post: " tim! Bermain melawan beberapa pesaing lalu kembali ke sini untuk mendapatkan peringkat game Anda."
choose_opponent: "Pilih Lawan"
select_your_language: "Pilih bahasa Anda!"
tutorial_play: "Mainkan Tutorial"
tutorial_recommended: "Direkomendasikan jika Anda belum pernah bermain sebelumnya"
tutorial_skip: "Lewati Tutorial"
tutorial_not_sure: "Tidak yakin apa yang terjadi?"
tutorial_play_first: "Mainkan Tutorial dulu."
simple_ai: "CPU Sederhana"
warmup: "Pemanasan"
friends_playing: "Teman Bermain"
log_in_for_friends: "Masuk untuk bermain dengan teman Anda!"
social_connect_blurb: "Terhubung dan bermain melawan teman-temanmu!"
invite_friends_to_battle: "Undang temanmu untuk bergabung denganmu dalam pertempuran!"
fight: "Bertarung!" # {change}
watch_victory: "Perhatikan kemenanganmu"
defeat_the: "Kalahkan"
watch_battle: "Tonton pertempurannya"
# tournament_starts: "Tournament starts __timeElapsed__"
tournament_started: ", dimulai"
tournament_ends: "Turnamen berakhir"
tournament_ended: "Turnamen berakhir"
# tournament_results_published: ", results published"
tournament_rules: "Aturan Turnamen"
tournament_blurb_criss_cross: "Menangkan tawaran, membangun jalur, mengecoh lawan, raih permata, dan tingkatkan karier Anda di turnamen Criss-Cross kami! Lihat detailnya"
tournament_blurb_zero_sum: "Bebaskan kreativitas coding Anda dalam taktik mengumpulkan emas dan bertempur dalam pertandingan cermin alpen antara penyihir merah dan penyihir biru. Turnamen dimulai pada hari Jumat, 27 Maret dan akan berlangsung hingga Senin, 6 April pukul 17.00 PDT. Bersainglah untuk bersenang-senang dan mulia! Lihat detailnya "
tournament_blurb_ace_of_coders: "Bertarunglah di gletser beku dalam pertandingan cermin bergaya dominasi ini! Turnamen dimulai pada hari Rabu, 16 September dan akan berlangsung hingga Rabu, 14 Oktober pukul 17.00 PDT. Lihat detailnya"
tournament_blurb_blog: "di blog kami"
rules: "Aturan"
winners: "Pemenang"
league: "Liga"
red_ai: "CPU Merah" # "Red AI Wins", at end of multiplayer match playback
blue_ai: "CPU Biru"
wins: "Menang" # At end of multiplayer match playback
# losses: "Losses"
# win_num: "Wins"
# loss_num: "Losses"
# win_rate: "Win %"
humans: "Merah" # Ladder page display team name
ogres: "Biru"
tournament_end_desc: "Turnamen selesai, terima kasih sudah bermain"
age: "Usia"
# age_bracket: "Age Bracket"
bracket_0_11: "0-11"
bracket_11_14: "11-14"
bracket_14_18: "14-18"
# bracket_11_18: "11-18"
bracket_open: "Buka"
user:
user_title: "__name__ - Belajar Membuat Kode dengan CodeCombat"
stats: "Statistik"
singleplayer_title: "Level Pemain Tunggal"
multiplayer_title: "Level Multi Pemain"
achievements_title: "Prestasi"
last_played: "Terakhir Dimainkan"
status: "Status"
status_completed: "Selesai"
status_unfinished: "Belum Selesai"
no_singleplayer: "Belum ada permainan Pemain Tunggal yang dimainkan."
no_multiplayer: "Belum ada permainan Multi Pemain yang dimainkan"
no_achievements: "Belum ada Prestasi yang dicapai."
favorite_prefix: "Bahasa favorit adalah "
favorite_postfix: "."
not_member_of_clans: "Belum menjadi anggota klan manapun."
certificate_view: "lihat sertifikat"
certificate_click_to_view: "klik untuk melihat sertifikat"
certificate_course_incomplete: "kursus belum selesai"
certificate_of_completion: "Sertifikat Penyelesaian"
certificate_endorsed_by: "Didukung oleh"
certificate_stats: "Statistik Kursus"
certificate_lines_of: "baris ke"
certificate_levels_completed: "level selesai"
certificate_for: "Untuk"
certificate_number: "Nomor"
achievements:
last_earned: "Terakhir diperoleh"
amount_achieved: "Jumlah"
achievement: "Prestasi"
current_xp_prefix: ""
current_xp_postfix: " secara keseluruhan"
new_xp_prefix: ""
new_xp_postfix: " diperoleh"
left_xp_prefix: ""
left_xp_infix: " sampai tingkat "
left_xp_postfix: ""
account:
title: "Akun"
settings_title: "Pengaturan Akun"
unsubscribe_title: "Berhenti berlangganan"
payments_title: "Pembayaran"
subscription_title: "Berlangganan"
invoices_title: "Faktur"
prepaids_title: "Prabayar"
payments: "Pembayaran"
prepaid_codes: "Kode Prabayar"
purchased: "Dibeli"
subscribe_for_gems: "Berlangganan untuk permata"
subscription: "Berlangganan"
invoices: "Tagihan"
service_apple: "Apple"
service_web: "Web"
paid_on: "Dibayar Pada"
service: "Servis"
price: "Harga"
gems: "Permata"
active: "Aktif"
subscribed: "Berlangganan"
unsubscribed: "Berhenti Berlangganan"
active_until: "Aktif Sampai"
cost: "Biaya"
next_payment: "Pembayaran Berikutnya"
card: "Kartu"
status_unsubscribed_active: "Anda tidak berlangganan dan tidak akan ditagih, tetapi akun anda masih aktif sampai saat ini."
status_unsubscribed: "Dapatkan akses level baru, jagoan, barang, dan bonus permata dengan berlangganan CodeCombat!"
not_yet_verified: "Belum diverifikasi."
resend_email: "Kirim ulang email"
email_sent: "Email terkirim! Cek kotak masuk anda."
verifying_email: "Melakukan verifikasi alamat email anda..."
successfully_verified: "Anda berhasil memverifikasi alamat email anda!"
verify_error: "Terjadi kesalahan ketika melakukan verifikasi email anda :("
unsubscribe_from_marketing: "Berhenti berlangganan __email__ dari semua marketing email CodeCombat?"
unsubscribe_button: "Ya, berhenti berlangganan"
unsubscribe_failed: "Gagal"
unsubscribe_success: "Sukses"
# manage_billing: "Manage Billing"
account_invoices:
amount: "Jumlah dalam US dollar"
declined: "Kartu anda ditolak"
invalid_amount: "Masukkan jumlah dalam US Dollar"
not_logged_in: "Masuk atau buat akun untuk mengakses tagihan."
pay: "Bayar Tagihan"
purchasing: "Membeli..."
retrying: "Terjadi kesalahan di server, mencoba kembali."
success: "Berhasil dibayar. Terima Kasih!"
account_prepaid:
purchase_code: "Beli Kode Langganan"
purchase_code1: "Kode Langganan dapat ditukarkan untuk menambah waktu langganan premium ke satu atau lebih akun untuk CodeCombat versi Rumah."
purchase_code2: "Setiap akun CodeCombat hanya dapat menukarkan Kode Langganan tertentu sekali."
purchase_code3: "Bulan Kode Langganan akan ditambahkan ke akhir langganan yang ada di akun."
purchase_code4: "Kode Langganan adalah untuk akun yang memainkan CodeCombat versi Home, kode ini tidak dapat digunakan sebagai pengganti Lisensi Pelajar untuk versi Kelas."
purchase_code5: "Untuk informasi lebih lanjut tentang Lisensi Pelajar, hubungi"
users: "Pengguna"
months: "Bulan"
purchase_total: "Total"
purchase_button: "Kirim Pembelian"
your_codes: "Kode Anda"
redeem_codes: "Tukarkan Kode Langganan"
prepaid_code: "Kode Prabayar"
lookup_code: "Cari kode prabayar"
apply_account: "Terapkan ke akun Anda"
copy_link: "Anda dapat menyalin tautan kode dan mengirimkannya ke seseorang."
quantity: "Kuantitas"
redeemed: "Ditebus"
no_codes: "Belum ada kode!"
you_can1: "Anda bisa"
you_can2: "beli kode prabayar"
you_can3: "yang dapat diterapkan ke akun Anda sendiri atau diberikan kepada orang lain."
impact:
hero_heading: "Membangun Program Ilmu Komputer Kelas Dunia"
hero_subheading: "Kami Membantu Memberdayakan Pendidik dan Menginspirasi Siswa di Seluruh Negeri"
featured_partner_story: "Kisah Mitra Unggulan"
partner_heading: "Berhasil Mengajar Coding di Sekolah Judul I"
partner_school: "Bobby Duke Middle School"
featured_teacher: "Scott Baily"
teacher_title: "Guru Teknologi Coachella, CA"
implementation: "Implementasi"
grades_taught: "Nilai Diajarkan"
length_use: "Panjang Penggunaan"
length_use_time: "3 tahun"
students_enrolled: "Siswa yang Mendaftar Tahun Ini"
students_enrolled_number: "130"
courses_covered: "Kursus yang Dicakup"
course1: "Ilmu Komputer 1"
course2: "Ilmu Komputer 2"
course3: "Ilmu Komputer 3"
course4: "Ilmu Komputer 4"
course5: "Pengembangan Game 1"
fav_features: "Fitur Favorit"
responsive_support: "Dukungan Responsif"
immediate_engagement: "Keterlibatan Segera"
paragraph1: "Bobby Duke Middle School terletak di antara pegunungan California Selatan di Lembah Coachella di barat dan timur dan Laut Salton 33 mil selatan, dan membanggakan populasi siswa 697 siswa dalam populasi seluruh distrik Coachella Valley Unified sebanyak 18.861 siswa . "
paragraph2: "Para siswa Sekolah Menengah Bobby Duke mencerminkan tantangan sosial ekonomi yang dihadapi penduduk dan siswa Coachella Valley di dalam distrik tersebut. Dengan lebih dari 95% populasi siswa Sekolah Menengah Bobby Duke memenuhi syarat untuk makan gratis dan dengan harga lebih murah dan lebih dari 40% diklasifikasikan sebagai pembelajar bahasa Inggris, pentingnya mengajarkan keterampilan abad ke-21 adalah prioritas utama guru Teknologi Sekolah Menengah Bobby Duke, Scott Baily. "
paragraph3: "Baily tahu bahwa mengajari siswanya pengkodean adalah jalan utama menuju peluang dalam lanskap pekerjaan yang semakin memprioritaskan dan membutuhkan keterampilan komputasi. Jadi, dia memutuskan untuk mengambil tantangan yang menarik dalam membuat dan mengajar satu-satunya kelas pengkodean di sekolah dan menemukan solusi yang terjangkau, responsif terhadap umpan balik, dan menarik bagi siswa dari semua kemampuan dan latar belakang belajar. "
teacher_quote: "Ketika saya mendapatkan CodeCombat [dan] mulai meminta siswa saya menggunakannya, bola lampu menyala. Hanya siang dan malam dari setiap program lain yang kami gunakan. Mereka bahkan tidak menutup."
quote_attribution: "Scott Baily, Guru Teknologi"
read_full_story: "Baca Kisah Lengkap"
more_stories: "Lebih Banyak Kisah Mitra"
partners_heading_1: "Mendukung Banyak Jalur CS dalam Satu Kelas"
partners_school_1: "Preston High School"
partners_heading_2: "Unggul dalam Ujian AP"
partners_school_2: "River Ridge High School"
partners_heading_3: "Mengajar Ilmu Komputer Tanpa Pengalaman Sebelumnya"
partners_school_3: "Riverdale High School"
download_study: "Unduh Studi Riset"
teacher_spotlight: "Sorotan Guru & Siswa"
teacher_name_1: "Amanda Henry"
teacher_title_1: "Instruktur Rehabilitasi"
teacher_location_1: "Morehead, Kentucky"
spotlight_1: "Melalui belas kasih dan semangatnya untuk membantu mereka yang membutuhkan kesempatan kedua, Amanda Henry membantu mengubah kehidupan siswa yang membutuhkan teladan positif. Tanpa pengalaman ilmu komputer sebelumnya, Henry memimpin siswanya meraih kesuksesan coding dalam kompetisi coding regional . "
teacher_name_2: "Kaila, Siswa"
teacher_title_2: "Maysville Community & Technical College"
teacher_location_2: "Lexington, Kentucky"
spotlight_2: "Kaila adalah seorang siswa yang tidak pernah mengira dia akan menulis baris kode, apalagi mendaftar di perguruan tinggi dengan jalan menuju masa depan yang cerah."
teacher_name_3: "Susan Jones-Szabo"
teacher_title_3: "Pustakawan Guru"
teacher_school_3: "Ruby Bridges Elementary"
teacher_location_3: "Alameda, CA"
spotlight_3: "Susan Jones-Szabo mempromosikan suasana yang setara di kelasnya di mana setiap orang dapat menemukan kesuksesan dengan caranya sendiri. Kesalahan dan perjuangan disambut karena semua orang belajar dari tantangan, bahkan dari guru."
continue_reading_blog: "Lanjutkan Membaca di Blog ..."
loading_error:
could_not_load: "Kesalahan memuat dari server. Coba segarkan halaman."
connection_failure: "Koneksi Gagal"
connection_failure_desc: "Sepertinya kamu tidak terhubung dengan internet! Periksa jaringan kamu dan muat ulang halaman ini."
login_required: "Wajib Masuk"
login_required_desc: "Anda harus masuk untuk mengakses halaman ini."
unauthorized: "Anda harus masuk. Apakah anda menonaktifkan cookies?"
forbidden: "Terlarang"
forbidden_desc: "Oh tidak, tidak ada yang kami bisa tunjukkan kepadamu di sini! Pastikan kamu masuk menggunakan akun yang benar, atau kunjungi salah satu tautan dibawah untuk kembali ke pemrograman!"
user_not_found: "Pengguna tidak ditemukan"
not_found: "Tidak Ditemukan"
not_found_desc: "Hm, tidak ada apa-apa di sini. Kunjungi salah satu tautan berikut untuk kembali ke pemrograman!"
not_allowed: "Metode tidak diijinkan."
timeout: "Waktu Server Habis"
conflict: "Konflik sumber daya."
bad_input: "Masukan salah."
server_error: "Kesalahan server."
unknown: "Kesalahan tidak diketahui"
error: "KESALAHAN"
general_desc: "Ada yang salah, dan mungkin itu salah kami. Coba tunggu sebentar lalu muat ulang halaman, atau kunjungi salah satu tautan dibawah untuk kembali ke pemrograman!"
too_many_login_failures: "Terlalu banyak upaya login yang gagal. Silakan coba lagi nanti."
resources:
level: "Level"
patch: "Perbaikan"
patches: "Perbaikan"
system: "Sistem"
systems: "Sistem"
component: "Komponen"
components: "Komponen"
hero: "Jagoan"
campaigns: "Kampanye"
concepts:
advanced_css_rules: "Aturan CSS Lanjutan"
advanced_css_selectors: "Advanced CSS Selectors"
advanced_html_attributes: "Atribut HTML Lanjutan"
advanced_html_tags: "Tag HTML Lanjutan"
algorithm_average: "Rata-Rata Algoritme"
algorithm_find_minmax: "Algoritma Temukan Min / Maks"
algorithm_search_binary: "Biner Penelusuran Algoritme"
algorithm_search_graph: "Grafik Penelusuran Algoritme"
algorithm_sort: "Urutan Algoritme"
algorithm_sum: "Jumlah Algoritme"
arguments: "Argumen"
arithmetic: "Aritmatika"
array_2d: "Larik 2D"
array_index: "Pengindeksan Array"
array_iterating: "Iterasi Terhadap Array"
array_literals: "Array Literals"
array_searching: "Pencarian Array"
array_sorting: "Penyortiran Array"
arrays: "Array"
basic_css_rules: "Aturan CSS dasar"
basic_css_selectors: "Pemilih CSS dasar"
basic_html_attributes: "Atribut HTML Dasar"
basic_html_tags: "Tag HTML Dasar"
basic_syntax: "Sintaks Dasar"
binary: "Biner"
boolean_and: "Boolean Dan"
boolean_inequality: "Pertidaksamaan Boolean"
boolean_equality: "Persamaan Boolean"
boolean_greater_less: "Boolean Lebih Besar / Kurang"
boolean_logic_shortcircuit: "Boolean Logika Shortcircuit"
boolean_not: "Boolean Not"
boolean_operator_precedence: "Prioritas Operator Boolean"
boolean_or: "Boolean Atau"
boolean_with_xycoordinates: "Perbandingan Koordinat"
bootstrap: "Bootstrap"
break_statements: "Pernyataan Hentian"
classes: "Kelas"
continue_statements: "Pernyataan Lanjutan"
dom_events: "Event DOM"
dynamic_styling: "Penataan Gaya Dinamis"
events: "Event"
event_concurrency: "Konkurensi Event"
event_data: "Data Event"
event_handlers: "Penangan Event"
event_spawn: "Bibit Event"
for_loops: "For Loop"
for_loops_nested: "For Loops Bersarang"
for_loops_range: "Untuk Rentang Pengulangan"
functions: "Fungsi"
functions_parameters: "Parameter"
functions_multiple_parameters: "Beberapa Parameter"
game_ai: "Game AI"
game_goals: "Tujuan Game"
game_spawn: "Game Spawn"
graphics: "Grafik"
graphs: "Grafik"
heaps: "Heap"
if_condition: "Pernyataan Bersyarat If"
if_else_if: " Pernyataan Jika / Jika Lain"
if_else_statements: "Pernyataan If / Else"
if_statements: "Jika Pernyataan"
if_statements_nested: "Pernyataan Jika Bersarang"
indexing: "Indeks Array"
input_handling_flags: "Penanganan Input - Bendera"
input_handling_keyboard: "Penanganan Input - Keyboard"
input_handling_mouse: "Penanganan Input - Mouse"
intermediate_css_rules: "Aturan CSS Menengah"
intermediate_css_selectors: "Pemilih CSS Menengah"
intermediate_html_attributes: "Atribut HTML Menengah"
intermediate_html_tags: "Tag HTML Menengah"
jquery: "jQuery"
jquery_animations: "Animasi jQuery"
jquery_filtering: "Pemfilteran Elemen jQuery"
jquery_selectors: "jQuery Selector"
length: "Panjang Array"
math_coordinates: "Matematika Koordinat"
math_geometry: "Geometri"
math_operations: "Operasi Perpustakaan Matematika"
math_proportions: "Proporsi Matematika"
math_trigonometry: "Trigonometri"
object_literals: "Objek literal"
parameters: "Parameter"
programs: "Program"
properties: "Properti"
property_access: "Mengakses Properti"
property_assignment: "Menetapkan Properti"
property_coordinate: "Properti Koordinat"
queues: "Struktur Data - Antrian"
reading_docs: "Membaca Dokumen"
recursion: "Rekursi"
return_statements: "Pernyataan Pengembalian"
stacks: "Struktur Data - Tumpukan"
strings: "String"
strings_concatenation: "Penggabungan String"
strings_substrings: "Substring"
trees: "Struktur Data - Pohon"
variables: "Variabel"
vectors: "Vektor"
while_condition_loops: "While Loops dengan Persyaratan"
while_loops_simple: "While Loops"
while_loops_nested: "Nested While Loops"
xy_coordinates: "Pasangan Koordinat"
advanced_strings: "String Lanjutan" # Rest of concepts are deprecated
algorithms: "Algoritme"
boolean_logic: "Boolean Logic"
basic_html: "HTML Dasar"
basic_css: "CSS Dasar"
basic_web_scripting: "Pembuatan Skrip Web Dasar"
intermediate_html: "HTML Menengah"
intermediate_css: "CSS Menengah"
intermediate_web_scripting: "Pembuatan Skrip Web Menengah"
advanced_html: "HTML Lanjutan"
advanced_css: "CSS Lanjutan"
advanced_web_scripting: "Pembuatan Skrip Web Tingkat Lanjut"
input_handling: "Penanganan Input"
while_loops: "While Loops"
place_game_objects: "Tempatkan objek game"
construct_mazes: "Bangun labirin"
create_playable_game: "Buat proyek game yang dapat dimainkan dan dapat dibagikan"
alter_existing_web_pages: "Ubah halaman web yang ada"
create_sharable_web_page: "Buat halaman web yang bisa dibagikan"
basic_input_handling: "Penanganan Input Dasar"
basic_game_ai: "AI Game Dasar"
basic_javascript: "JavaScript Dasar"
basic_event_handling: "Penanganan Event Dasar"
create_sharable_interactive_web_page: "Buat halaman web interaktif yang dapat dibagikan"
anonymous_teacher:
notify_teacher: "Beri Tahu Guru"
create_teacher_account: "Buat akun guru gratis"
enter_student_name: "Nama anda:"
enter_teacher_email: "Email guru anda:"
teacher_email_placeholder: "guruku@contoh.com"
student_name_placeholder: "ketik nama anda di sini"
teachers_section: "Guru:"
students_section: "Siswa:"
teacher_notified: "Kami telah memberi tahu guru kamu bahwa kamu ingin memainkan lebih CodeCombat di kelasmu!"
delta:
added: "Ditambahkan"
modified: "Berubah"
not_modified: "Tidak Berubah"
deleted: "Dihapus"
moved_index: "Indeks Pindah"
text_diff: "Perbedaan Teks"
merge_conflict_with: "GABUNG PERBEDAAN DENGAN"
no_changes: "Tidak Ada Perubahan"
legal:
page_title: "Hukum"
opensource_introduction: "CodeCombat adalah bagian dari komunitas open source."
opensource_description_prefix: "Lihat"
github_url: "GitHub kami"
opensource_description_center: "dan bantu jika Anda suka! CodeCombat dibangun di atas lusinan proyek open source, dan kami menyukainya. Lihat"
archmage_wiki_url: "wiki Archmage kami"
opensource_description_suffix: "untuk daftar perangkat lunak yang memungkinkan permainan ini."
practices_title: "Praktik Terbaik yang Menghormati"
practices_description: "Ini adalah janji kami untuk Anda, pemain, dalam bahasa yang tidak terlalu legal."
privacy_title: "Privasi"
privacy_description: "Kami tidak akan menjual informasi pribadi Anda."
security_title: "Keamanan"
security_description: "Kami berusaha keras untuk menjaga keamanan informasi pribadi Anda. Sebagai proyek sumber terbuka, situs kami terbuka secara bebas bagi siapa saja untuk meninjau dan meningkatkan sistem keamanan kami."
email_title: "Email"
email_description_prefix: "Kami tidak akan membanjiri Anda dengan spam. Melalui"
email_settings_url: "setelan email Anda"
email_description_suffix: "atau melalui tautan di email yang kami kirim, Anda dapat mengubah preferensi dan berhenti berlangganan dengan mudah kapan saja."
cost_title: "Biaya"
cost_description: "CodeCombat gratis dimainkan untuk semua level intinya, dengan langganan $ {{price}} USD / bln untuk akses ke cabang level ekstra dan {{gems}} permata bonus per bulan. Anda dapat membatalkan dengan klik, dan kami menawarkan jaminan uang kembali 100%. " # {change}
copyrights_title: "Hak Cipta dan Lisensi"
contributor_title: "Perjanjian Lisensi Kontributor"
contributor_description_prefix: "Semua kontribusi, baik di situs dan di repositori GitHub kami, tunduk pada"
cla_url: "CLA"
contributor_description_suffix: "yang harus Anda setujui sebelum berkontribusi."
code_title: "Kode Sisi Klien - MIT"
client_code_description_prefix: "Semua kode sisi klien untuk codecombat.com di repositori GitHub publik dan dalam database codecombat.com, dilisensikan di bawah"
mit_license_url: "lisensi MIT"
code_description_suffix: "Ini termasuk semua kode dalam Sistem dan Komponen yang disediakan oleh CodeCombat untuk tujuan membuat level."
art_title: "Seni / Musik - Creative Commons"
art_description_prefix: "Semua konten umum tersedia di bawah"
cc_license_url: "Lisensi Internasional Creative Commons Attribution 4.0"
art_description_suffix: "Konten umum adalah segala sesuatu yang secara umum disediakan oleh CodeCombat untuk tujuan membuat Level. Ini termasuk:"
art_music: "Musik"
art_sound: "Suara"
art_artwork: "Karya Seni"
art_sprites: "Sprite"
art_other: "Semua karya kreatif non-kode lainnya yang tersedia saat membuat Level."
art_access: "Saat ini tidak ada sistem universal dan mudah untuk mengambil aset ini. Secara umum, ambil dari URL seperti yang digunakan oleh situs, hubungi kami untuk bantuan, atau bantu kami dalam memperluas situs untuk membuat aset ini lebih mudah diakses . "
art_paragraph_1: "Untuk atribusi, harap beri nama dan tautkan ke codecombat.com di dekat tempat sumber digunakan atau jika sesuai untuk medianya. Misalnya:"
use_list_1: "Jika digunakan dalam film atau game lain, sertakan codecombat.com dalam kreditnya."
use_list_2: "Jika digunakan di situs web, sertakan tautan di dekat penggunaan, misalnya di bawah gambar, atau di laman atribusi umum tempat Anda juga dapat menyebutkan karya Creative Commons lainnya dan perangkat lunak sumber terbuka yang digunakan di situs itu. sudah dengan jelas mereferensikan CodeCombat, seperti entri blog yang menyebutkan CodeCombat, tidak memerlukan atribusi terpisah. "
art_paragraph_2: "Jika konten yang digunakan bukan dibuat oleh CodeCombat melainkan oleh pengguna codecombat.com, atributkan konten tersebut sebagai gantinya, dan ikuti petunjuk atribusi yang diberikan dalam deskripsi sumber daya tersebut jika ada."
rights_title: "Hak Dilindungi"
rights_desc: "Semua hak dilindungi undang-undang untuk Level itu sendiri. Ini termasuk"
rights_scripts: "Skrip"
rights_unit: "Konfigurasi unit"
rights_writings: "Tulisan"
rights_media: "Media (suara, musik) dan konten kreatif lainnya yang dibuat khusus untuk Tingkat itu dan tidak tersedia secara umum saat membuat Tingkat."
rights_clarification: "Untuk memperjelas, apa pun yang tersedia di Editor Tingkat untuk tujuan membuat tingkat berada di bawah CC, sedangkan konten yang dibuat dengan Editor Tingkat atau diunggah selama pembuatan Tingkat tidak."
nutshell_title: "Sekilas"
nutshell_description: "Sumber daya apa pun yang kami sediakan di Editor Tingkat bebas digunakan sesuka Anda untuk membuat Tingkat. Namun kami berhak membatasi distribusi Tingkat itu sendiri (yang dibuat di codecombat.com) sehingga dapat dikenai biaya untuk."
nutshell_see_also: "Lihat juga:"
canonical: "Versi bahasa Inggris dari dokumen ini adalah versi definitif dan kanonik. Jika ada perbedaan antara terjemahan, dokumen bahasa Inggris diutamakan."
third_party_title: "Layanan Pihak Ketiga"
third_party_description: "CodeCombat menggunakan layanan pihak ketiga berikut (antara lain):"
cookies_message: "CodeCombat menggunakan beberapa cookie penting dan non-esensial."
cookies_deny: "Tolak cookie yang tidak penting"
cookies_allow: "Izinkan cookie"
calendar:
year: "Tahun"
day: "Hari"
month: "Bulan"
january: "Januari"
february: "Februari"
march: "Maret"
april: "April"
may: "Mei"
june: "Juni"
july: "Juli"
august: "Agustus"
september: "September"
october: "Oktober"
november: "November"
december: "Desember"
code_play_create_account_modal:
title: "Kamu berhasil!" # This section is only needed in US, UK, Mexico, India, and Germany
body: "Anda sekarang dalam perjalanan untuk menjadi master coder. Daftar untuk menerima <strong> 100 Permata </strong> ekstra & Anda juga akan dimasuki untuk kesempatan <strong> memenangkan $2.500 & Hadiah Lenovo lainnya </strong>. "
sign_up: "Daftar & pertahankan coding ▶"
victory_sign_up_poke: "Buat akun gratis untuk menyimpan kode Anda & masuki kesempatan untuk memenangkan hadiah!"
victory_sign_up: "Daftar & ikuti <strong> win $2.500 </strong>"
server_error:
email_taken: "Email telah diambil"
username_taken: "Username telah diambil"
easy_password: "Kata sandi terlalu mudah ditebak"
reused_password: "Kata sandi tidak dapat digunakan kembali"
esper:
line_no: "Baris $1:"
uncaught: "Tidak tertangkap $1" # $1 will be an error type, eg "Uncaught SyntaxError"
reference_error: "Kesalahan Referensi: "
argument_error: "Kesalahan Argumen: "
type_error: "Kesalahan Tipe: "
syntax_error: "Kesalahan Sintaks: "
error: "Kesalahan: "
x_not_a_function: "$1 bukan fungsi"
x_not_defined: "$1 tidak ditentukan"
spelling_issues: "Waspadai masalah ejaan: apakah yang Anda maksud adalah `$1`, bukan `$2`?"
capitalization_issues: "Perhatikan kapitalisasi: `$1` seharusnya `$2`."
py_empty_block: "Kosongkan $1. Letakkan 4 spasi di depan pernyataan di dalam pernyataan $2."
fx_missing_paren: "Jika Anda ingin memanggil `$1` sebagai fungsi, Anda memerlukan `()`'s "
unmatched_token: "Tidak cocok `$1`. Setiap pembukaan `$2` membutuhkan penutup `$3` untuk mencocokkannya. "
unterminated_string: "String tidak diakhiri. Tambahkan `\"` yang cocok di akhir string Anda. "
missing_semicolon: "Titik koma tidak ada."
missing_quotes: "Kutipan tidak ada. Coba `$1` "
argument_type: "Argumen `$1` `$2` seharusnya memiliki jenis `$3`, tetapi mendapatkan `$4`: `$5`. "
argument_type2: "Argumen `$1` `$2` seharusnya memiliki jenis `$3`, tetapi mendapatkan `$4`."
target_a_unit: "Targetkan sebuah unit."
attack_capitalization: "Serang $1, bukan $2. (Huruf kapital penting.)"
empty_while: "Statement while kosong. Letakkan 4 spasi di depan pernyataan di dalam pernyataan while."
line_of_site: "Argumen `$1` `$2` bermasalah. Apakah masih ada musuh dalam garis pandang Anda?"
need_a_after_while: "Membutuhkan `$1` setelah `$2`."
too_much_indentation: "Terlalu banyak indentasi di awal baris ini."
missing_hero: "Kata kunci `$1` tidak ada; seharusnya `$2`."
takes_no_arguments: "`$1` tidak membutuhkan argumen. "
no_one_named: "Tidak ada yang bernama \"$1\" untuk ditargetkan."
separated_by_comma: "Pemanggilan fungsi paramaters harus dipisahkan oleh `,`s"
protected_property: "Tidak dapat membaca properti yang dilindungi: $1"
need_parens_to_call: "Jika Anda ingin memanggil `$1` sebagai fungsi, Anda memerlukan `()`'s "
expected_an_identifier: "Mengharapkan pengenal dan malah melihat '$1'."
unexpected_identifier: "Pengenal tak terduga"
unexpected_end_of: "Akhir masukan tak terduga"
unnecessary_semicolon: "Titik koma tidak perlu."
unexpected_token_expected: "Token tidak terduga: diharapkan $1 tetapi menemukan $2 saat mengurai $3"
unexpected_token: "Token tak terduga $1"
unexpected_token2: "Token tidak terduga"
unexpected_number: "Angka tidak terduga"
unexpected: "'$1' tak terduga."
escape_pressed_code: "Escape ditekan; kode dibatalkan."
target_an_enemy: "Targetkan musuh dengan nama, seperti `$1`, bukan string `$2`."
target_an_enemy_2: "Targetkan musuh dengan nama, seperti $1."
cannot_read_property: "Tidak dapat membaca properti '$1' dari undefined"
attempted_to_assign: "Mencoba menugaskan ke properti hanya-baca."
unexpected_early_end: "Akhir program yang tidak terduga."
you_need_a_string: "Anda memerlukan string untuk membuat; salah satu dari $1"
unable_to_get_property: "Tidak bisa mendapatkan properti '$1' dari referensi tidak terdefinisi atau null" # TODO: Do we translate undefined/null?
code_never_finished_its: "Kode tidak pernah selesai. Bisa sangat lambat atau memiliki putaran tak terbatas."
unclosed_string: "String tidak tertutup"
unmatched: "Tidak ada yang cocok '$1'."
error_you_said_achoo: "Anda mengatakan: $1, tetapi sandinya adalah: $2. (Huruf kapital penting.)"
indentation_error_unindent_does: "Kesalahan Indentasi: unindent tidak cocok dengan tingkat indentasi luar mana pun"
indentation_error: "Kesalahan indentasi."
need_a_on_the: "Perlu `:` di akhir baris setelah `$1`. "
attempt_to_call_undefined: "coba panggil '$1' (nilai nihil)"
unterminated: "Tidak diakhiri `$1` "
target_an_enemy_variable: "Targetkan variabel $1, bukan string $2. (Coba gunakan $3.)"
error_use_the_variable: "Gunakan nama variabel seperti `$1` sebagai ganti string seperti `$2`"
indentation_unindent_does_not: "Indentasi tidak indentasi tidak cocok dengan tingkat indentasi luar mana pun"
unclosed_paren_in_function_arguments: "$1 tidak ditutup dalam argumen fungsi."
unexpected_end_of_input: "Akhir input tak terduga"
there_is_no_enemy: "Tidak ada `$1`. Gunakan `$2` dulu." # Hints start here
try_herofindnearestenemy: "Coba `$1`"
there_is_no_function: "Tidak ada fungsi `$1`, tetapi `$2` memiliki metode `$3`. "
attacks_argument_enemy_has: "Argumen `$1` `$2` bermasalah."
is_there_an_enemy: "Apakah masih ada musuh dalam garis pandang Anda?"
target_is_null_is: "Targetnya $1. Apakah selalu ada target untuk diserang? (Gunakan $2?)"
hero_has_no_method: "`$1` tidak memiliki metode `$2`."
there_is_a_problem: "Ada masalah dengan kode Anda."
did_you_mean: "Apakah maksud Anda $1? Anda tidak memiliki item yang dilengkapi dengan keterampilan itu."
missing_a_quotation_mark: "Tanda petik tidak ada."
missing_var_use_var: "Tidak ada `$1`. Gunakan `$2` untuk membuat variabel baru."
you_do_not_have: "Anda tidak memiliki item yang dilengkapi dengan keahlian $1."
put_each_command_on: "Tempatkan setiap perintah pada baris terpisah"
are_you_missing_a: "Apakah Anda kehilangan '$1' setelah '$2'?"
your_parentheses_must_match: "Tanda kurung Anda harus cocok."
apcsp:
title: "AP Computer Science Principals | College Board Endorsed"
meta_description: "Hanya kurikulum CodeCombat yang komprehensif dan program pengembangan profesional yang Anda butuhkan untuk menawarkan kursus ilmu komputer terbaru College Board kepada siswa Anda."
syllabus: "Silabus Prinsip AP CS"
syllabus_description: "Gunakan sumber daya ini untuk merencanakan kurikulum CodeCombat untuk kelas AP Computer Science Principles Anda."
computational_thinking_practices: "Praktik Berpikir Komputasi"
learning_objectives: "Tujuan Pembelajaran"
curricular_requirements: "Persyaratan Kurikuler"
unit_1: "Unit 1: Teknologi Kreatif"
unit_1_activity_1: "Aktivitas Unit 1: Tinjauan Kegunaan Teknologi"
unit_2: "Unit 2: Pemikiran Komputasi"
unit_2_activity_1: "Aktivitas Unit 2: Urutan Biner"
unit_2_activity_2: "Kegiatan Unit 2: Menghitung Proyek Pelajaran"
unit_3: "Unit 3: Algoritme"
unit_3_activity_1: "Aktivitas Unit 3: Algoritma - Panduan Penumpang"
unit_3_activity_2: "Kegiatan Unit 3: Simulasi - Predator & Mangsa"
unit_3_activity_3: "Aktivitas Unit 3: Algoritma - Desain dan Pemrograman Pasangan"
unit_4: "Unit 4: Pemrograman"
unit_4_activity_1: "Aktivitas Unit 4: Abstraksi"
unit_4_activity_2: "Aktivitas Unit 4: Menelusuri & Menyortir"
unit_4_activity_3: "Aktivitas Unit 4: Refactoring"
unit_5: "Unit 5: Internet"
unit_5_activity_1: "Aktivitas Unit 5: Cara Kerja Internet"
unit_5_activity_2: "Aktivitas Unit 5: Simulator Internet"
unit_5_activity_3: "Aktivitas Unit 5: Simulasi Ruang Obrolan"
unit_5_activity_4: "Aktivitas Unit 5: Keamanan Siber"
unit_6: "Unit 6: Data"
unit_6_activity_1: "Kegiatan Unit 6: Pengantar Data"
unit_6_activity_2: "Aktivitas Unit 6: Big Data"
unit_6_activity_3: "Aktivitas Unit 6: Kompresi Lossy & Lossless"
unit_7: "Unit 7: Dampak Pribadi & Global"
unit_7_activity_1: "Aktivitas Unit 7: Dampak Pribadi & Global"
unit_7_activity_2: "Aktivitas Unit 7: Sumber Daya Crowdsourcing"
unit_8: "Unit 8: Tugas Kinerja"
unit_8_description: "Persiapkan siswa untuk Membuat Tugas dengan membuat game mereka sendiri dan mempraktikkan konsep utama."
unit_8_activity_1: "Membuat Latihan Tugas 1: Pengembangan Game 1"
unit_8_activity_2: "Membuat Latihan Tugas 2: Pengembangan Game 2"
unit_8_activity_3: "Buat Latihan Tugas 3: Pengembangan Game 3"
unit_9: "Unit 9: Ulasan AP"
unit_10: "Unit 10: Pasca-AP"
unit_10_activity_1: "Aktivitas Unit 10: Kuis Web"
parents_landing_2:
splash_title: "Temukan keajaiban coding di rumah."
learn_with_instructor: "Belajar dengan Instruktur"
live_classes: "Kelas Daring Langsung"
live_classes_offered: "CodeCombat sekarang menawarkan kelas ilmu komputer online langsung untuk siswa yang belajar di rumah. Cocok untuk siswa yang bekerja paling baik dalam pengaturan 1: 1 atau kelompok kecil di mana hasil belajar disesuaikan dengan kebutuhan mereka."
live_class_details_1: "Kelompok kecil atau pelajaran pribadi"
live_class_details_2: "Pengodean JavaScript dan Python, ditambah konsep inti Ilmu Komputer"
live_class_details_3: "Diajarkan oleh instruktur pengkodean ahli"
live_class_details_4: "Masukan pribadi dan instan"
live_class_details_5: "Kurikulum dipercaya oleh lebih dari 80.000 pendidik"
try_free_class: "Coba kelas 60 menit gratis"
pricing_plans: "Paket Harga"
choose_plan: "Pilih Paket"
per_student: "per siswa"
sibling_discount: "Diskon Saudara 15%!"
small_group_classes: "Kelas Pengkodean Grup Kecil"
small_group_classes_detail: "4 Sesi Grup / Bulan."
small_group_classes_price: "$159/bln"
small_group_classes_detail_1: "Rasio siswa dan instruktur 4:1"
small_group_classes_detail_2: "Kelas 60 menit"
small_group_classes_detail_3: "Buat proyek dan berikan masukan kepada siswa lain"
small_group_classes_detail_4: "Berbagi layar untuk mendapatkan umpan balik langsung tentang pengkodean dan debugging"
private_classes: "Kelas Pengodean Pribadi"
four_sessions_per_month: "4 Sesi Pribadi / Bulan"
eight_sessions_per_month: "8 Sesi Pribadi / Bulan"
four_private_classes_price: "$219 / bln"
eight_private_classes_price: "$399 / bln"
private_classes_detail: "4 atau 8 Sesi Pribadi / Bulan."
private_classes_price: "$219/bln atau $399/bln"
private_classes_detail_1: "Rasio siswa dan instruktur 1: 1"
private_classes_detail_2: "kelas 60 menit"
private_classes_detail_3: "Jadwal fleksibel yang disesuaikan dengan kebutuhan Anda"
private_classes_detail_4: "Rencana pelajaran dan masukan langsung yang disesuaikan dengan gaya belajar, kecepatan, dan tingkat kemampuan siswa"
best_seller: "Penjualan terbaik"
best_value: "Nilai terbaik"
codecombat_premium: "CodeCombat Premium"
learn_at_own_pace: "Belajar dengan Kecepatan Anda Sendiri"
monthly_sub: "Langganan Bulanan"
buy_now: "Beli sekarang"
per_month: "/bulan"
lifetime_access: "Akses Seumur Hidup"
premium_details_title: "Bagus untuk pelajar mandiri yang berkembang dengan otonomi penuh."
premium_details_1: "Akses ke pahlawan, hewan peliharaan, dan keterampilan khusus pelanggan"
premium_details_2: "Dapatkan permata bonus untuk membeli perlengkapan, hewan peliharaan, dan lebih banyak pahlawan"
premium_details_3: "Buka pemahaman yang lebih dalam tentang konsep inti dan keterampilan seperti pengembangan web dan game"
premium_details_4: "Dukungan premium untuk pelanggan"
premium_details_5: "Buat klan pribadi untuk mengundang teman dan bersaing di papan peringkat grup"
premium_need_help: "Butuh bantuan atau lebih suka Paypal? Email <a href=\"mailto:support@codecombat.com\"> support@codecombat.com </a>"
not_sure_kid: "Tidak yakin apakah CodeCombat tepat untuk anak Anda? Tanya mereka!"
share_trailer: "Bagikan cuplikan game kami dengan anak Anda dan minta mereka membuat akun untuk memulai."
why_kids_love: "Mengapa Anak-Anak Suka CodeCombat"
learn_through_play: "Belajar Melalui Permainan"
learn_through_play_detail: "Siswa mengembangkan keterampilan pengkodean mereka, dan juga menggunakan keterampilan pemecahan masalah untuk maju melalui level dan memperkuat pahlawan mereka."
skills_they_can_share: "Keterampilan yang Dapat Mereka Bagikan"
skills_they_can_share_details: "Siswa membangun keterampilan dunia nyata dan membuat proyek, seperti game dan halaman web, yang dapat mereka bagikan dengan teman dan keluarga."
help_when_needed: "Bantuan Saat Mereka Membutuhkannya"
help_when_needed_detail: "Dengan menggunakan data, setiap level telah dibangun untuk menantang, tetapi tidak pernah mengecewakan. Siswa didukung dengan petunjuk saat mereka mengalami kebuntuan."
book_first_class: "Pesan kelas pertama Anda"
why_parents_love: "Mengapa Orang Tua Suka CodeCombat"
most_engaging: "Cara paling menarik untuk mempelajari kode yang diketik"
most_engaging_detail: "Anak Anda akan memiliki semua yang mereka butuhkan di ujung jari mereka untuk memprogram algoritme dalam Python atau JavaScript, membuat situs web, dan bahkan merancang game mereka sendiri, sambil mempelajari materi yang selaras dengan standar kurikulum nasional."
critical_skills: "Membangun keterampilan penting untuk abad ke-21"
critical_skills_detail: "Anak Anda akan belajar cara menavigasi dan menjadi warga negara di dunia digital. CodeCombat adalah solusi yang meningkatkan pemikiran kritis, kreativitas, dan ketahanan anak Anda, memberdayakan mereka dengan keterampilan yang mereka butuhkan untuk industri apa pun."
parent_support: "Didukung oleh orang tua seperti Anda"
parent_support_detail: "Di CodeCombat, kami adalah orang tua. Kami pembuat kode. Kami adalah pendidik. Namun yang terpenting, kami adalah orang-orang yang percaya dalam memberi anak-anak kami kesempatan terbaik untuk sukses dalam apa pun yang mereka putuskan untuk lakukan . "
everything_they_need: "Semua yang mereka butuhkan untuk mulai mengetik kode sendiri"
beginner_concepts: "Konsep Pemula"
beginner_concepts_1: "Sintaks dasar"
beginner_concepts_2: "While loop"
beginner_concepts_3: "Argumen"
beginner_concepts_4: "String"
beginner_concepts_5: "Variable"
beginner_concepts_6: "Algoritme"
intermediate_concepts: "Konsep Menengah"
intermediate_concepts_1: "Pernyataan Jika"
intermediate_concepts_2: "Perbandingan Boolean"
intermediate_concepts_3: "Kondisional bertingkat"
intermediate_concepts_4: "Fungsi"
intermediate_concepts_5: "Penanganan input dasar"
intermediate_concepts_6: "Kecerdasan buatan permainan dasar"
advanced_concepts: "Konsep Lanjutan"
advanced_concepts_1: "Penanganan Event"
advanced_concepts_2: "Bersyarat saat loop"
advanced_concepts_3: "Objek literals"
advanced_concepts_4: "Parameter"
advanced_concepts_5: "Vektor"
advanced_concepts_6: "Operasi perpustakaan matematika"
advanced_concepts_7: "Rekursi"
get_started: "Memulai"
quotes_title: "Apa yang orang tua dan anak-anak katakan tentang CodeCombat"
quote_1: "\"Ini adalah pengkodean tingkat berikutnya untuk anak-anak dan sangat menyenangkan. Saya akan belajar satu atau dua hal dari ini juga. \""
quote_2: "\"Saya suka mempelajari keterampilan baru yang belum pernah saya lakukan sebelumnya. Saya suka ketika saya berjuang, saya bisa menemukan tujuan. Saya juga senang Anda dapat melihat kode tersebut berfungsi dengan benar. \""
quote_3: "\"Oliver’s Python akan segera hadir. Dia menggunakan CodeCombat untuk membuat gim videonya sendiri. Dia menantang saya untuk memainkan permainannya, lalu tertawa ketika saya kalah. \""
quote_4: "\"Ini adalah salah satu hal favorit saya untuk dilakukan. Setiap pagi saya bangun dan bermain CodeCombat. Jika saya harus memberi CodeCombat peringkat dari 1 sampai 10, saya akan memberikannya 10!\""
parent: "Orang Tua"
student: "Siswa"
grade: "Tingkat"
subscribe_error_user_type: "Sepertinya Anda sudah mendaftar untuk sebuah akun. Jika Anda tertarik dengan CodeCombat Premium, silakan hubungi kami di team@codecombat.com."
subscribe_error_already_subscribed: "Anda sudah mendaftar untuk akun Premium."
start_free_trial_today: "Mulai uji coba gratis hari ini"
live_classes_title: "Kelas pengkodean langsung dari CodeCombat!"
live_class_booked_thank_you: "Kelas langsung Anda telah dipesan, terima kasih!"
book_your_class: "Pesan Kelas Anda"
call_to_book: "Telepon sekarang untuk memesan"
modal_timetap_confirmation:
congratulations: "Selamat!"
paragraph_1: "Petualangan coding siswa Anda menanti."
paragraph_2: "Kami telah memesan anak Anda untuk kelas online dan kami sangat senang bertemu dengan mereka!"
paragraph_3: "Sebentar lagi Anda akan menerima undangan email dengan detail jadwal kelas serta nama instruktur kelas dan informasi kontak Anda."
paragraph_4: "Jika karena alasan apa pun Anda perlu mengubah pilihan kelas, menjadwalkan ulang, atau hanya ingin berbicara dengan spesialis layanan pelanggan, cukup hubungi menggunakan informasi kontak yang disediakan dalam undangan email Anda."
paragraph_5: "Terima kasih telah memilih CodeCombat dan semoga sukses dalam perjalanan ilmu komputer Anda!"
back_to_coco: "Kembali ke CodeCombat"
hoc_2018:
banner: "Selamat Datang di Hour of Code!"
page_heading: "Siswa Anda akan belajar membuat kode dengan membuat game mereka sendiri!"
# page_heading_ai_league: "Your students will learn to code their own multiplayer AI!"
step_1: "Langkah 1: Tonton Video Ikhtisar"
step_2: "Langkah 2: Coba Sendiri"
step_3: "Langkah 3: Unduh Rencana Pelajaran"
try_activity: "Coba Aktivitas"
download_pdf: "Unduh PDF"
teacher_signup_heading: "Ubah Jam Kode menjadi Tahun Kode"
teacher_signup_blurb: "Semua yang Anda butuhkan untuk mengajarkan ilmu komputer, tidak perlu pengalaman sebelumnya."
teacher_signup_input_blurb: "Dapatkan kursus pertama gratis:"
teacher_signup_input_placeholder: "Alamat email guru"
teacher_signup_input_button: "Dapatkan CS1 Gratis"
activities_header: "Jam Lebih Banyak Aktivitas Kode"
activity_label_1: "Kabur dari Dungeon!"
activity_label_2: "Pemula: Buat Game!"
activity_label_3: "Lanjutan: Buat Game Arkade!"
# activity_label_hoc_2018: "Intermediate GD: Code, Play, Create"
# activity_label_ai_league: "Beginner CS: Road to the AI League"
activity_button_1: "Lihat Pelajaran"
about: "Tentang CodeCombat"
about_copy: "Program ilmu komputer berbasis permainan dan selaras dengan standar yang mengajarkan Python dan JavaScript yang nyata dan diketik."
point1: "✓ Kerangka Dibuat"
point2: "✓ Dibedakan"
point3: "✓ Penilaian"
point4: "✓ Kursus berbasis proyek"
point5: "✓ Pelacakan siswa"
point6: "✓ Rencana pelajaran lengkap"
title: "HOUR OF CODE"
acronym: "HOC"
hoc_2018_interstitial:
welcome: "Selamat datang di CodeCombat's Hour of Code!"
educator: "Saya seorang pendidik"
show_resources: "Tunjukkan sumber daya guru!"
student: "Saya seorang siswa"
ready_to_code: "Saya siap membuat kode!"
hoc_2018_completion:
congratulations: "Selamat, Anda telah menyelesaikan tantangan Code, Play, Share!"
send: "Kirim game Hour of Code Anda ke teman dan keluarga!"
copy: "Salin URL"
get_certificate: "Dapatkan sertifikat kelulusan untuk merayakan bersama kelas Anda!"
get_cert_btn: "Dapatkan Sertifikat"
first_name: "Nama depan"
last_initial: "Inisial Terakhir"
teacher_email: "Alamat email guru"
school_administrator:
title: "Dasbor Administrator Sekolah"
my_teachers: "Guru Saya"
last_login: "Login Terakhir"
licenses_used: "lisensi yang digunakan"
total_students: "total students"
active_students: "siswa aktif"
projects_created: "proyek dibuat"
other: "Lainnya"
notice: "Administrator sekolah berikut memiliki akses hanya lihat ke data kelas Anda:"
add_additional_teacher: "Perlu menambah pengajar tambahan? Hubungi Manajer Akun CodeCombat Anda atau kirim email ke support@codecombat.com."
license_stat_description: "Lisensi akun yang tersedia untuk jumlah lisensi yang tersedia untuk guru, termasuk Lisensi Bersama."
students_stat_description: "Total akun siswa untuk semua siswa di semua ruang kelas, terlepas dari apakah mereka memiliki lisensi yang diterapkan."
active_students_stat_description: "Siswa aktif menghitung jumlah siswa yang login ke CodeCombat dalam 60 hari terakhir."
project_stat_description: "Proyek yang dibuat menghitung jumlah total proyek pengembangan Game dan Web yang telah dibuat."
no_teachers: "Anda tidak mengadminkan guru."
totals_calculated: "Bagaimana cara menghitung total ini?"
totals_explanation_1: "Bagaimana cara menghitung total ini?"
totals_explanation_2: "Lisensi yang digunakan"
totals_explanation_3: "Menghitung total lisensi yang diterapkan ke siswa dari total lisensi yang tersedia."
totals_explanation_4: "Jumlah siswa"
totals_explanation_5: "Menghitung jumlah siswa guru di semua kelas aktif mereka. Untuk melihat total siswa yang terdaftar di kelas aktif dan yang diarsipkan, buka halaman Lisensi Siswa"
totals_explanation_6: "Siswa aktif"
totals_explanation_7: "Menghitung terakhir semua siswa yang aktif dalam 60 hari."
totals_explanation_8: "Proyek dibuat"
totals_explanation_9: "Menghitung total game dan halaman web yang dibuat."
date_thru_date: "__startDateRange__ thru __endDateRange__"
interactives:
phenomenal_job: "Pekerjaan Fenomenal!"
try_again: "Ups, coba lagi!"
select_statement_left: "Ups, pilih pernyataan dari kiri sebelum menekan \"Kirim.\""
fill_boxes: "Ups, pastikan untuk mengisi semua kotak sebelum menekan \"Kirim.\""
browser_recommendation:
title: "CodeCombat bekerja paling baik di Chrome!"
pitch_body: "Untuk pengalaman CodeCombat terbaik, sebaiknya gunakan Chrome versi terbaru. Unduh versi terbaru chrome dengan mengeklik tombol di bawah!"
download: "Unduh Chrome"
ignore: "Abaikan"
admin:
license_type_full: "Kursus Lengkap"
license_type_customize: "Sesuaikan Kursus"
# outcomes:
# outcomes_report: "Outcomes Report"
# customize_report: "Customize Report"
# done_customizing: "Done Customizing"
# start_date: "Start date"
# end_date: "End date"
# school_admin: "School Administrator"
# school_network: "School Network"
# school_subnetwork: "School Subnetwork"
# classroom: "Classroom"
# view_outcomes_report: "View Outcomes Report"
# key_concepts: "Key Concepts"
# code_languages: "Code Languages"
# using_codecombat: "Using CodeCombat's personalized learning engine..."
# wrote: "wrote..."
# across_an_estimated: "across an estimated..."
# in: "in..."
# include: "Include "
# archived: "Archived"
# max: "Max "
# multiple: "s"
# computer_program: "computer program"
# computer_programs: "computer programs"
# line_of_code: "line of code"
# lines_of_code: "lines of code"
# coding_hours: "coding hours"
# expressed_creativity: "and expressed creativity by building"
# report_content_1: "standalone game and web "
# project: "project"
# projects: "projects"
# progress_stats: "Progress stats based on sampling __sampleSize__ of __populationSize__ students."
# standards_coverage: "Standards Coverage"
# coverage_p1: "The full CodeCombat curriculum covers major programming standards in several widely-adopted frameworks, including those of the International Society for Technology in Education (ISTE), the Computer Science Teacher Association (CSTA), and the K-12 Computer Science Framework."
# coverage_p2: "At CodeCombat, we believe that students will be most prepared for both real-world computing jobs and further study of computer science by using real, typed code in full programming languages, so instead of using block-based visual programming languages for beginners, we teach Python and JavaScript – the same languages used widely today by companies ranging from Google to the New York Times."
# questions: "Have questions or want more information? We'd be happy to help."
# reach_out_manager: "Reach out to your Account Manager __name__ at "
# stats_include: "stats include __number__ other __name__"
league:
student_register_1: "Menjadi Juara AI berikutnya!"
student_register_2: "Daftar, buat tim Anda sendiri, atau gabung dengan tim lain untuk mulai berkompetisi."
student_register_3: "Berikan informasi di bawah ini agar memenuhi syarat untuk mendapatkan hadiah."
teacher_register_1: "Daftar untuk mengakses halaman profil liga kelas Anda dan mulai kelas Anda."
general_news: "Dapatkan email tentang berita terbaru dan pembaruan tentang Liga AI dan turnamen kami."
team: "tim"
how_it_works1: "Gabung dengan __team__"
seasonal_arena_tooltip: "Bertarung melawan rekan satu tim dan orang lain saat Anda menggunakan keterampilan pemrograman terbaik untuk mendapatkan poin dan peringkat papan peringkat Liga AI sebelum menghadapi arena Kejuaraan di akhir musim."
summary: "CodeCombat AI League secara unik merupakan simulator pertarungan AI yang kompetitif dan mesin game untuk mempelajari kode Python dan JavaScript yang sebenarnya."
join_now: "Gabung Sekarang"
tagline: "CodeCombat AI League menggabungkan kurikulum yang disesuaikan dengan standar berbasis proyek kami, game coding berbasis petualangan yang menarik, dan turnamen global pengkodean AI tahunan kami ke dalam kompetisi akademik terorganisir yang tidak seperti yang lain."
ladder_subheader: "Gunakan keahlian coding dan strategi pertempuran Anda untuk naik peringkat!"
earn_codepoints: "Dapatkan PoinKode dengan menyelesaikan level"
codepoints: "PoinKode"
free_1: "Akses arena multipemain kompetitif, papan peringkat, dan kejuaraan pengkodean global"
free_2: "Dapatkan poin dengan menyelesaikan level latihan dan berkompetisi dalam pertandingan head-to-head"
free_3: "Bergabunglah dengan tim coding kompetitif dengan teman, keluarga, atau teman sekelas"
free_4: "Tunjukkan keahlian coding Anda dan bawa pulang hadiah menarik"
compete_season: "Uji semua keterampilan yang telah Anda pelajari! Bersainglah melawan siswa dan pemain dari seluruh dunia dalam puncak musim yang menarik ini."
season_subheading1: "Untuk arena Season dan Championship, setiap pemain memprogram tim “AI Heroes” mereka dengan kode yang ditulis dalam Python, JavaScript, C ++, Lua, atau CoffeeScript."
season_subheading2: "Kode mereka menginformasikan strategi yang akan dijalankan Pahlawan AI mereka dalam pertarungan head-to-head melawan pesaing lain."
team_derbezt: "Pelajari coding dan menangkan hadiah yang disponsori oleh aktor superstar Meksiko, komedian, dan pembuat film Eugenio Derbez."
invite_link: "Undang pemain ke tim ini dengan mengirimkan link ini:"
public_link: "Bagikan papan peringkat tim ini dengan tautan publiknya:"
end_to_end: "Tidak seperti platform esports lain yang melayani sekolah, kami memiliki struktur dari atas ke bawah, yang berarti kami tidak terikat dengan pengembang game mana pun atau memiliki masalah dengan perizinan. Itu juga berarti kami dapat membuat modifikasi khusus dalam game untuk sekolah Anda atau organisasi. "
path_success: "Platform game cocok dengan kurikulum Ilmu Komputer biasa, sehingga saat siswa bermain melalui level game, mereka menyelesaikan tugas kursus. Siswa belajar coding dan ilmu komputer sambil bermain, kemudian menggunakan keterampilan ini dalam pertempuran arena saat mereka berlatih dan bermain di platform yang sama. "
unlimited_potential: "Struktur turnamen kami dapat disesuaikan dengan lingkungan atau kasus penggunaan apa pun. Siswa dapat berpartisipasi pada waktu yang ditentukan selama pembelajaran reguler, bermain di rumah secara tidak sinkron, atau berpartisipasi sesuai jadwal mereka sendiri."
edit_team: "Edit Tim"
start_team: "Mulai Tim"
leave_team: "Keluar dari Tim"
join_team: "Gabung Tim"
# view_team: "View Team"
# join_team_name: "Join Team __name__"
features: "Fitur"
built_in: "Infrastruktur Kompetitif yang Terpasang"
built_in_subheader: "Platform kami menampung setiap elemen dari proses kompetitif, dari papan peringkat hingga platform game, aset, dan penghargaan turnamen."
custom_dev: "Pengembangan Kustom"
custom_dev_subheader: "Elemen kustomisasi untuk sekolah atau organisasi Anda telah disertakan, ditambah opsi seperti halaman arahan bermerek dan karakter dalam game."
comprehensive_curr: "Kurikulum Komprehensif"
comprehensive_curr_subheader: "CodeCombat adalah solusi Ilmu Komputer yang selaras dengan standar yang membantu pengajar mengajarkan pengkodean nyata dalam JavaScript dan Python, apa pun pengalaman mereka."
roster_management: "Alat Manajemen Daftar"
roster_management_subheader: "Lacak kinerja siswa dalam kurikulum dan dalam game, dan tambahkan atau hapus siswa dengan mudah."
share_flyer: "Bagikan selebaran Liga AI kami dengan pendidik, administrator, orang tua, pelatih esports, atau orang lain yang mungkin tertarik."
download_flyer: "Unduh Flyer"
championship_summary: "Arena kejuaraan __championshipArena__ sekarang dibuka! Bertarunglah di bulan __championshipMonth__ untuk memenangkan hadiah di __championshipArena__ __championshipType__."
play_arena_full: "Mainkan __arenaName__ __arenaType__"
play_arena_short: "Mainkan __arenaName__"
# view_arena_winners: "View __arenaName__ __arenaType__ winners"
arena_type_championship: "Arena Kejuaraan"
arena_type_regular: "Arena Multiplayer (Banyak Pemain)"
blazing_battle: "Pertempuran Berkobar"
infinite_inferno: "Api Tak Berujung"
mages_might: "Penyihir Perkasa"
sorcerers: "Penyihir"
giants_gate: "Gerbang Raksasa"
colossus: "Colossus"
# iron_and_ice: "Iron and Ice"
# tundra_tower: "Tundra Tower"
# magma_mountain: "Magma Mountain"
# lava_lake: "Lava Lake"
# desert_duel: "Desert Duel"
# sandstorm: "Sandstorm"
cup: "Piala"
blitz: "Menggempur"
clash: "Bentrokan"
# season3_announcement_1: "Time to put your coding skills to the test in our season 3 final arena. The Colossus Clash is live and offers a new challenge and a new leaderboard to climb."
# season3_announcement_2: "Need more practice? Stick with the Giant's Gate Arena to refine your skills. You have until December 14th to play both arenas. Note: arena balance adjustments may occur until December 6th."
# season3_announcement_3: "Great prizes available for top performers in the Colossus Clash:"
# season2_announcement_1: "Time to put your coding skills to the test in our season 2 final arena. The Sorcerers Blitz is live and offers a new challenge and a new leaderboard to climb."
# season2_announcement_2: "Need more practice? Stick with the Mage's Might Arena to refine your skills. You have until August 31st to play both arenas. Note: arena balance adjustments may occur until August 23rd."
# season2_announcement_3: "Great prizes available for top performers in the Sorcerers Blitz:"
season1_prize_1: "Beasiswa $1,000"
season1_prize_2: "RESPAWN Kursi Permainan" # {change}
season1_prize_3: "Avatar CodeCombat Khusus"
season1_prize_4: "Dan banyak lagi!"
# season1_prize_hyperx: "HyperX Premium Peripherals"
# codecombat_ai_league: "CodeCombat AI League"
# register: "Register"
# not_registered: "Not Registered"
# register_for_ai_league: "Register for AI League"
# world: "World"
# quickstart_video: "Quickstart Video"
# arena_rankings: "Arena Rankings"
# arena_rankings_blurb: "Global AI League arena rankings"
# arena_rankings_title: "Global leaderboard rank for all players in this team across AI League arenas in the open age bracket."
# competing: "Competing:" # Competing: 3 students
# count_student: "student" # 1 student
# count_students: "students" # 2 students
# top_student: "Top:" # Top: Jane D
# top_percent: "top" # - top 3%)
# top_of: "of" # (#8 of 35). Perhaps just use "/" if this doesn't translate naturally.
# arena_victories: "Arena Victories"
# arena_victories_blurb: "Global AI League arena recent wins"
# arena_victories_title: "Win count is based on the last 1000 matches played asynchronously by each player in each of their AI League arenas."
# count_wins: "wins" # 100+ wins or 974 wins
# codepoints_blurb: "1 CodePoint = 1 line of code written"
# codepoints_title: "One CodePoint is earned for every non-whitespace line of code needed to beat the level. Each level is worth the same amount of CodePoints according to its standard solution, regardless of whether the student wrote more or fewer lines of code."
# count_total: "Total:" # Total: 300 CodePoints, or Total: 300 wins
# join_teams_header: "Join Teams & Get Cool Stuff!"
# join_team_hyperx_title: "Join Team HyperX, Get 10% Off"
# join_team_hyperx_blurb: "30 team members will be chosen at random for a free gaming mousepad!"
# join_team_derbezt_title: "Join Team DerBezt, Get Exclusive Hero"
# join_team_derbezt_blurb: "Unlock the Armando Hoyos hero from Mexican superstar Eugenio Derbez!"
# join_team_ned_title: "Join Team Ned, Unlock Ned's Hero"
# join_team_ned_blurb: "Get the exclusive spatula-wielding hero from YouTube star, Try Guy Ned Fulmer!"
tournament:
mini_tournaments: "Turname Mini"
usable_ladders: "Semua Tangga yang Dapat Digunakan"
make_tournament: "Buat turnamen mini"
go_tournaments: "Pergi ke turnamen mini"
class_tournaments: "Kelas turnamen mini"
no_tournaments_owner: "Tidak ada turnamen sekarang, buatlah turnamen"
no_tournaments: "Tidak ada turnamen sekarang"
edit_tournament: "Edit Turnamen"
create_tournament: "Buat Turnamen"
# upcoming: "Upcoming"
# starting: "Starting"
# ended: "Ended"
# view_results: "View Results"
# estimate_days: "In __time__ Days"
# payments:
# student_licenses: "Student Licenses"
# computer_science: "Computer Science"
# web_development: "Web Development"
# game_development: "Game Development"
# per_student: "Per Student"
# just: "Just"
# teachers_upto: "Teacher can purchase upto"
# great_courses: "Great Courses included for"
# studentLicense_successful: "Congratulations! Your licenses will be ready to use in a min. Click on the Getting Started Guide in the Resource Hub to learn how to apply them to your students."
# onlineClasses_successful: "Congratulations! Your payment was successful. Our team will reach out to you with the next steps."
# homeSubscriptions_successful: "Congratulations! Your payment was successful. Your premium access will be available in few minutes."
# failed: "Your payment failed, please try again"
# session_week_1: "1 session/week"
# session_week_2: "2 sessions/week"
# month_1: "Monthly"
# month_3: "Quarterly"
# month_6: "Half-yearly"
# year_1: "Yearly"
# most_popular: "Most Popular"
# best_value: "Best Value"
# purchase_licenses: "Purchase Licenses easily to get full access to CodeCombat and Ozaria"
# homeschooling: "Homeschooling Licenses"
# recurring_month_1: "Recurring billing every month"
# recurring_month_3: "Recurring billing every 3 months"
# recurring_month_6: "Recurring billing every 6 months"
# recurring_year_1: "Recurring billing every year"
# form_validation_errors:
# required: "Field is required"
# invalidEmail: "Invalid email"
# invalidPhone: "Invalid phone number"
# emailExists: "Email already exists"
# numberGreaterThanZero: "Should be a number greater than 0"
# teacher_dashboard:
# read: "View Only"
# write: "Full Access"
# read_blurb: "View Only permits the added teacher to view your class and student progress without the ability to make changes to your class."
# write_blurb: "Full Access grants the added teacher the ability to make modifications to your class (add/remove students, assign chapters, modify licensure)"
# shared_with_none: "This class is not currently shared with any other teachers."
# share_info: "To give other teachers access to the class, add their emails below."
# class_owner: "Class Owner"
# share: "Share"
| 170863 | module.exports = nativeDescription: "Bahasa Indonesia", englishDescription: "Indonesian", translation:
new_home:
title: "CodeCombat - Coding game untuk belajar Python dan JavaScript"
meta_keywords: "CodeCombat, python, javascript, Coding Games"
meta_description: "Pelajari kode yang diketik melalui permainan pemrograman. Pelajari Python, JavaScript, dan HTML sambil Anda memecahkan teka-teki dan belajar membuat game dan situs web pengkodean Anda sendiri."
meta_og_url: "https://codecombat.com"
become_investor: "menjadi investor di CodeCombat"
built_for_teachers_title: "Sebuah Game Coding yang Dibuat dengan Guru sebagai Pemeran Utama"
built_for_teachers_blurb: "Mengajari anak-anak membuat kode sering kali terasa berat. CodeCombat membantu semua pengajar mengajari siswa cara membuat kode dalam JavaScript atau Python, dua bahasa pemrograman paling populer. Dengan kurikulum komprehensif yang mencakup enam unit ilmu komputer dan memperkuat pembelajaran melalui pengembangan game berbasis proyek dan unit pengembangan web, anak-anak akan maju dalam perjalanan dari sintaks dasar ke rekursi! "
built_for_teachers_subtitle1: "Ilmu Komputer"
built_for_teachers_subblurb1: "Dimulai dengan kursus Pengantar Ilmu Komputer gratis kami, siswa menguasai konsep pengkodean inti seperti while / for loop, fungsi, dan algoritma."
built_for_teachers_subtitle2: "Pengembangan Game"
built_for_teachers_subblurb2: "Peserta didik membangun labirin dan menggunakan penanganan masukan (input handling) dasar untuk membuat kode permainan mereka sendiri yang dapat dibagikan dengan teman dan keluarga."
built_for_teachers_subtitle3: "Pengembangan Web"
built_for_teachers_subblurb3: "Dengan menggunakan HTML, CSS, dan jQuery, pelajar melatih otot kreatif mereka untuk memprogram laman web mereka sendiri dengan URL khusus untuk dibagikan dengan teman sekelas mereka."
century_skills_title: "Keterampilan Abad 21"
century_skills_blurb1: "Siswa Tidak Hanya Meningkatkan Level Pahlawan Mereka, Mereka Sendiri Meningkatkan Level Keterampilan Coding"
century_skills_quote1: "Kamu merasa gagal ... karena itu kamu harus memikirkan tentang semua cara yang mungkin untuk memperbaikinya, lalu coba lagi. Aku tidak akan bisa sampai di sini tanpa berusaha keras."
century_skills_subtitle1: "Berpikir Kritis"
century_skills_subblurb1: "Dengan teka-teki pengkodean yang secara alami disusun menjadi level yang semakin menantang, game pemrograman CodeCombat memastikan anak-anak selalu mempraktikkan pemikiran kritis."
century_skills_quote2: "Semua orang membuat labirin, jadi saya pikir, 'tangkap bendera' dan itulah yang saya lakukan."
century_skills_subtitle2: "Kreativitas"
century_skills_subblurb2: "CodeCombat mendorong siswa untuk menunjukkan kreativitas mereka dengan membuat dan berbagi game dan halaman web mereka sendiri."
century_skills_quote3: "Jika saya terjebak pada suatu level. Saya akan bekerja dengan orang-orang di sekitar saya sampai kita semua dapat melaluinya."
century_skills_subtitle3: "Kolaborasi"
century_skills_subblurb3: "Sepanjang permainan, ada peluang bagi siswa untuk berkolaborasi saat mereka mengalami kebuntuan dan untuk bekerja sama menggunakan panduan pemrograman berpasangan."
century_skills_quote4: "Saya selalu memiliki aspirasi untuk mendesain video game dan mempelajari cara membuat kode ... ini memberi saya titik awal yang bagus."
# century_skills_quote4_author: "<NAME>, <NAME>"
century_skills_subtitle4: "Komunikasi"
century_skills_subblurb4: "Coding mengharuskan anak-anak untuk mempraktikkan bentuk komunikasi baru, termasuk berkomunikasi dengan komputer itu sendiri dan menyampaikan ide-ide mereka menggunakan kode yang paling efisien."
classroom_in_box_title: "Kami Berusaha Untuk:"
classroom_in_box_blurb1: "Libatkan setiap siswa sehingga mereka yakin bahwa kemampuan coding bermanfaat untuk mereka."
classroom_in_box_blurb2: "Berdayakan semua pendidik untuk merasa percaya diri saat mengajar coding."
classroom_in_box_blurb3: "Menginspirasi semua pimpinan sekolah untuk membuat program ilmu komputer kelas dunia."
classroom_in_box_blurb4: ""
click_here: "Klik di sini"
creativity_rigor_title: "Di Mana Kreativitas Bertemu dengan Ketelitian"
creativity_rigor_subtitle1: "Jadikan coding menyenangkan dan ajarkan keterampilan dunia nyata"
creativity_rigor_blurb1: "Siswa mengetik Python dan JavaScript nyata sambil bermain game yang mendorong coba-dan-gagal (trial-and-error), berpikir kritis, dan kreativitas. Siswa kemudian menerapkan keterampilan pengkodean yang telah mereka pelajari dengan mengembangkan game dan situs web mereka sendiri dalam kursus berbasis proyek. "
creativity_rigor_subtitle2: "Jangkau siswa di level mereka"
creativity_rigor_blurb2: "Setiap level CodeCombat dirancang berdasarkan jutaan poin data dan dioptimalkan untuk beradaptasi dengan setiap pelajar. Level dan petunjuk latihan membantu siswa saat mereka mengalami kebuntuan, dan level tantangan menilai pembelajaran siswa selama game."
creativity_rigor_subtitle3: "Dibuat untuk semua guru, apa pun pengalamannya"
creativity_rigor_blurb3: "Kurikulum CodeCombat yang serba cepat dan selaras dengan standar memungkinkan pengajaran ilmu komputer untuk semua orang. CodeCombat membekali guru dengan pelatihan, sumber daya instruksional, dan dukungan khusus untuk merasa percaya diri dan sukses di kelas."
featured_partners_title1: "Ditampilkan Dalam"
featured_partners_title2: "Penghargaan & Mitra"
featured_partners_blurb1: "Mitra P<NAME>"
featured_partners_blurb2: "Alat Kreativitas Terbaik untuk Siswa"
featured_partners_blurb3: "Pilihan Terbaik untuk Belajar"
featured_partners_blurb4: "Mitra Resmi Code.org"
featured_partners_blurb5: "Anggota Resmi CSforAll"
featured_partners_blurb6: "Mitra Aktifitas Hour of Code"
for_leaders_title: "Untuk Pimpinan Sekolah"
for_leaders_blurb: "Program Ilmu Komputer yang Selaras dengan Standar"
for_leaders_subtitle1: "Penerapan yang Mudah"
for_leaders_subblurb1: "Program berbasis web yang tidak memerlukan dukungan TI. Mulailah dalam waktu kurang dari 5 menit menggunakan Google atau Clever Single Sign-On (SSO)."
for_leaders_subtitle2: "Kurikulum Coding Lengkap"
for_leaders_subblurb2: "Kurikulum yang selaras dengan standar dengan sumber daya instruksional dan pengembangan profesional untuk memungkinkan semua guru mengajarkan ilmu komputer."
for_leaders_subtitle3: "Kasus Penggunaan Fleksibel"
for_leaders_subblurb3: "Apakah Anda ingin membangun mata pelajaran pengkodean Sekolah Menengah, jalur CTE, atau mengajar kelas Pengantar Ilmu Komputer, CodeCombat disesuaikan dengan kebutuhan Anda."
for_leaders_subtitle4: "Keterampilan Dunia Nyata"
for_leaders_subblurb4: "Siswa membangun daya tahan dan mengembangkan pola pikir yang berkembang melalui tantangan pengkodean yang mempersiapkan mereka untuk 500K+ pekerjaan komputasi terbuka."
for_teachers_title: "Untuk Guru"
for_teachers_blurb: "Alat untuk Membuka Potensi Siswa"
for_teachers_subtitle1: "Pembelajaran Berbasis Proyek"
for_teachers_subblurb1: "Promosikan kreativitas, pemecahan masalah, dan kepercayaan diri dalam kursus berbasis proyek tempat siswa mengembangkan game dan halaman web mereka sendiri."
for_teachers_subtitle2: "Dasbor Guru"
for_teachers_subblurb2: "Melihat data tentang kemajuan siswa, menemukan sumber daya kurikulum, dan mengakses dukungan waktu nyata untuk memberdayakan pembelajaran siswa."
for_teachers_subtitle3: "Penilaian Bawaan"
for_teachers_subblurb3: "Personalisasi instruksi dan pastikan siswa memahami konsep inti dengan penilaian formatif dan sumatif."
for_teachers_subtitle4: "Diferensiasi Otomatis"
for_teachers_subblurb4: "Libatkan semua pelajar di kelas yang berbeda dengan tingkat latihan yang menyesuaikan dengan kebutuhan belajar setiap siswa."
game_based_blurb: "CodeCombat adalah program ilmu komputer berbasis game tempat siswa mengetik kode nyata dan melihat karakter mereka bereaksi dalam waktu nyata."
get_started: "Memulai"
global_title: "Bergabunglah dengan Komunitas Global untuk Pelajar dan Pendidik"
global_subtitle1: "Peserta"
global_subtitle2: "Garis Kode"
global_subtitle3: "Guru"
global_subtitle4: "Negara"
go_to_my_classes: "Masuk ke kelas saya"
go_to_my_courses: "Masuk ke kursus saya"
quotes_quote1: "Sebutkan program apa pun secara online, saya sudah mencobanya. Tidak ada yang cocok dengan CodeCombat. Setiap guru yang ingin siswanya belajar cara membuat kode ... mulai dari sini!" # {change}
quotes_quote2: "Saya terkejut tentang betapa mudah dan intuitifnya CodeCombat dalam mempelajari ilmu komputer. Nilai ujian AP jauh lebih tinggi dari yang saya harapkan dan saya yakin CodeCombat adalah alasan mengapa hal ini terjadi."
quotes_quote3: "CodeCombat telah menjadi hal yang paling bermanfaat untuk mengajar siswa saya kemampuan pengkodean kehidupan nyata. Suami saya adalah seorang insinyur perangkat lunak dan dia telah menguji semua program saya. Dia menempatkan ini sebagai pilihan utamanya."
quotes_quote4: "Umpan baliknya… sangat positif sehingga kami menyusun kelas ilmu komputer di sekitar CodeCombat. Program ini benar-benar melibatkan siswa dengan platform gaya permainan yang menghibur dan instruksional pada saat yang sama. Pertahankan kerja bagus, CodeCombat ! "
# quotes_quote5: "Even though the class starts every Saturday at 7am, my son is so excited that he wakes up before me! CodeCombat creates a pathway for my son to advance his coding skills."
# quotes_quote5_author: "<NAME>, Parent"
see_example: "Lihat contoh"
slogan: "Game untuk belajar pemrograman paling menyenangkan."
# slogan_power_of_play: "Learn to Code Through the Power of Play"
teach_cs1_free: "Ajarkan CS1 Gratis"
teachers_love_codecombat_title: "Guru Suka CodeCombat"
teachers_love_codecombat_blurb1: "Laporkan bahwa siswanya senang menggunakan CodeCombat untuk mempelajari cara membuat kode"
teachers_love_codecombat_blurb2: "Akan merekomendasikan CodeCombat kepada guru ilmu komputer lainnya"
teachers_love_codecombat_blurb3: "Katakan bahwa CodeCombat membantu mereka mendukung kemampuan pemecahan masalah siswa"
teachers_love_codecombat_subblurb: "Bekerja sama dengan McREL International, pemimpin dalam panduan berbasis penelitian dan evaluasi teknologi pendidikan."
top_banner_blurb: "Para orang tua, berikan anak Anda hadiah coding dan pengajaran yang dipersonalisasi dengan pengajar langsung kami!"
# top_banner_summer_camp: "Enrollment now open for our summer coding camps–ask us about our week-long virtual sessions starting at just $199."
# top_banner_blurb_funding: "New: CARES Act funding resources guide to ESSER and GEER funds for your CS programs."
try_the_game: "Coba permainan"
classroom_edition: "Edisi Ruang Kelas:"
learn_to_code: "Belajar membuat kode:"
play_now: "Mainkan Sekarang"
im_a_parent: "Saya Orang Tua"
im_an_educator: "Saya seorang Pendidik"
im_a_teacher: "Aku seorang guru"
im_a_student: "Aku seorang siswa"
learn_more: "Pelajari lebih lanjut"
classroom_in_a_box: "Sebuah ruangan kelas di-dalam-kotak untuk belajar ilmu komputer."
codecombat_is: "CodeCombat adalah sebuah wadah <strong>untuk para siswa<strong> untuk belajar ilmu komputer sambil bermain permainan yang sesungguhnya."
our_courses: "Kursus kami telah diuji oleh para pemain secara khusus untuk <strong>menjadi lebih baik di ruang kelas</strong>, bahkan oleh para guru yang mempunyai sedikit atau tanpa pengalaman pemrograman sebelumnya."
watch_how: "Saksikan CodeCombat mentransformasi cara orang-orang belajar ilmu komputer."
top_screenshots_hint: "Para siswa menulis kode dan melihat mereka mengganti secara langsung"
designed_with: "Dirancang untuk para guru"
real_code: "Kode asli yang diketik"
from_the_first_level: "dari tingkat pertama"
getting_students: "Mengajak siswa untuk mengetik kode secepat mungkin sangatlah penting untuk mempelajari sintaks pemrograman dan struktur yang tepat."
educator_resources: "Sumber pendidik"
course_guides: "dan panduan rangkaian pelajaran"
teaching_computer_science: "Mengajari ilmu komputer tidak memerlukan gelar yang mahal, karena kami menyediakan peralatan untuk menunjang pendidik dari segala macam latar belakang."
accessible_to: "Dapat diakses oleh"
everyone: "semua orang"
democratizing: "Mendemokrasikan proses belajar membuat kode adalah inti dari filosofi kami. Semua orang yang mampu untuk belajar membuat kode."
forgot_learning: "Saya pikir mereka benar-benar lupa bahwa mereka sebenarnya belajar tentang sesuatu."
wanted_to_do: "Belajar membuat kode adalah sesuatu yang selalu saya ingin lakukan, dan saya tidak pernah berpikir saya akan bisa mempelajarinya di sekolah."
builds_concepts_up: "Saya suka bagaimana CodeCombat membangun konsep. Sangat mudah dipahami dan menyenangkan."
why_games: "Mengapa belajar melalui bermain sangatlah penting?"
games_reward: "Permainan memberikan imbalan terhadap perjuangan yang produktif."
encourage: "Gaming adalah perantara yang mendorong interaksi, penemuan, dan mencoba-coba. Sebuah permainan yang baik menantang pemain untuk menguasai keterampilan dari waktu ke waktu, yang merupakan proses penting sama yang dilalui siswa saat mereka belajar."
excel: "Permainan unggul dalam memberikan prestasi"
struggle: "Perjuangan yang produktif"
kind_of_struggle: "jenis perjuangan yang menghasilkan pembelajaran yang menarik dan"
motivating: "memotivasi"
not_tedious: "tidak membosankan."
gaming_is_good: "Studi menunjukkan permainan itu baik untuk otak anak-anak. (itu benar!)"
game_based: "Ketika sistem pembelajaran berbasis permainan"
compared: "dibandingkan"
conventional: "terhadap metode pengajaran konvensional, perbedaannya jelas: permainan merupakan pilihan yang lebih baik untuk membantu siswa mempertahankan pengetahuan, berkonsentrasi dan"
perform_at_higher_level: "tampil di tingkat yang lebih tinggi dari prestasi"
feedback: "Permainan juga memberikan umpan balik langsung yang memungkinkan siswa untuk menyesuaikan solusi cara mereka dan memahami konsep-konsep yang lebih holistik, daripada hanya terbatas dengan jawaban “benar” atau “salah” saja."
real_game: "Sebuah permainan yang sebenarnya, dimainkan dengan pengkodean yang nyata."
great_game: "Sebuah permainan yang hebat merupakan lebih dari sekedar lencana dan prestasi - melainkan tentang perjalanan pemain, teka-teki yang dirancang dengan baik, dan kemampuan untuk mengatasi tantangan dengan kepercayaan diri."
agency: "CodeCombat adalah permainan yang memberikan pemain kepercayaan diri dengan mesin ketik kode kami yang kuat, yang membantu pemula dan lanjutan mahasiswa menulis kode yang valid, dan tepat."
request_demo_title: "Ajak siswa-siswamu mulai sekarang!"
request_demo_subtitle: "Meminta demonstrasi dan ajak siswa-siswamu memulai kurang dari satu jam."
get_started_title: "Atur kelas kamu sekarang"
get_started_subtitle: "Atur kelas, tambahkan siswa-siswamu dan pantau perkembangan mereka selama mereka belajar ilmu komputer."
request_demo: "Minta demonstrasi"
request_quote: "Minta Penawaran"
setup_a_class: "Atur Kelas"
have_an_account: "Sudah mempunyai akun?"
logged_in_as: "Kamu saat ini masuk sebagai"
computer_science: "Kursus cepat kami mencakup sintaks dasar sampai konsep lanjutan"
ffa: "Gratis untuk semua siswa"
coming_soon: "Segera hadir!"
courses_available_in: "Kursus tersedia dalam JavaScript dan Python. Kursus Pengembangan Web menggunakan HTML, CSS, dan jQuery"
boast: "Teka-teki yang cukup kompleks untuk memikat pemain dan pengkode."
winning: "Kombinasi yang unggul dari permainan RPG dan pemrograman pekerjaan rumah yang berhasil membuat pendidikan ramah anak yang pasti menyenangkan."
run_class: "Semua yang Anda butuhkan untuk menjalankan kelas ilmu komputer di sekolah Anda hari ini, latar belakang IT tidak diperlukan."
goto_classes: "Pergi ke Kelasku"
view_profile: "Lihat Profilku"
view_progress: "Lihat Kemajuan"
go_to_courses: "Pergi ke Kursusku"
want_coco: "Mau CodeCombat ada di sekolahmu?"
educator: "<NAME>"
student: "<NAME>"
our_coding_programs: "Program Coding Kami"
codecombat: "CodeCombat"
ozaria: "Ozaria"
codecombat_blurb: "Game coding asli kami. Direkomendasikan untuk orang tua, individu, pendidik, dan siswa yang ingin merasakan salah satu game coding yang paling disukai di dunia."
ozaria_blurb: "Sebuah game petualangan dan program Ilmu Komputer tempat siswa menguasai keajaiban coding yang hilang untuk menyelamatkan dunia mereka. Direkomendasikan untuk pengajar dan siswa."
try_codecombat: "Coba CodeCombat"
try_ozaria: "Coba Ozaria"
# explore_codecombat: "Explore CodeCombat"
# explore_ai_league: "Explore AI League"
# explore_ozaria: "Explore Ozaria"
# explore_online_classes: "Explore Online Classes"
# explore_pd: "Explore Professional Development"
# new_adventure_game_blurb: "Ozaria is our brand new adventure game and your turnkey solution for teaching Computer science. Our student-facing __slides__ and teacher-facing notes make planning and delivering lessons easier and faster."
# lesson_slides: "lesson slides"
# pd_blurb: "Learn the skills to effectively teach computer science with our self-directed, CSTA-accredited professional development course. Earn up to 40 credit hours any time, from any device. Pairs well with Ozaria Classroom."
# ai_league_blurb: "Competitive coding has never been so epic with this educational esports league, uniquely both an AI battle simulator and game engine for learning real code."
# codecombat_live_online_classes: "CodeCombat Live Online Classes"
# learning_technology_blurb: "Our original game teaches real-world skills through the power of play. The scaffolded curriculum systematically builds on student’s experiences and knowledge as they progress."
# learning_technology_blurb_short: "Our innovative game-based learning technology has transformed the way students learn to code."
# online_classes_blurb: "Our online coding classes combine the power of gameplay and personalized instruction for an experience your child will love. With both private or group options available, this is remote learning that works."
# for_educators: "For Educators"
# for_parents: "For Parents"
# for_everyone: "For Everyone"
# what_our_customers_are_saying: "What Our Customers Are Saying"
# game_based_learning: "Game-Based Learning"
# unique_approach_blurb: "With our unique approach, students embrace learning as they play and write code from the very start of their adventure, promoting active learning and a growth mindset."
# text_based_coding: "Text-Based Coding"
# custom_code_engine_blurb: "Our custom code engine and interpreter is designed for beginners, teaching true Python, JavaScript, and C++ programming languages using human, beginner-friendly terms."
# student_impact: "Student Impact"
# help_enjoy_learning_blurb: "Our products have helped over 20 million students enjoy learning Computer Science, teaching them to be critical, confident, and creative learners. We engage all students, regardless of experience, helping them to realize a pathway to success in Computer Science."
# global_community: "Join Our Global Community"
# million: "__num__ Million"
# billion: "__num__ Billion"
nav:
educators: "<NAME>"
follow_us: "<NAME>"
general: "Utama"
map: "Peta"
play: "Tingkatan" # The top nav bar entry where players choose which levels to play
community: "Komunitas"
courses: "Kursus"
blog: "Blog"
forum: "Forum"
account: "<NAME>"
my_account: "<NAME>"
profile: "Profil"
home: "Beranda"
contribute: "Kontribusi"
legal: "Hukum"
privacy: "Pemberitahuan Privasi"
about: "Tentang"
impact: "Pengaruh"
contact: "Kont<NAME>"
twitter_follow: "Ikuti"
my_classrooms: "Kelasku"
my_courses: "Kursusku"
my_teachers: "Guruku"
careers: "Kar<NAME>"
facebook: "Facebook"
twitter: "Twitter"
create_a_class: "Buat sebuah kelas"
other: "Lain-lain"
learn_to_code: "Belajar membuat kode!"
toggle_nav: "Aktifkan navigasi"
schools: "Sekolah"
get_involved: "Ambil Andil"
open_source: "Open source (GitHub)"
support: "Bantuan"
faqs: "Tanya Jawab"
copyright_prefix: "Hak Cipta"
copyright_suffix: "Seluruh Hak Cipta"
help_pref: "Butuh bantuan? Email"
help_suff: "dan kita akan menghubungi!"
resource_hub: "Pusat Sumber Daya"
apcsp: "Fundamental AP CS"
parent: "Orang Tua"
esports: "Esports"
browser_recommendation: "Untuk pengalaman yang lebih baik, kami merekomendasikan menggunakan browser chrome terbaru. Download browser disini"
# ozaria_classroom: "Ozaria Classroom"
# codecombat_classroom: "CodeCombat Classroom"
# ozaria_dashboard: "Ozaria Dashboard"
# codecombat_dashboard: "CodeCombat Dashboard"
# professional_development: "Professional Development"
# new: "New!"
# admin: "Admin"
# api_dashboard: "API Dashboard"
# funding_resources_guide: "Funding Resources Guide"
modal:
close: "Tutup"
okay: "Baik"
cancel: "Batal"
not_found:
page_not_found: "Laman tidak ditemukan"
diplomat_suggestion:
title: "Bantu menerjemahkan CodeCombat!" # This shows up when a player switches to a non-English language using the language selector.
sub_heading: "Kami membutuhkan kemampuan berbahasamu."
pitch_body: "Kami mengembangkan CodeCombat dalam bahasa Inggris, tapi kami sudah memiliki pemain di seluruh dunia. Banyak dari mereka ingin bermain di Indonesia, tetapi tidak berbicara bahasa Inggris, jadi jika Anda dapat menguasai kedua bahasa tersebut, silakan mempertimbangkan untuk mendaftar untuk menjadi Diplomat dan membantu menerjemahkan kedua situs CodeCombat dan semua tingkatan ke Bahasa Indonesia."
missing_translations: "Hingga kami bisa menerjemahkan semuanya ke dalam bahasa Indonesia, Anda akan melihat bahasa Inggris ketika bahasa Indonesia belum tersedia."
learn_more: "Pelajari lebih lanjut tentang menjadi seorang Diplomat"
subscribe_as_diplomat: "Berlangganan sebagai seorang Diplomat"
# new_home_faq:
# what_programming_languages: "What programming languages are available?"
# python_and_javascript: "We currently support Python and JavaScript."
# why_python: "Why should you choose Python?"
# why_python_blurb: "Python is both beginner-friendly and currently used by major corporations (such as Google). If you have younger or first-time learners, we strongly recommend Python."
# why_javascript: "Why should you choose JavaScript?"
# why_javascript_blurb: "JavaScript is the language of the web and is used across nearly every website. You may prefer to choose JavaScript if you are planning to also study web development. We’ve also made it easy for students to transition from Python to JavaScript-based web development."
# javascript_versus_python: "JavaScript’s syntax is a little more difficult for beginners than Python, so if you cannot decide between the two, we recommend Python."
# how_do_i_get_started: "How do I get started?"
# getting_started_1: "Create your Teacher Account"
# getting_started_2: "Create a class"
# getting_started_3: "Add students"
# getting_started_4: "Sit back and watch your students have fun learning to code"
# main_curriculum: "Can I use CodeCombat or Ozaria as my main curriculum?"
# main_curriculum_blurb: "Absolutely! We’ve spent time consulting with education specialists to craft classroom curriculum and materials specifically for teachers who are using CodeCombat or Ozaria without any prior computer science experience themselves. Many schools are implementing CodeCombat and/or Ozaria as the main computer science curriculum."
# clever_instant_login: "Does CodeCombat and Ozaria support Clever Instant Login?"
# clever_instant_login_blurb: "Yes! Check out our __clever__ for more details on how to get started."
# clever_integration_faq: "Clever Integration FAQ"
# google_classroom: "What about Google Classroom?"
# google_classroom_blurb1: "Yup! Be sure to use the Google Single Sign-On (SSO) Modal to sign up for your teacher account. If you already have an account using your Google email, use the Google SSO modal to log in next time. In the Create Class modal, you will see an option to Link Google Classroom. We only support rostering via Google Classroom at this time."
# google_classroom_blurb2: "Note: you must use Google SSO to sign up or log in at least once in order to see the Google Classroom integration option."
# how_much_does_it_cost: "How much does it cost to access all of the available courses and resources?"
# how_much_does_it_cost_blurb: "We customize solutions for schools and districts and work with you to understand your use case, context, and budget. __contact__ for further details! See also our __funding__ for how to leverage CARES Act funding sources like ESSER and GEER."
# recommended_systems: "Is there a recommended browser and operating system?"
# recommended_systems_blurb: "CodeCombat and Ozaria run best on computers with at least 4GB of RAM, on a modern browser such as Chrome, Safari, Firefox, or Edge. Chromebooks with 2GB of RAM may have minor graphics issues in later courses. A minimum of 200 Kbps bandwidth per student is required, although 1+ Mbps is recommended."
# other_questions: "If you have any other questions, please __contact__."
play:
title: "Mainkan Level CodeCombat - Pelajari Python, JavaScript, dan HTML"
meta_description: "Pelajari pemrograman dengan permainan pengkodean untuk pemula. Pelajari Python atau JavaScript saat Anda memecahkan labirin, membuat game Anda sendiri, dan naik level. Tantang teman Anda di level arena multipemain!"
level_title: "__level__ - Belajar Membuat Kode dengan Python, JavaScript, HTML"
video_title: "__video__ | Tingkat Video"
game_development_title: "__level__ | Pengembangan Game"
web_development_title: "__level__ | Pengembangan Web"
anon_signup_title_1: "CodeCombat memiliki"
anon_signup_title_2: "Versi Ruang Kelas!"
anon_signup_enter_code: "Masukkan Kode Kelas:"
anon_signup_ask_teacher: "Belum punya? Tanya guru Anda!"
anon_signup_create_class: "Ingin membuat kelas?"
anon_signup_setup_class: "Siapkan kelas, tambahkan siswa Anda, dan pantau kemajuan!"
anon_signup_create_teacher: "Buat akun guru gratis"
play_as: "Main sebagai" # Ladder page
get_course_for_class: "Berikan Pengembangan Game dan lainnya ke kelasmu!"
request_licenses: "Hubungi spesialis sekolah kami untuk rinciannya"
compete: "Bertanding!" # Course details page
spectate: "Tonton" # Ladder page
simulate_all: "Simulasikan Semua"
players: "pemain" # Hover over a level on /play
hours_played: "jam bermain" # Hover over a level on /play
items: "Barang" # Tooltip on item shop button from /play
unlock: "Buka" # For purchasing items and heroes
confirm: "Konfirmasi"
owned: "Dipunyai" # For items you own
locked: "Terkunci"
available: "Tersedia"
skills_granted: "Kemampuan Diberikan" # Property documentation details
heroes: "Jagoan" # Tooltip on hero shop button from /play
achievements: "Prestasi" # Tooltip on achievement list button from /play
settings: "Pengaturan" # Tooltip on settings button from /play
poll: "Poll" # Tooltip on poll button from /play
next: "Lanjut" # Go from choose hero to choose inventory before playing a level
change_hero: "Ganti Jagoan" # Go back from choose inventory to choose hero
change_hero_or_language: "Ganti Jagoan atau Bahasa"
buy_gems: "Beli Permata"
subscribers_only: "Hanya untuk yang pelanggan!"
subscribe_unlock: "Berlangganan untuk membuka!"
subscriber_heroes: "Berlangganan sekarang untuk segera membuka Amara, Hushbaum, and Hattori!"
subscriber_gems: "Berlangganan sekarang untuk membeli jagoan ini dengan permata!"
anonymous: "Pemain tak bernama"
level_difficulty: "Kesulitan: "
awaiting_levels_adventurer_prefix: "Kami meliris level baru setiap minggunya"
awaiting_levels_adventurer: "Daftar sebagai seorang Petualang"
awaiting_levels_adventurer_suffix: "Untuk menjadi yang pertama memainkan level baru."
adjust_volume: "Atur suara"
campaign_multiplayer: "Arena Multipemain"
campaign_multiplayer_description: "... dimana kamu membuat kode satu lawan satu melawan pemain lainnya."
brain_pop_done: "Kamu telah mengalahkan Raksasa dengan kode! Kamu menang!"
brain_pop_challenge: "Tantang dirimu untuk bermain lagi menggunakan bahasa pemrograman yang berbeda!"
replay: "Ulang"
back_to_classroom: "Kembali ke Kelas"
teacher_button: "Untuk Guru"
get_more_codecombat: "Dapatkan Lebih Lagi CodeCombat"
code:
if: "jika" # Keywords--these translations show up on hover, so please translate them all, even if it's kind of long. (In the code editor, they will still be in English.)
else: "lainnya"
elif: "jika lainnya"
while: "selama"
loop: "ulangi"
for: "untuk"
break: "berhenti"
continue: "lanjutkan"
pass: "<PASSWORD>"
return: "kembali"
then: "kemudian"
do: "lakukan"
end: "selesai"
function: "fungsi"
def: "definisi"
var: "variabel"
self: "diri"
hero: "pahlawan"
this: "ini"
or: "atau"
"||": "atau"
and: "dan"
"&&": "dan"
not: "bukan"
"!": "tidak"
"=": "menentukan"
"==": "sama dengan"
"===": "sama persis"
"!=": "tidak sama dengan"
"!==": "tidak sama persis"
">": "lebih besar dari"
">=": "lebih besar dari atau sama dengan"
"<": "kurang dari"
"<=": "kurang dari atau sama"
"*": "dikalikan dengan"
"/": "dibagi dengan"
"+": "penambahan"
"-": "pengurangan"
"+=": "tambahkan dan tetapkan"
"-=": "kurangi dan tetapkan"
True: "Betul"
true: "betul"
False: "Salah"
false: "salah"
undefined: "tidak didefinisikan"
null: "null"
nil: "nihil"
None: "Tidak ada"
share_progress_modal:
blurb: "Kamu membuat kemajuan yang besar! Beritahu orang tuamu berapa banyak kamu telah pelajari dengan CodeCombat."
email_invalid: "Alamat email tidak valid."
form_blurb: "Masukkan alamat email orang tuamu dibawah dan kami akan beritahu mereka!"
form_label: "Alamat Email"
placeholder: "alamat email"
title: "Kerja yang sangat bagus, Murid"
login:
sign_up: "Buat Akun"
email_or_username: "Email atau username"
log_in: "Masuk"
logging_in: "Sedang masuk"
log_out: "Keluar"
forgot_password: "<PASSWORD>?"
finishing: "Finishing"
sign_in_with_facebook: "Masuk dengan Facebook"
sign_in_with_gplus: "Masuk dengan Google"
signup_switch: "Ingin membuat akun?"
accounts_merge_confirmation: "Akun tersebut telah digunakan oleh akun google yang lain. Apakah anda ingin menggabungkan kedua akun tersebut?"
signup:
complete_subscription: "Berlanggangan Penuh"
create_student_header: "Membuat Akun Siswa"
create_teacher_header: "Membuat Akun Guru"
create_individual_header: "Membuat Akun Individual"
email_announcements: "Menerima berita mengenai level CodeCombat dan fitur yang baru!"
sign_in_to_continue: "Masuk atau buat akun baru untuk lanjut"
# create_account_to_submit_multiplayer: "Create a free account to rank your multiplayer AI and explore the whole game!"
teacher_email_announcements: "Selalu berikan informasi saya materi, kurikulum, dan kursus!"
creating: "Membuat Akun..."
sign_up: "Masuk"
log_in: "masuk dengan kata sandi"
login: "Masuk"
required: "Kamu wajib masuk sebelum bisa melanjutkannya"
login_switch: "Sudah memiliki akun?"
optional: "opsional"
connected_gplus_header: "Kamu berhasil terhubung dengan Google+"
connected_gplus_p: "Selesaikan pendaftaran supaya kamu bisa masuk dengan akun Google+ milikmu"
connected_facebook_header: "Kamu berhasil terhubung dengan Facebook!"
connected_facebook_p: "Selesaikan pendaftaran supaya kamu bisa terhubung dengan akun Facebook milikmu"
hey_students: "Murid-murid, silakan masukkan kode kelas dari gurumu"
birthday: "Tanggal lahir"
parent_email_blurb: "Kamu tahu bahwa kamu tidak dapat menunggu untuk belajar pemrograman — kamipun juga sangat senang! Orang tua kalian akan menerima email dengan instruksi lebih lanjut tentang membuat akun untukmu. Silakan email {{email_link}} jika kamu memiliki pertanyaan."
classroom_not_found: "Tidak ada kelas dengan Kode Kelas ini. Cek kembali penulisannya atau mintalah bantuan kepada gurumu"
checking: "Sedang mengecek..."
account_exists: "Email ini telah digunakan:"
sign_in: "Masuk"
email_good: "Email dapat digunakan!"
name_taken: "Nama pengguna sudah diambil! Ingin mencoba {{suggestedName}}?"
name_available: "Nama pengguna tersedia!"
name_is_email: "Nama pengguna tidak boleh berupa email"
choose_type: "Pilih tipe akunmu:"
teacher_type_1: "Mengajarkan pemrograman menggunakan CodeCombat!"
teacher_type_2: "Mempersiapkan kelasmu"
teacher_type_3: "Mengakses Panduan Kursus"
teacher_type_4: "Melihat perkembangan siswa"
signup_as_teacher: "Masuk sebagai guru"
student_type_1: "Mempelajari cara pemrograman sambil bermain sebuah permainan yang menarik!"
student_type_2: "Bermain dengan kelasmu"
student_type_3: "Bersaing dalam arena"
student_type_4: "Pilih jagoanmu!"
student_type_5: "Persiapkan Kode Kelasmu!"
signup_as_student: "Masuk sebagai siswa"
individuals_or_parents: "Individu dan Orang Tua"
individual_type: "Untuk pemain yang belajar kode di luar kelas. Para orang tua harus mendaftar akun di sini"
signup_as_individual: "Daftar sebagai individu"
enter_class_code: "Masukkan Kode Kelas kamu"
enter_birthdate: "Masukkan tanggal lahirmu:"
parent_use_birthdate: "Para orang tua, gunakan tanggal lahirmu."
ask_teacher_1: "Tanyakan gurumu untuk Kode Kelas kamu"
ask_teacher_2: "Bukan bagian dari kelas? Buatlah"
ask_teacher_3: "Akun Individu"
ask_teacher_4: " sebagai gantinya."
about_to_join: "Kamu akan bergabung:"
enter_parent_email: "Masukkan email orang tua kamu:"
parent_email_error: "Terjadi kesalahan ketika mencoba mengirim email. Cek alamat email dan coba lagi."
parent_email_sent: "Kamu telah mengirim email dengan instruksi lebih lanjut tentang cara membuat akun. Tanyakan orang tua kamu untuk mengecek kotak masuk mereka."
account_created: "Akun Telah Dibuat!"
confirm_student_blurb: "Tulislah informasi kamu supaya kamu tidak lupa. Gurumu juga dapat membantu untuk mereset kata sandi kamu setiap saat."
confirm_individual_blurb: "Tulis informasi masuk kamu jika kamu membutuhkannya lain waktu. Verifikasi email kamu supaya kamu dapat memulihkan akun kamu jika kamu lupa kata sandimu - check kotak masukmu!"
write_this_down: "Tulislah ini:"
start_playing: "Mulai Bermain!"
sso_connected: "Berhasil tersambung dengan:"
select_your_starting_hero: "Pilihlah Jagoan Awalmu:"
you_can_always_change_your_hero_later: "Kamu dapat mengganti jagoanmu nanti."
finish: "Selesai"
teacher_ready_to_create_class: "Kamu telah siap untuk membuat kelas pertamamu!"
teacher_students_can_start_now: "Siswa-siswamu dapat mulai bermain di kursus pertama, Pengenalan dalam Ilmu Komputer, segera."
teacher_list_create_class: "Di layar berikut, kamu akan dapat membuat sebuah kelas."
teacher_list_add_students: "Tambahkan siswa-siswa ke dalam kelas dengan mengklik link Lihat Kelas, lalu kirimkan siswa-siswamu ke dalam Kode Kelas atau URL. Kamu juga dapat mengundang mereka dari email jika mereka memiliki alamat email."
teacher_list_resource_hub_1: "Periksalah"
teacher_list_resource_hub_2: "Petunjuk Kursus"
teacher_list_resource_hub_3: "Untuk penyelesaian di setiap level, dan"
teacher_list_resource_hub_4: "Pusat Materi"
teacher_list_resource_hub_5: "untuk panduan kurikulum, aktifitas, dan lainnya!"
teacher_additional_questions: "Itu saja! Jika kamu memerlukan tambahan bantuan atau pertanyaan, jangkaulah di __supportEmail__."
dont_use_our_email_silly: "Jangan taruh email kami di sini! Taruhlah di email orangtuamu"
want_codecombat_in_school: "Ingin bermain CodeCombat setiap saat?"
eu_confirmation: "Saya setuju untuk mengizinkan CodeCombat menyimpan data saya di server AS."
eu_confirmation_place_of_processing: "Pelajari lebih lanjut tentang kemungkinan risikonya"
eu_confirmation_student: "Jika Anda tidak yakin, tanyakan pada guru Anda."
eu_confirmation_individual: "Jika Anda tidak ingin kami menyimpan data Anda di server AS, Anda dapat terus bermain secara anonim tanpa menyimpan kode Anda."
password_requirements: "8 hingga 64 karakter tanpa pengulangan"
invalid: "Tidak valid"
invalid_password: "<PASSWORD>"
with: "<PASSWORD>"
want_to_play_codecombat: "Tidak, saya tidak punya satu pun tapi ingin bermain CodeCombat!"
have_a_classcode: "Punya Kode Kelas?"
yes_i_have_classcode: "Ya, saya memiliki Kode Kelas!"
enter_it_here: "Masukkan di sini:"
recover:
recover_account_title: "Pulihkan Akun"
send_password: "<PASSWORD>"
recovery_sent: "Email pemulihan telah dikirim"
items:
primary: "Primer"
secondary: "Sekunder"
armor: "Baju Pelindung"
accessories: "Aksesoris"
misc: "Lain-lain"
books: "Buku-buku"
common:
default_title: "CodeCombat - Coding game untuk belajar Python dan JavaScript"
default_meta_description: "Pelajari kode yang diketik melalui permainan pemrograman. Pelajari Python, JavaScript, dan HTML sambil Anda memecahkan teka-teki dan belajar membuat game dan situs web pengkodean Anda sendiri."
back: "Kembali" # When used as an action verb, like "Navigate backward"
coming_soon: "Segera Hadir!"
continue: "Lanjutkan" # When used as an action verb, like "Continue forward"
next: "Selanjutnya"
default_code: "Kode Asli"
loading: "Memuat..."
overview: "Ikhtisar"
processing: "Memproses..."
solution: "Solusi"
table_of_contents: "Daftar Isi"
intro: "Pengenalan"
saving: "Menyimpan..."
sending: "Mengirim..."
send: "Kirim"
sent: "Terkirim"
cancel: "Batal"
save: "Simpan"
publish: "Publikasi"
create: "Buat"
fork: "Cabangkan"
play: "Mainkan" # When used as an action verb, like "Play next level"
retry: "Coba Lagi"
actions: "Aksi-aksi"
info: "Info"
help: "Bantuan"
watch: "Tonton"
unwatch: "Berhenti Menonton"
submit_patch: "Kirim Perbaikan"
submit_changes: "Kirim Perubahan"
save_changes: "Simpan Perubahan"
required_field: "wajib"
submit: "Kirim"
replay: "Ulangi"
complete: "Selesai"
# pick_image: "Pick Image"
general:
and: "dan"
name: "Nama"
date: "Tanggal"
body: "Badan"
version: "Versi"
pending: "Tertunda"
accepted: "Diterima"
rejected: "Ditolak"
withdrawn: "Ditarik"
accept: "Terima"
accept_and_save: "Terima&Simpan"
reject: "Tolak"
withdraw: "Tarik"
submitter: "<NAME>"
submitted: "Diajukan"
commit_msg: "Pesan Perubahan"
version_history: "Histori Versi"
version_history_for: "Histori Versi Untuk: "
select_changes: "Pilih dua perubahan dibawah untuk melihat perbedaan."
undo_prefix: "Urung"
undo_shortcut: "(Ctrl+Z)"
redo_prefix: "Ulangi"
redo_shortcut: "(Ctrl+Shift+Z)"
play_preview: "Mainkan pratinjau untuk level saat ini"
result: "Hasil"
results: "Hasil"
description: "Deskripsi"
or: "atau"
subject: "Subjek"
email: "Email"
password: "<PASSWORD>"
confirm_password: "<PASSWORD>"
message: "Pesan"
code: "Kode"
ladder: "Tangga"
when: "Ketika"
opponent: "Lawan"
rank: "Peringkat"
score: "Skor"
win: "Menang"
loss: "Kalah"
tie: "Imbang"
easy: "Mudah"
medium: "Sedang"
hard: "Sulit"
player: "Pemain"
player_level: "Level" # Like player level 5, not like level: Dungeons of Kithgard
warrior: "Kesatria"
ranger: "Pemanah"
wizard: "Penyihir"
first_name: "<NAME>"
last_name: "<NAME>"
last_initial: "Inisial <NAME>"
username: "Username"
contact_us: "<NAME>"
close_window: "Tutup Jendela"
learn_more: "Pelajari Lagi"
more: "Lebih Banyak"
fewer: "Lebih Sedikit"
with: "dengan"
chat: "Obrolan"
chat_with_us: "Bicaralah dengan kami"
email_us: "Kirimkan email kepada kami"
sales: "Penjualan"
support: "Dukungan"
# here: "here"
units:
second: "detik"
seconds: "detik"
sec: "dtk"
minute: "menit"
minutes: "menit"
hour: "jam"
hours: "jam"
day: "hari"
days: "hari"
week: "minggu"
weeks: "minggu"
month: "bulan"
months: "bulan"
year: "tahun"
years: "tahun"
play_level:
back_to_map: "Kembali ke Peta"
directions: "Arah"
edit_level: "Edit Level"
keep_learning: "Terus Belajar"
explore_codecombat: "Jelajahi CodeCombat"
finished_hoc: "Saya sudah menyelesaikan Jam Code saya"
get_certificate: "Dapatkan sertifikatmu!"
level_complete: "Level Tuntas"
completed_level: "Level yang terselesaikan:"
course: "Kursus:"
done: "Selesai"
next_level: "Level Selanjutnya"
combo_challenge: "Combo Tantangan"
concept_challenge: "Tantangan Konsep"
challenge_unlocked: "Tantangan Terbuka"
combo_challenge_unlocked: "Tantangan Combo Terbuka"
concept_challenge_unlocked: "Tantangan Konsep Terbuka"
concept_challenge_complete: "Tantangan Konsep Selesai!"
combo_challenge_complete: "Tantangan Combo Selesai!"
combo_challenge_complete_body: "Kerja bagus, sepertinya kamu telah mengerti __concept__ dengan baik dalam perjalananmu!"
replay_level: "Ulang Level"
combo_concepts_used: "__complete__/__total__ Konsep Digunakan"
combo_all_concepts_used: "Kamu telah menggunakan semua kemungkinan konsep untuk memecahkan tantangannya. Kerja Bagus!"
combo_not_all_concepts_used: "Kamu telah menggunakan __complete__ dari __total__ kemungkinan konsep untuk menyelesaikan tantangan. Cobalah untuk menggunakan semua __total__ konsep di lain waktu!"
start_challenge: "Memulai Tantangan"
next_game: "Permainan berikutnya"
languages: "Bahasa"
programming_language: "Bahasa pemrograman"
show_menu: "Tampilkan menu permainan"
home: "Beranda" # Not used any more, will be removed soon.
level: "Level" # Like "Level: Dungeons of Kithgard"
skip: "Lewati"
game_menu: "Menu Permainan"
restart: "Mengulang"
goals: "Tujuan"
goal: "Tujuan"
challenge_level_goals: "Tujuan Tantangan Level"
challenge_level_goal: "Tujuan Tantangan Level"
concept_challenge_goals: "Tujuan Tantangan Konsep"
combo_challenge_goals: "Tujuan Tantangan Level"
concept_challenge_goal: "Tujuan Tantangan Konsep"
combo_challenge_goal: "Tujuan Tantangan Level"
running: "Jalankan..."
success: "Berhasil!"
incomplete: "Belum selesai"
timed_out: "Kehabisan waktu"
failing: "Gagal"
reload: "Muat Ulang"
reload_title: "Muat Ulang Semua Kode?"
reload_really: "Apakah kamu yakin ingin memuat ulang semua level kembali ke awal mula?"
reload_confirm: "Muat Ulang Semua"
restart_really: "Anda yakin ingin memulai ulang level? Anda akan kehilangan semua kode yang Anda tulis."
restart_confirm: "Ya, Muat Ulang"
test_level: "Tes Level"
victory: "Menang"
victory_title_prefix: ""
victory_title_suffix: " Selesai"
victory_sign_up: "Daftar untuk Menyimnpan Proses"
victory_sign_up_poke: "Ingin menyimpan kodemu? Buatlah akun gratis!"
victory_rate_the_level: "Seberapa menyenangkan level ini?"
victory_return_to_ladder: "Kembali ke Tingkatan"
victory_saving_progress: "Menyimpan Perkembangan"
victory_go_home: "Kembali ke Beranda"
victory_review: "Beritahu kami lebih lagi!"
victory_review_placeholder: "Bagaimana dengan levelnya?"
victory_hour_of_code_done: "Apakah Kamu Selesai?"
victory_hour_of_code_done_yes: "Ya, saya telah menyelesaikan Jam Kode saya"
victory_experience_gained: "XP Didapat"
victory_gems_gained: "Permata Didapat"
victory_new_item: "Barang Baru"
victory_new_hero: "<NAME>"
victory_viking_code_school: "Ya ampun, Itu adalah level yang sulit yang telah kamu selesaikan! Jika kamu belum menjadi pengembang perangkat lunak, kamu seharusnya jadi. Kamu mendapatkan jalur cepat untuk diterima di Viking Code School, dimana kamu dapat mengambil kemampuanmu di level berikutnya dan menjadi pengembang web profesional dalam 14 minggu."
victory_become_a_viking: "Menjadi seorang Viking"
victory_no_progress_for_teachers: "Perkembangan tidak dapat disimpan untuk guru. Tetapi kamu dapat menambahkan akun siswa ke dalam kelasmu untuk dirimu"
tome_cast_button_run: "Jalankan"
tome_cast_button_running: "Berjalan"
tome_cast_button_ran: "Telah berjalan"
tome_cast_button_update: "Perbarui"
tome_submit_button: "Submit"
tome_reload_method: "Memuat ulang kode asli untuk mengulang level"
tome_your_skills: "Kemampuan Kamu"
hints: "Petunjuk"
videos: "Video"
hints_title: "Petunjuk {{number}}"
code_saved: "Kode disimpan"
skip_tutorial: "Lewati (esc)"
keyboard_shortcuts: "Tombol Pintas"
loading_start: "Memulai Level"
loading_start_combo: "Memulai Tantangan Combo"
loading_start_concept: "Memulai Tantangan Konsep"
problem_alert_title: "Perbaiki Kode Kamu"
time_current: "Sekarang:"
time_total: "Maks:"
time_goto: "Menuju ke:"
non_user_code_problem_title: "Tidak dapat memuat ulang Level"
infinite_loop_title: "Perulangan Tak Terhingga Terdeteksi"
infinite_loop_description: "Kode awal untuk membangun dunia tidak pernah selesai. Kemungkinan karena sangat lambat atau terjadi perulangan tak terhingga. Atau mungkin ada kesalahan. Kamu dapat mencoba menjalankan kode ini kembali atau mengulang kode ke keadaan semula. Jika masih tidak bisa, tolong beritahu kami."
check_dev_console: "Kamu dapat membuka developer console untuk melihat apa yang menjadi penyebab kesalahan"
check_dev_console_link: "(instruksi-instruksi)"
infinite_loop_try_again: "Coba Lagi"
infinite_loop_reset_level: "Mengulang Level"
infinite_loop_comment_out: "Mengkomentari Kode Saya"
tip_toggle_play: "Beralih mulai/berhenti dengan Ctrl+P"
tip_scrub_shortcut: "Gunakan Ctrl+[ dan Ctrl+] untuk memutar ulang dan mempercepat."
tip_guide_exists: "Klik panduan, di dalam menu (di bagian atas halaman), untuk info yang bermanfaat."
tip_open_source: "CodeCombat adalah bagian dari komunitas sumber terbuka!"
tip_tell_friends: "Menikmati CodeCombat? Ceritakan kepada temanmu mengenai kami!"
tip_beta_launch: "CodeCombat diluncurkan beta di Oktober 2013."
tip_think_solution: "Pikirkan solusinya, bukan masalahnya."
tip_theory_practice: "Dalam teori, tidak ada perbedaan antara teori dan praktek. Tetapi dalam praktek, ada bedanya. - <NAME>"
tip_error_free: "Ada dua cara untuk menulis program yang bebas dari error; tetapi hanya cara ketiga yang berhasil. - <NAME>"
tip_debugging_program: "Jika men-debug adalah proses menghilangkan bugs, maka memprogram pastilah proses menaruhnya kembali. - <NAME>"
tip_forums: "Pergilah menuju ke forum dan ceritakan apa yang kamu pikirkan!"
tip_baby_coders: "Di masa depan, bahkan para bayi akan menjadi Penyihir Tinggi."
tip_morale_improves: "Proses pemuatan akan dilanjutkan sampai moral naik."
tip_all_species: "Kami percaya bahwa ada kesempatan yang sama untuk belajar pemrograman untuk semua spesies."
tip_reticulating: "Retikulasi tulang belakang."
tip_harry: "Kamu seorang penyihir, "
tip_great_responsibility: "Dengan kemampuan koding yang besar, timbul tanggung jawab men-debug yang besar."
tip_munchkin: "Jika kamu tidak memakan sayuranmu, maka seekor munchkin akan datang kepadamu selagi kamu tertidur."
tip_binary: "Hanya ada 10 tipe orang yang ada di dunia: Mereka yang mengerti biner, dan mereka yang tidak."
tip_commitment_yoda: "Seorang programmer harus memiliki komitmen yang paling dalam, pikiran yang paling serius. ~ Yoda"
tip_no_try: "Lakukan. Atau tidak. Tidak ada coba-coba. - Yoda"
tip_patience: "Kesabaran kamu harus miliki, Padawan muda. - Yoda"
tip_documented_bug: "Sebuah dokumentasi bugs bukanlah bugs; tetapi sebuah fitur."
tip_impossible: "Selalu saja terlihat tidak mungkin sampai hal itu berhasil. - <NAME>"
tip_talk_is_cheap: "Bicara itu mudah. Tunjukkan kepadaku kodenya. - <NAME>"
tip_first_language: "Hal malapetaka yang pernah kamu pelajari adalah bahasa pemrograman pertamamu. - Alan Kay"
tip_hardware_problem: "Q: Berapa banyak programmer yang dibutuhkan untuk mengganti bohlam lampu? A: Tidak ada, Itu adalah masalah perangkat keras."
tip_hofstadters_law: "Hukum Hofstadter: Selalu saja lebih lama dari yang kamu perkirakan, bahkan ketika kamu memperhitungkan Hukum Hofstadter."
tip_premature_optimization: "Optimasi yang prematur adalah akar dari semua keburukan. - <NAME>"
tip_brute_force: "Jika ragu-ragu, gunakanlah kebrutalan. - <NAME>"
tip_extrapolation: "Ada dua tipe orang: mereka yang mampu mengekstrapolasi dari data yang tidak lengkap..."
tip_superpower: "Koding adalah hal yang paling dekat bahwa kita memiliki kekuatan super."
tip_control_destiny: "Dalam sumber terbuka sebenarnya, kamu memiliki hak untuk mengontrol nasibmu. <NAME>"
tip_no_code: "Tanpa kode lebih cepat daripada tidak tidak mengkode"
tip_code_never_lies: "Kode tidak pernah berbohong, tetapi komentar kadang-kadang. - <NAME>"
tip_reusable_software: "Sebelum perangkat lunak dapat digunakan kembali, pertama-tama dia harus bisa digunakan."
tip_optimization_operator: "Semua pemrograman memiliki operator yang dioptimasi. Dalam semua bahasa operator tersebut adalah ‘//’"
tip_lines_of_code: "Mengukur kemajuan pemrograman dari jumlah baris kode sama seperti mengukur proses pembuatan pesawat terbang dari beratnya. - <NAME>"
tip_source_code: "Aku ingin mengubah dunia tetapi mereka tidak memberikan aku kode sumbernya."
tip_javascript_java: "Java adalah untuk JavaScript sama seperti Bis dengan Biskuit. - <NAME>"
tip_move_forward: "Apapun yang telah kamu lakukan, tetaplah bergerak ke depan. - <NAME> Jr."
tip_google: "Punya masalah yang tidak dapat kamu pecahkan? Google saja!"
tip_adding_evil: "Menambahkan sejumput kejahatan."
tip_hate_computers: "Ada sesuatu mengenai orang yang berpikir bahwa mereka benci komputer. Tetapi yang mereka benci sebenarnya adalah programmer yang buruk. - <NAME>"
tip_open_source_contribute: "Kamu dapat membantu CodeCombat menjadi lebih baik!"
tip_recurse: "Mengulang adalah manusiawi, Rekursi adalah ilahi. - <NAME>"
tip_free_your_mind: "Kamu harus membiarkan semua berlalu, Neo. Ketakutan, keraguan, ketidak percayaan. Bebaskan pikiranmu - Morpheus"
tip_strong_opponents: "Bahkan lawan yang paling kuat sekalipun selalu memiliki kelemahan. Itachi Uchiha"
tip_paper_and_pen: "Sebelum kamu memulai mengkode, kamu dapat selalu berencana dengan sebuah kertas dan sebuah pena."
tip_solve_then_write: "Pertama-tama, pecahkan masalah. Lalu, tulislah kodenya. - <NAME>"
tip_compiler_ignores_comments: "Kadang-kadang saya berpikir bahwa compiler acuh kepada komentar saya."
tip_understand_recursion: "Salah satu cara untuk mengerti rekursif adalah mengerti apa itu rekursif"
tip_life_and_polymorphism: "Sumber Terbuka adalah seperti banyak bentuk struktur yang heterogen: Semua tipe dipersilakan."
tip_mistakes_proof_of_trying: "Kesalahan di kode kamu hanyalah sebuah bukti bahwa kamu sedang mencoba."
tip_adding_orgres: "Membulatkan raksasa."
tip_sharpening_swords: "Menajamkan pedang-pedang"
tip_ratatouille: "Kamu tidak boleh membiarkan semua orang mendefinisikan batasmu, karena tempat asalmu. Batasmu hanyalah jiwamu. - Gust<NAME>au, <NAME>ille"
tip_nemo: "Ketika kehidupan membuatmu patah semangat, ingin tahu apa yang harus kamu lakukan? Tetaplah berenang, tetaplah berenang. <NAME>, <NAME>"
tip_internet_weather: "Baru saja pindah ke internet, di sini sangatlah baik. Kami bisa hidup di dalam di mana cuaca selalu luar biasa. - <NAME>"
tip_nerds: "Kutu buku diperbolehkan untuk menyukai sesuatu, seperti melompat-naik-turun-di-kursi-tidak-dapat-mengontrol-diri suka sekali. - <NAME>"
tip_self_taught: "Saya mengajari diri saya 90% dari apa yang telah saya pelajari. Dan itu normal! - <NAME>"
tip_luna_lovegood: "Jangan khawatir, karena kamu sama warasnya dengan aku. - <NAME>"
tip_good_idea: "Cara terbaik untuk memiliki ide baik adalah memiliki ide yang sangat banyak. - <NAME>"
tip_programming_not_about_computers: "Ilmu Komputer tidak hanya mengenai komputer sama seperti astronomi tidak hanya seputar teropong. - <NAME>"
tip_mulan: "Percayalah apa yang kamu bisa, maka kamu bisa. - Mulan"
project_complete: "Proyek Selesai!"
share_this_project: "Bagikan proyek ini dengan teman-teman atau keluarga:"
ready_to_share: "Siap untuk mempublikasikan proyekmu?"
click_publish: "Klik \"Publikasi\" untuk membuatnya muncul di galeri kelas, lalu cek apakah yang teman sekelasmu buat! Kamu dapat kembali lagi dan melanjutkan proyek ini. Segala perubahan akan secara otomatis disimpan dan dibagikan ke teman sekelas."
already_published_prefix: "Perubahan kamu telah dipublikasikan ke galeri kelas"
already_published_suffix: "Tetaplah bereksperimen dan membuat proyek ini menjadi lebih baik, atau apa saja yang kelasmu telah buat! Perubahanmu akan secara otomatis disimpan dan dibagikan dengan seluruh teman sekelasmu."
view_gallery: "Lihat Galeri"
project_published_noty: "Level kamu telah dipublikasikan!"
keep_editing: "Tetap Sunting"
learn_new_concepts: "Pelajari konsep baru"
watch_a_video: "Tonton video di __concept_name__"
concept_unlocked: "Konsep Tidak Terkunci"
use_at_least_one_concept: "Gunakan setidaknya satu konsep:"
command_bank: "Bank Perintah"
learning_goals: "Tujuan belajar"
start: "Mulai"
vega_character: "Karakter Vega"
click_to_continue: "Klik untuk Melanjutkan"
fill_in_solution: "Isi solusi"
# play_as_humans: "Play As Red"
# play_as_ogres: "Play As Blue"
apis:
methods: "Metode"
events: "Event"
handlers: "Penangan"
properties: "Properti"
snippets: "Cuplikan"
spawnable: "Spawnable"
html: "HTML"
math: "Matematika"
array: "Array"
object: "Objek"
string: "String"
function: "Fungsi"
vector: "Vektor"
date: "Tanggal"
jquery: "jQuery"
json: "JSON"
number: "Number"
webjavascript: "JavaScript"
amazon_hoc:
title: "Terus Belajar dengan Amazon!"
congrats: "Selamat, Anda telah menaklukkan Hour of Code yang menantang itu!"
educate_1: "Sekarang, teruslah belajar tentang coding dan komputasi cloud dengan AWS Educate, program menarik dan gratis dari Amazon untuk siswa dan guru. Dengan AWS Educate, Anda dapat memperoleh lencana keren saat mempelajari dasar-dasar cloud dan pemotongan teknologi canggih seperti game, realitas virtual, dan Alexa. "
educate_2: "Pelajari lebih lanjut dan daftar di sini"
future_eng_1: "Anda juga dapat mencoba membangun keterampilan fakta sekolah Anda sendiri untuk Alexa"
future_eng_2: "di sini"
future_eng_3: "(perangkat tidak diperlukan). Aktivitas Alexa ini dipersembahkan oleh"
future_eng_4: "Insinyur Masa Depan Amazon"
future_eng_5: "program yang menciptakan kesempatan belajar dan bekerja bagi semua siswa K-12 di Amerika Serikat yang ingin mengejar ilmu komputer."
live_class:
title: "Terima kasih!"
content: "Luar biasa! Kami baru saja meluncurkan kelas online langsung."
link: "Siap melanjutkan pengkodean Anda?"
code_quest:
great: "Hebat!"
join_paragraph: "Bergabunglah dengan turnamen pengkodean Python AI internasional terbesar untuk segala usia dan berkompetisi untuk menduduki peringkat teratas papan peringkat! Pertarungan global selama sebulan ini dimulai 1 Agustus dan termasuk hadiah senilai $5.000 dan penghargaan penghargaan tempat kami di virtual mengumumkannya pemenang dan kenali keterampilan pengkodean Anda. "
link: "Klik di sini untuk mendaftar dan belajar lebih lanjut"
global_tournament: "Turnamen Global"
register: "<NAME>ftar"
date: "1 Agustus - 31 Agustus"
play_game_dev_level:
created_by: "Dibuat oleh {{name}}"
created_during_hoc: "Dibuat ketika Hour of Code"
restart: "Mengulang Level"
play: "Mainkan Level"
play_more_codecombat: "Mainkan Lebih CodeCombat"
default_student_instructions: "Klik untuk mengontrol jagoan kamu dan menangkan game kamu!"
goal_survive: "Bertahan hidup."
goal_survive_time: "Bertahan hidup selama __seconds__ detik."
goal_defeat: "Kalahkan semua musuh."
goal_defeat_amount: "Kalahkan __amount__ musuh."
goal_move: "Bergerak ke semua tanda X merah"
goal_collect: "Kumpulkan semua barang-barang"
goal_collect_amount: "Kumpulkan __amount__ barang."
game_menu:
inventory_tab: "Inventaris"
save_load_tab: "Simpan/Muat"
options_tab: "Opsi"
guide_tab: "Panduan"
guide_video_tutorial: "Panduan Video"
guide_tips: "Saran"
multiplayer_tab: "Multipemain"
auth_tab: "Daftar"
inventory_caption: "Pakai jagoanmu"
choose_hero_caption: "Memilih jagoan, bahasa"
options_caption: "Mengkonfigurasi pengaturan"
guide_caption: "Dokumen dan saran"
multiplayer_caption: "Bermain bersama teman-teman!"
auth_caption: "Simpan perkembanganmu"
leaderboard:
view_other_solutions: "Lihat Peringkat Pemain"
scores: "Skor"
top_players: "Permain teratas dalam"
day: "Hari ini"
week: "Minggu ini"
all: "Sepanjang waktu"
latest: "Terakhir"
time: "Waktu menang"
damage_taken: "Kerusakan yang Diterima"
damage_dealt: "Kerusakan yang Diberikan"
difficulty: "Kesulitan"
gold_collected: "Emas yang dikumpulkan"
survival_time: "Bertahan Hidup"
defeated: "Lawan yang Dikalahkan"
code_length: "Baris Kode"
score_display: "__scoreType__: __score__"
inventory:
equipped_item: "Terpakai"
required_purchase_title: "Wajib"
available_item: "Tersedia"
restricted_title: "Terlarang"
should_equip: "(klik ganda untuk memakai)"
equipped: "(terpakai)"
locked: "(terkunci)"
restricted: "(terlarang di level ini)"
equip: "Pakai"
unequip: "Lepas"
warrior_only: "Kesatria Saja"
ranger_only: "Pemanah Saja"
wizard_only: "Penyihir Saja"
buy_gems:
few_gems: "Sedikit permata"
pile_gems: "Tumpukan permata"
chest_gems: "Peti penuh permata"
purchasing: "Membeli..."
declined: "Kartumu ditolak"
retrying: "Terjadi kesalahan di server, mencoba kembali"
prompt_title: "Permata Tidak Cukup"
prompt_body: "Ingin mendapatkan lebih?"
prompt_button: "Masuk Toko"
recovered: "Pembelian permata sebelumnya dipulihkan. Silakan perbaharui halaman."
price: "x{{gems}} / bln"
buy_premium: "Beli Premium"
purchase: "Membeli"
purchased: "Terbeli"
subscribe_for_gems:
prompt_title: "Permata Tidak Cukup!"
prompt_body: "Berlangganan Premium untuk mendapatkan permata dan akses ke lebih banyak level!"
earn_gems:
prompt_title: "Permata Tidak Cukup"
prompt_body: "Tetap bermain untuk mendapatkan lebih!"
subscribe:
best_deal: "Transaksi Terbaik!"
confirmation: "Selamat! Kamu telah berlangganan CodeCombat Premium!"
premium_already_subscribed: "Kamu telah berlangganan Premium"
subscribe_modal_title: "CodeCombat Premium"
comparison_blurb: "Menjadi Penguasa Kode - berlangganan <b>Premium</b> hari ini!"
must_be_logged: "Kamu harus masuk terlebih dahulu. Silakan buat akun atau masuk dari menu di atas"
subscribe_title: "Berlangganan" # Actually used in subscribe buttons, too
unsubscribe: "Berhenti Berlangganan"
confirm_unsubscribe: "Konfirmasi Berhenti Berlangganan"
never_mind: "Tidak masalah, Aku Masih Suka Kamu"
thank_you_months_prefix: "Terima kasih telah mendukung kami hingga saat ini"
thank_you_months_suffix: "bulan."
thank_you: "Terima kasih telah mendukung CodeCombat."
sorry_to_see_you_go: "Kami sedih melihat kamu pergi! Tolong beritahu, apa yang bisa kami lakukan untuk menjadi lebih baik."
unsubscribe_feedback_placeholder: "Oh, apa yang telah kami lakukan?"
stripe_description: "Berlangganan Bulanan"
stripe_yearly_description: "Langganan Tahunan"
buy_now: "Beli Sekarang"
subscription_required_to_play: "Kamu butuh berlangganan untuk memainkan level ini."
unlock_help_videos: "Berlangganan untuk membuka semua panduan video."
personal_sub: "Langganan Pribadi" # Accounts Subscription View below
loading_info: "Memuat informasi langganan..."
managed_by: "Diatur oleh"
will_be_cancelled: "Akan dibatalkan"
currently_free: "Kamu memiliki langganan gratis"
currently_free_until: "Kamu saat ini memiliki langganan hingga"
free_subscription: "Berlangganan gratis"
was_free_until: "Kamu memiliki langganan gratis hingga"
managed_subs: "Mengatur Langganan"
subscribing: "Berlangganan..."
current_recipients: "Penerima Saat Ini"
unsubscribing: "Berhenti Berlangganan"
subscribe_prepaid: "Klik Berlangganan untuk menggunakan kode prabayar"
using_prepaid: "Menggunakan kode prabayar untuk berlangganan bulanan"
feature_level_access: "Akses 300+ level tersedia"
feature_heroes: "Membuka jagoan dan peliharaan ekslusif"
feature_learn: "Belajar membuat permainan dan situs web"
feature_gems: "Terima permata __gems__ per bulan"
month_price: "$__price__" # {change}
first_month_price: "Hanya $__price__ untuk bulan pertamamu!"
lifetime: "Akses Seumur Hidup"
lifetime_price: "$__price__"
year_subscription: "Berlangganan Tahunan"
year_price: "$__price__/year" # {change}
support_part1: "Membutuhkan bantuan pembayaran atau memilih PayPal? Email"
support_part2: "<EMAIL>"
announcement:
now_available: "Sekarang tersedia untuk pelanggan!"
subscriber: "pelanggan"
cuddly_companions: "Sahabat yang Menggemaskan!" # Pet Announcement Modal
kindling_name: "Kindling Elemental"
kindling_description: "Kindling Elementals hanya ingin membuat Anda tetap hangat di malam hari. Dan di siang hari. Sepanjang waktu, sungguh."
griffin_name: "<NAME>"
griffin_description: "Griffin adalah setengah elang, setengah singa, semuanya menggemaskan."
raven_name: "Raven"
raven_description: "Burung gagak sangat ahli dalam mengumpulkan botol berkilau yang penuh dengan kesehatan untuk Anda."
mimic_name: "Mimic"
mimic_description: "Mimik dapat mengambil koin untuk Anda. Pindahkan ke atas koin untuk meningkatkan persediaan emas Anda."
cougar_name: "<NAME>gar"
cougar_description: "Para cougar ingin mendapatkan gelar PhD dengan Mendengkur dengan Bahagia Setiap Hari."
fox_name: "<NAME>"
fox_description: "Rubah biru sangat pintar dan suka menggali tanah dan salju!"
pugicorn_name: "<NAME>"
pugicorn_description: "Pugicorn adalah salah satu makhluk paling langka dan bisa merapal mantra!"
wolf_name: "<NAME>"
wolf_description: "Anak anjing serigala unggul dalam berburu, mengumpulkan, dan memainkan permainan petak umpet!"
ball_name: "<NAME>"
ball_description: "ball.squeak()"
collect_pets: "Kumpulkan hewan peliharaan untuk pahlawanmu!"
each_pet: "Setiap hewan memiliki kemampuan penolong yang unik!"
upgrade_to_premium: "Menjadi {{subscriber}} untuk melengkapi hewan peliharaan."
play_second_kithmaze: "Mainkan {{the_second_kithmaze}} untuk membuka kunci Anjing Serigala!"
the_second_kithmaze: "Kithmaze Kedua"
keep_playing: "Terus bermain untuk menemukan hewan peliharaan pertama!"
coming_soon: "Segera hadir"
ritic: "<NAME> C<NAME>" # Ritic Announcement Modal
ritic_description: "Ritic the Cold. Terjebak di <NAME> selama berabad-abad, akhirnya bebas dan siap merawat para ogre yang memenjarakannya."
ice_block: "Satu balok es"
ice_description: "Tampaknya ada sesuatu yang terperangkap di dalam ..."
blink_name: "Blink"
blink_description: "Ritika menghilang dan muncul kembali dalam sekejap mata, hanya meninggalkan bayangan."
shadowStep_name: "Shadowstep"
shadowStep_description: "Seorang pembunuh bayaran tahu bagaimana berjalan di antara bayang-bayang."
tornado_name: "Tornado"
tornado_description: "Sebaiknya ada tombol setel ulang saat penutup seseorang meledak."
wallOfDarkness_name: "Wall of Darkness"
wallOfDarkness_description: "Bersembunyi di balik dinding bayangan untuk mencegah tatapan mata yang mengintip."
avatar_selection:
pick_an_avatar: "Pilih avatar yang akan mewakili Anda sebagai pemain"
premium_features:
get_premium: "Dapatkan<br>CodeCombat<br>Premium" # Fit into the banner on the /features page
master_coder: "Menjadi seorang Master Kode dengan berlangganan sekarang!"
paypal_redirect: "Kamu akan dialihkan ke PayPal untuk menyelesaikan proses berlanggangan."
subscribe_now: "Berlangganan Sekarang"
hero_blurb_1: "Dapatkan akses ke __premiumHeroesCount__ jagoan pengisian-super khusus-pelanggan! Manfaatkan kekuatan tak terbendung dari <NAME>, keakuratan yang mematikan dari Naria si Daun, atau memanggil \"menggemaskan\" kerangka oleh <NAME>."
hero_blurb_2: "Kesatria Premium membuka kemampuan beladiri yang menakjubkan seperti Warcry, Stomp, dan Hurl Enemy. Atau, bermain sebagai Pemanah, menggunakan panah dan tidak terdeteksi, melempar pisau, jebakan! Coba kemampuanmu sebagai Penyihir sejati, dan melepaskan susunan Primodial yang kuat, Ilmu Nujum ataupun Elemen Ajaib!"
hero_caption: "Hero baru yang menarik!"
pet_blurb_1: "Peliharaan tidak hanya sebagai teman yang menggemaskan, tetapi mereka juga menyediakan fungsionalitas dan metode unik. Bayi Grifon dapat membawa unit melalui udara, Anak Serigala bermain tangkap dengan panah musuh, Puma suka mengejar raksasa, dan Mimic menarik koin seperti magnet!"
pet_blurb_2: "Koleksi semua peliharaan untuk mengetahui kemampuan unik mereka!"
pet_caption: "Asuh peliharaanmu untuk menemani jagoanmu!"
game_dev_blurb: "Belajar menulis game dan membangun level baru untuk dibagikan kepada teman-temanmu! Taruh barang yang kamu mau, tulis kode untuk logika unit dan tingkah laku, lalu saksikan apakah temanmu dapat menyelesaikan level itu!"
game_dev_caption: "Desain gamemu sendiri untuk menantang teman-temanmu!"
everything_in_premium: "Semuanya kamu dapatkan di CodeCombat Premium:"
list_gems: "Dapatkan bonus permata untuk membeli perlengkapan, peliharaan, dan jagoan"
list_levels: "Dapatkan akses untuk __premiumLevelsCount__ level lebih banyak"
list_heroes: "Membuka jagoan eksklusif, termasuk kelas Pemanah dan Penyihir"
list_game_dev: "Buat dan bagikan game dengan teman-teman"
list_web_dev: "Bangun situs web dan aplikasi interaktif"
list_items: "Pakai benda Premium seperti peliharaan"
list_support: "Dapatkan bantuan Premium untuk menolongmu men-debug kode yang rumit"
list_clans: "Buatlah klan pribadi untuk mengundang teman-temanmu dan berkompetisi di grup peringkat pemain"
choose_hero:
choose_hero: "Pilih Jagoan Kamu"
programming_language: "Bahasa Pemrograman"
programming_language_description: "Bahasa pemrograman mana yang ingin kamu gunakan?"
default: "Bawaan"
experimental: "Eksperimental"
python_blurb: "Sederhana tapi kuat, cocok untuk pemula dan ahli."
javascript_blurb: "Bahasa untuk web. (Tidak sama dengan Java.)"
coffeescript_blurb: "Sintaksis JavaScript yang lebih bagus"
lua_blurb: "Bahasa untuk Skrip Permainan"
java_blurb: "(Khusus Pelanggan) Android dan perusahaan."
cpp_blurb: "(Khusus Pelanggan) Pengembangan game dan komputasi kinerja tinggi."
status: "Status"
weapons: "Senjata"
weapons_warrior: "Pedang - Jarak Dekat, Tanpa Sihir"
weapons_ranger: "Busur Silang, Senapan - Jarak Jauh, Tanpa Sihir"
weapons_wizard: "Tongkat pendek, Tongkat panjang - Jarak Jauh, Sihir"
attack: "Kerusakan" # Can also translate as "Attack"
health: "Kesehatan"
speed: "Kecepatan"
regeneration: "Regenerasi"
range: "Jarak" # As in "attack or visual range"
blocks: "Tangkisan" # As in "this shield blocks this much damage"
backstab: "Tusukan Belakang" # As in "this dagger does this much backstab damage"
skills: "Kemampuan"
attack_1: "Memberikan"
attack_2: "sejumlah"
attack_3: "kerusakan senjata."
health_1: "Mendapatkan"
health_2: "sejumlah"
health_3: "sekehatan dari baju besi."
speed_1: "Bergerak sejauh"
speed_2: "meter perdetik."
available_for_purchase: "Tersedia untuk Dibeli" # Shows up when you have unlocked, but not purchased, a hero in the hero store
level_to_unlock: "Level untuk dibuka:" # Label for which level you have to beat to unlock a particular hero (click a locked hero in the store to see)
restricted_to_certain_heroes: "Hanya beberapa jagoan yang bisa memainkan level ini."
char_customization_modal:
heading: "Sesuaikan Pahlawan Anda"
body: "<NAME>an"
name_label: "<NAME>"
hair_label: "Warna Rambut"
skin_label: "Warna Kulit"
skill_docs:
function: "fungsi" # skill types
method: "metode"
snippet: "snippet"
number: "nomor"
array: "larik"
object: "objek"
string: "string"
writable: "dapat ditulis" # Hover over "attack" in Your Skills while playing a level to see most of this
read_only: "hanya-bisa-dibaca"
action: "Tindakan"
spell: "Mantra"
action_name: "nama"
action_cooldown: "Membawa"
action_specific_cooldown: "Tenang"
action_damage: "Kerusakan"
action_range: "Jangkauan"
action_radius: "Radius"
action_duration: "Durasi"
example: "Contoh"
ex: "contoh" # Abbreviation of "example"
current_value: "Nilai Saat Ini"
default_value: "Nilai default"
parameters: "Parameter"
required_parameters: "Parameter Wajib"
optional_parameters: "Parameter Opsional"
returns: "Mengembalikan"
granted_by: "Diberikan oleh"
still_undocumented: "Masih tidak berdokumen, maaf."
save_load:
granularity_saved_games: "Tersimpan"
granularity_change_history: "Riwayat"
options:
general_options: "Opsi Umum" # Check out the Options tab in the Game Menu while playing a level
volume_label: "Suara"
music_label: "Musik"
music_description: "Mengubah musik latar menyala/mati."
editor_config_title: "Konfigurasi Editor"
editor_config_livecompletion_label: "Otomatisasi Komplit"
editor_config_livecompletion_description: "Menunjukkan saran otomatis komplit selagi mengetik"
editor_config_invisibles_label: "Tunjukkan yang Kasat Mata"
editor_config_invisibles_description: "Menunjukkan yang kasat mata seperti spasi ataupun tabulasi."
editor_config_indentguides_label: "Tunjukkan Panduan Indentasi"
editor_config_indentguides_description: "Menunjukkan garis vertikal untuk melihat indentasi lebih baik."
editor_config_behaviors_label: "Bantuan Cerdas"
editor_config_behaviors_description: "Otomatis komplit tanda kurung, kurung kurawal, dan tanda petik."
about:
title: "Tentang CodeCombat - Melibatkan Siswa, Memberdayakan Guru, Kreasi yang Menginspirasi"
meta_description: "Misi kami adalah meningkatkan ilmu komputer melalui pembelajaran berbasis game dan membuat pengkodean dapat diakses oleh setiap pelajar. Kami percaya pemrograman adalah keajaiban dan ingin para pelajar diberdayakan untuk menciptakan berbagai hal dari imajinasi murni."
learn_more: "Pelajari lebih lanjut"
main_title: "Jika kamu ingin belajar memprogram, kamu membutuhkan menulis (banyak) kode."
main_description: "Dalam CodeCombat, tugas kamu adalah memastikan kamu melakukannya dengan senyum diwajahmu."
mission_link: "Misi"
team_link: "Tim"
story_link: "Cerita"
press_link: "Pers"
mission_title: "Misi kami: membuat pemrogramman dapat diakses oleh semua siswa di Bumi."
mission_description_1: "<strong>Pemrograman itu ajaib!</strong>. Kemampuannya untuk membuat sesuatu dari imajinasi. Kami memulai CodeCombat untuk memberikan para pelajar kekuatan ajaib yang berada di ujung jemari dengan menggunakan <strong>kode yang ditulis</strong>."
mission_description_2: "Metode ini membuat siswa belajar lebih cepat. JAUH lebih cepat. Seperti sedang bercakap-cakap, bukan seperti membaca buku petunjuk. Kami ingin membawa percakapan tersebut ke setiap sekolah dan ke <strong>semua siswa</strong>, karena semuanya harus memiliki kesempatan untuk belajar keajaiban pemrograman."
team_title: "Bertemu dengan tim CodeCombat"
team_values: "Kami menghargai dialog terbuka dan sopan, dimana ide terbaiklah yang menang. Keputusan kami didasari dari riset pelanggan dan proses kami berfokus pada penyerahan hasil yang jelas kepada mereka. Semuanya turut serta mulai dari CEO sampai ke kontributor Github, karena kami menghargai perkembangan dan pembelajaran dalam tim kami."
nick_title: "Cofounder, CEO"
# csr_title: "Customer Success Representative"
csm_title: "Manajer Kesuksesan Pelanggan"
scsm_title: "Manajer Sukses Pelanggan Senior"
ae_title: "Akun Eksekutif"
sae_title: "Akun Eksekutif Senior"
sism_title: "Manajer Penjualan Senior"
shan_title: "Kepala Pemasaran, CodeCombat Greater China"
run_title: "Kepala Operasi, CodeCombat Greater China"
lance_title: "Kepala Teknologi, CodeCombat Greater China"
zhiran_title: "Kepala Kurikulum, CodeCombat Greater China"
yuqiang_title: "Kepala Inovasi, CodeCombat Greater China"
swe_title: "Insinyur Perangkat Lunak"
sswe_title: "Insinyur Perangkat Lunak Senior"
css_title: "Pakar Dukungan Pelanggan"
css_qa_title: "Dukungan Pelanggan / Spesialis QA"
maya_title: "Pengembang Kurikulum Senior"
bill_title: "Manajer Umum, CodeCombat Greater China"
pvd_title: "Produk dan Desainer Visual"
spvd_title: "Produk Senior dan Desainer Visual"
daniela_title: "Manajer Pemasaran"
bobby_title: "Perancang Game"
brian_title: "Manajer Desain Game Senior"
stephanie_title: "Pakar Dukungan Pelanggan"
sdr_title: "Perwakilan Pengembangan Penjualan"
retrostyle_title: "Ilustrasi"
retrostyle_blurb: "Permainan RetroStyle"
community_title: "...dan komunitas sumber terbuka kami"
# lgd_title: "Lead Game Designer"
oa_title: "Operations Associate"
ac_title: "Koordinator Administratif"
ea_title: "Asisten Eksekutif"
om_title: "Manajer Operasi"
mo_title: "Manajer, Operasi"
smo_title: "Manajer Senior, Operasi"
# do_title: "Director of Operations"
scd_title: "Pengembang Kurikulum Senior"
lcd_title: "Pimpinan Pengembang Kurikulum"
# de_title: "Director of Education"
vpm_title: "Wakil Presiden, Pemasaran"
# oi_title: "Online Instructor"
# aoim_title: "Associate Online Instructor Manager"
# bdm_title: "Business Development Manager"
community_subtitle: "Lebih dari 500 kontributor telah membantu membangun CodeCombat, dan lebih banyak lagi yang bergabung tiap minggunya!" # {change}
community_description_3: "CodeCombat adalah"
community_description_link_2: "proyek komunitas"
community_description_1: " dengan ratusan jumlah pemain suka rela membuat level, berkontribusi dengan kode kami dan menambahkan fitur, memperbaiki bugs, mengetes, dan juga mengalihbahasakan game ke dalam 50 bahasa sampai saat ini. Karyawan, kontributor dan perolehan situs dari berbagi ide dan usaha bersama, sebagaimana komunitas sumber terbuka umumnya. Situs ini dibuat dari berbagai proyek sumber terbuka, dan kami membuka sumber untuk diberikan kembali kepada komunitas dan menyediakan pemain yang penasaran-dengan-kode proyek yang mudah untuk dieksplorasi dan dijadikan eksperimen. Semua dapat bergabung di komunitas CodeCombat! Cek "
community_description_link: "halaman kontribusi"
community_description_2: "untuk info lebih lanjut."
number_contributors: "Lebih dri 450 kontributor telah meminjamkan dukungan dan waktu untuk proyek ini." # {change}
story_title: "Kisah kami sejauh ini"
story_subtitle: "Dari 2013, CodeCombat telah berkembang dari sekedar kumpulan sketsa sampai ke permainan yang hidup dan berkembang."
story_statistic_1a: "20,000,000+"
story_statistic_1b: "total pemain"
story_statistic_1c: "telah memulai perjalanan pemrograman mereka melalui CodeCombat"
story_statistic_2a: "Kami telah menerjemahkan ke lebih dari 50 bahasa - pemain kami berasal"
story_statistic_2b: "190+ negara"
story_statistic_3a: "Bersama, mereka telah menulis"
story_statistic_3b: "1 miliar baris kode dan terus bertambah"
story_statistic_3c: "di banyak bahasa pemrograman yang berbeda"
story_long_way_1: "Kami melalui perjalanan yang panjang..."
story_sketch_caption: "Sketsa paling pertama milik Nick menggambarkan permainan pemrograman sedang beraksi."
story_long_way_2: "masih banyak yang harus kami lakukan sebelum menyelesaikan pencarian kami, jadi..."
jobs_title: "Mari bekerja bersama kami dan membantu menulis sejarah CodeCombat!"
jobs_subtitle: "Tidak cocok tetapi berminat untuk tetap berhubungan? Lihat daftar \"Buat Sendiri\" kami"
jobs_benefits: "Keuntungan Karyawan"
jobs_benefit_4: "Liburan tanpa batas"
jobs_benefit_5: "Pengembangan profesional dan dukungan melanjutkan pendidikan - buku gratis dan permainan!"
jobs_benefit_6: "Pengobatan (level emas), perawatan gigi, perawatan mata, perjalanan, 401K"
jobs_benefit_7: "Meja duduk-berdiri untuk semua"
jobs_benefit_9: "Jendela latihan opsional 10 tahun"
jobs_benefit_10: "Cuti Kelahiran (Wanita): 12 minggu dibayar, 6 berikutnya @ 55% gaji"
jobs_benefit_11: "Cuti Kelahiran (Pria): 12 minggu dibayar"
jobs_custom_title: "Buat Sendiri"
jobs_custom_description: "Apakah kamu berhasrat dengan CodeCombat tetapi tidka melihat daftar pekerjaan yang sesuai dengan kualifikasimu? Tulis dan tunjukkan kami, bagaimana kamu pikir kamu dapat berkontribusi di tim kami. Kami ingin mendengarnya darimu!"
jobs_custom_contact_1: "Kirim kami catatan di"
jobs_custom_contact_2: "perkenalkan dirimu dan kami mungkin dapat menghubungi di kemudian hari!"
contact_title: "Kontak & Pers"
contact_subtitle: "Butuh informasi lebih lanjut? Hubungi kami di"
screenshots_title: "Tangkapan Layar Game"
screenshots_hint: "(klik untuk melihat ukuran penuh)"
downloads_title: "Unduh Aset & Informasi"
about_codecombat: "Mengenai CodeCombat"
logo: "Logo"
screenshots: "Tangkapan layar"
character_art: "Seni Karakter"
download_all: "Unduh Semua"
previous: "Sebelum"
location_title: "Kamu berada di pusat kota San Fransisco:"
teachers:
licenses_needed: "Lisensi dibutuhkan"
special_offer:
special_offer: "Penawaran Spesial"
project_based_title: "Kursus Berbasis Proyek"
project_based_description: "Proyek Akhir Fitur Kursus Web dan Pengembangan Permainan yang dapat dibagikan"
great_for_clubs_title: "Sangat baik untuk klub dan kelompok belajar"
great_for_clubs_description: "Guru dapat membeli sampai __maxQuantityStarterLicenses__ Lisensi Awal."
low_price_title: "Hanya __starterLicensePrice__ persiswa"
low_price_description: "Lisensi awal akan aktif selama __starterLicenseLengthMonths__ bulan dari pembelian."
three_great_courses: "Tiga kursus terbaik yang termasuk ke dalam Lisensi Awal:"
license_limit_description: "Guru dapat membeli sampai __maxQuantityStarterLicenses__ Lisensi Awal. Kamu telah membeli __quantityAlreadyPurchased__. Jika kamu membutuhkan lebih, hubungi __supportEmail__. Lisensi awal akan valid selama __starterLicenseLengthMonths__ bulan."
student_starter_license: "Lisensi Awal Siswa"
purchase_starter_licenses: "Membeli Lisensi Awal"
purchase_starter_licenses_to_grant: "Membeli Lisensi Awal untuk mendapatkan akses ke __starterLicenseCourseList__"
starter_licenses_can_be_used: "Lisensi Awal dapat digunakan untuk mendaftar ke kursus tambahan segera setelah pembelian."
pay_now: "Bayar Sekarang"
we_accept_all_major_credit_cards: "Kami menerima semua jenis kartu kredit."
cs2_description: "membangun diatas fondasi dari Pengenalan Ilmu Komputer, menuju ke if-statement, functions, event, dan lainnya."
wd1_description: "memperkenalkan dasar dari HTML dan CSS selagi mengajarkan kemampuan yang dibutuhkan siswa untuk membangun halaman web mereka yang pertama."
gd1_description: "menggunakan sintaks yang siswa sudah kenal dengan menunjukkan mereka bagaimana cara membuat dan membagikan level permainan yang dapat dimainkan."
see_an_example_project: "lihat contoh proyek"
get_started_today: "Mulailah sekarang!"
want_all_the_courses: "Ingin semua kursus? Minta informasi ke Lisensi Penuh kami."
compare_license_types: "Bandingkan Tipe Lisensi:"
cs: "Ilmu Komputer"
wd: "Mengembangkan Web"
wd1: "Mengembangkan Web 1"
gd: "Mengembangkan Permainan"
gd1: "Mengembangkan Permainan 1"
maximum_students: "Maksimum # Siswa"
unlimited: "Tak terbatas"
priority_support: "Bantuan prioritas"
yes: "Ya"
price_per_student: "__price__ persiswa"
pricing: "Harga"
free: "Gratis"
purchase: "Beli"
courses_prefix: "Kursus"
courses_suffix: ""
course_prefix: "Kursus"
course_suffix: ""
teachers_quote:
subtitle: "Pelajari lebih lanjut tentang CodeCombat dengan panduan interaktif tentang produk, harga, dan implementasi!"
email_exists: "User telah ada dengan email ini."
phone_number: "Nomor telepon"
phone_number_help: "Dimanakah kami dapat menjangkau kamu ketika hari bekerja?"
primary_role_label: "Peran Utama Kamu"
role_default: "Pilih Peran"
primary_role_default: "Pilih Peran Utama"
purchaser_role_default: "Pilih Peran Pembeli"
tech_coordinator: "Koordinator Teknologi"
advisor: "<NAME>/<NAME>"
principal: "Kepala Sekolah"
superintendent: "Pengawas"
parent: "Orang Tua"
purchaser_role_label: "Peran Pembeli Kamu"
influence_advocate: "Mempengaruhi/Menganjurkan"
evaluate_recommend: "Evaluasi/Rekomendasi"
approve_funds: "Menerima Dana"
no_purchaser_role: "Tidak ada peran dalam pemilihan pembelian"
district_label: "Wilayah"
district_name: "Nama Wilayah"
district_na: "Masukkan N/A jika tidak ada"
organization_label: "Sekolah"
school_name: "Nama Sekolah"
city: "Kota"
state: "Provinsi / Wilayah"
country: "Negara"
num_students_help: "Berapa banyak siswa yang akan menggunakan CodeCombat"
num_students_default: "Pilih Jumlah"
education_level_label: "Level Edukasi Siswa"
education_level_help: "Pilih sebanyak yang akan mendaftar."
elementary_school: "Sekolah Dasar"
high_school: "Sekolah Menengah Atas"
please_explain: "(Tolong Dijabarkan)"
middle_school: "Sekolah Menengah Pertama"
college_plus: "Mahasiswa atau lebih tinggi"
referrer: "Bagaimana kamu mengetahui mengenai kami?"
referrer_help: "Sebagai contoh: dari guru lain, dari konferensi, dari siswa anda, Code.org, dsb."
referrer_default: "Pilih Salah Satu"
referrer_conference: "Konferensi (misalnya ISTE)"
referrer_hoc: "Code.org/Hour of Code"
referrer_teacher: "Guru"
referrer_admin: "Administrator"
referrer_student: "Siswa"
referrer_pd: "Pelatihan profesional/workshops"
referrer_web: "Google"
referrer_other: "Lainnya"
anything_else: "Kelas yang seperti apa yang kamu perkirakan untuk menggunakan CodeCombat?"
anything_else_helper: ""
thanks_header: "Permintaan Diterima!"
thanks_sub_header: "Terima kasih telah menyatakan ketertarikan dalam CodeCombat untuk sekolahmu."
thanks_p: "Kamu akan menghubungi segera! Jika kamu membutuhkan kontak, kamu bisa menghubungi di:"
back_to_classes: "Kembali ke Kelas"
finish_signup: "Selesai membuat akun gurumu:"
finish_signup_p: "Membuat akun untuk mempersiapkan kelas, menambah siswamu, dan mengawasi perkembangan mereka selagi mereka belajar ilmu komputer."
signup_with: "Masuk dengan:"
connect_with: "Terhubung dengan:"
conversion_warning: "PERHATIAN: Akunmu saat ini adalah <em>Akun Siswa</em>. Setelah kamu mengirim form ini, akunmu akan diubah menjadi akun Guru"
learn_more_modal: "Akun guru di CodeCombat memiliki kemampuan untuk mengawasi perkembangan siswa, menetapkan lisensi, dan mengatur ruang kelas. Akun guru tidak dapat menjadi bagian dari kelas - Jika kamu saat ini mengikuti kelas menggunakan akun ini, maka kamu tidak dapat lagi mengaksesnya setelah kamu mengubahnya menjadi Akun Guru"
create_account: "Membuat Akun Guru"
create_account_subtitle: "Dapatkan akses peralatan hanya untuk guru jika menggunakan CodeCombat di ruang kelas. <strong>Mempersiapkan kelas</strong>, menambah siswamu, dan <strong>mengawasi perkembangan mereka</strong>!"
convert_account_title: "Ubah ke Akun Guru"
not: "Tidak"
full_name_required: "Diperlukan nama depan dan belakang"
versions:
save_version_title: "Simpan Versi Baru"
new_major_version: "Versi Mayor Baru"
submitting_patch: "Mengirim Perbaikan..."
cla_prefix: "Untuk menyimpan perubahan, pertama-tama kamu harus setuju dengan"
cla_url: "CLA"
cla_suffix: "."
cla_agree: "SAYA SETUJU"
owner_approve: "Pemilik akan menerimanya sebelum kamu perubahanmu akan terlihat"
contact:
contact_us: "<NAME>"
welcome: "Senang mendengar dari kamu! Gunakanlah form ini untuk mengirim kami email. "
forum_prefix: "Untuk segala sesuatu yang bersifat umum, silakan coba "
forum_page: "forum kami"
forum_suffix: "."
faq_prefix: "Selain itu, ada juga"
faq: "FAQ"
subscribe_prefix: "Jika kamu membutuhkan bantuan untuk mencari tau sebuah level, silakan"
subscribe: "beli langganan CodeCombat"
subscribe_suffix: "dan kamu akan dengan senang membantu kamu dengan kodemu."
subscriber_support: "Karena kamu adalah seorang pelanggan CodeCombat, emailmu akan menerima dukungan prioritas dari kami."
screenshot_included: "Tangkapan layar termasuk."
where_reply: "Dimanakah kamu harus membalas?"
send: "Kirim Umpan Balik"
account_settings:
title: "Pengaturan Akun"
not_logged_in: "Masuk atau buat akun untuk mengganti pengaturanmu."
me_tab: "Saya"
picture_tab: "Gambar"
delete_account_tab: "Hapus Akunmu"
wrong_email: "Email Salah"
wrong_password: "<PASSWORD>ata Kunci Salah"
delete_this_account: "Hapus akun ini permanen"
reset_progress_tab: "Ulang Semua Perkembangan"
reset_your_progress: "Hapus semua perkembanganmu dan memulai lagi dari awal"
god_mode: "Mode Dewa"
emails_tab: "Email"
admin: "Admin"
manage_subscription: "Klik di sini untuk mengatur langganganmu."
new_password: "<PASSWORD>"
new_password_verify: "<PASSWORD>"
type_in_email: "Ketik dalam email atau nama penggunamu untuk memastikan penghapusan akun."
type_in_email_progress: "Tulis di emailmu untuk memastikan penghapusan kemajuan kamu."
type_in_password: "Dan juga ketik kata kuncimu"
email_subscriptions: "Langganan Email"
email_subscriptions_none: "Tidak ada Langganan Email."
email_announcements: "Pengumuman"
email_announcements_description: "Dapatkan email untuk berita terakhir dan pengembangan dari CodeCombat"
email_notifications: "Pemberitahuan"
email_notifications_summary: "Atur untuk pengaturan pribadi, email pemberitahuan otomatis terkait dengan aktivitas CodeCombatmu."
email_any_notes: "Semua Pemberitahuan"
email_any_notes_description: "Nonaktifkan untuk berhenti semua aktivitas pemberitahuan email"
email_news: "Berita"
email_recruit_notes: "Lowongan Pekerjaan"
email_recruit_notes_description: "Jika kamu bermain dengan baik, kami akan memberitahumu mengenai lowongan (yang lebih baik) pekerjaan."
contributor_emails: "Email Kontributor Kelas"
contribute_prefix: "Kami mencari orang-orang untuk bergabung dengan tim kami. Cek "
contribute_page: "halaman kontribusi"
contribute_suffix: " untuk mengetahui lebih lanjut."
email_toggle: "Ubah Alih Semuanya"
error_saving: "Gagal Menyimpan"
saved: "Perubahan Disimpan"
password_mismatch: "Kata sandi tidak sama."
password_repeat: "<PASSWORD>."
keyboard_shortcuts:
keyboard_shortcuts: "Tombol Pintas Keyboard"
space: "Spasi"
enter: "Enter"
press_enter: "tekan enter"
escape: "Escape"
shift: "Shift"
run_code: "Jalankan kode saat ini."
run_real_time: "Jalankan dalam waktu nyata."
continue_script: "Melanjutkan melewati skrip saat ini."
skip_scripts: "Lewati semua skrip yang dapat dilewati."
toggle_playback: "Beralih mulai/berhenti."
scrub_playback: "Menggeser mundur dan maju melewati waktu."
single_scrub_playback: "Menggeser mundur dan maju melewati waktu dalam sebuah frame."
scrub_execution: "Menggeser melalui eksekusi mantera saat ini"
toggle_debug: "Beralih tampilan debug."
toggle_grid: "Beralih lembaran kotak-kotak."
toggle_pathfinding: "Beralih lembaran mencari jalan."
beautify: "Percantik kodemu dengan menstandarisasi formatnya."
maximize_editor: "Memaksimalkan/meminimalisasi editor kode."
cinematic:
click_anywhere_continue: "klik di mana saja untuk melanjutkan"
community:
main_title: "Komunitas CodeCombat"
introduction: "Cek cara kamu dapat terlibat di bawah ini dan putuskan apa yang terdengar paling menyenangkan. Kami berharap dapat bekerja dengan kamu!"
level_editor_prefix: "Gunakan CodeCombat"
level_editor_suffix: "untuk membuat dan mengubah level. Pengguna dapat membuat level untuk kelas mereka, teman, hackathons, para siswa, dan saudara. Jika membuat sebuah level baru terdengar mengintimidasi, kamu bisa memulainya dengan membuat cabang salah satu dari milik kami!"
thang_editor_prefix: "Kami memanggil unit dalam game 'thangs'. Gunakan"
thang_editor_suffix: "untuk memodifikasi CodeCombat sumber karya seni. Perbolehkan unit untuk melempar proyektil, mengubah arah dari animasi, mengganti hit point unit, atau mengunggah vektor sprite milikmu."
article_editor_prefix: "Melihat ada kesalahan dalam dokumentasi kami? Ingin membuat beberapa instruksi untuk karakter buatanmu? Lihat"
article_editor_suffix: "dan bantu pemain CodeCombat untuk mendapatkan hasil maksimal dari waktu bermain mereka."
find_us: "Temukan kami di situs-situs berikut"
social_github: "Lihat semua kode kami di Github"
social_blog: "Baca blog CodeCombat"
social_discource: "Bergabung dalam diskusi di forum Discourse kami"
social_facebook: "Like CodeCombat di Facebook"
social_twitter: "Follow CodeCombat di Twitter"
social_slack: "Mengobrol bersama kami di channel publik Slack CodeCombat"
contribute_to_the_project: "Berkontribusi pada proyek"
clans:
title: "Bergabung dengan Klan CodeCombat - Belajar Membuat Kode dengan Python, JavaScript, dan HTML"
clan_title: "__clan__ - Bergabung dengan Klan CodeCombat dan Belajar Membuat Kode"
meta_description: "Bergabunglah dengan Klan atau bangun komunitas pembuat kode Anda sendiri. Mainkan level arena multipemain dan tingkatkan pahlawan serta keterampilan pengkodean Anda."
clan: "Klan"
clans: "Klan"
new_name: "Nama baru klan"
new_description: "Deskripsi baru klan"
make_private: "Buat klan menjadi privat"
subs_only: "hanya pelanggan"
create_clan: "Buat klan baru"
private_preview: "Tinjau"
private_clans: "Klan Privat"
public_clans: "Klan Publik"
my_clans: "Klan Saya"
clan_name: "Nama Klan"
name: "Nama"
chieftain: "Kepala Suku"
edit_clan_name: "Ubah Nama Klan"
edit_clan_description: "Ubah Deskripsi Klan"
edit_name: "ubah nama"
edit_description: "ubah deskripsi"
private: "(privat)"
summary: "Rangkuman"
average_level: "Level Rata-rata"
average_achievements: "Prestasi Rata-rata"
delete_clan: "Hapus Klan"
leave_clan: "Tinggalkan Klan"
join_clan: "Gabung Klan"
invite_1: "Undang:"
invite_2: "*Undang pemain untuk klan ini dengan mengirimkan mereka tautan."
members: "<NAME>"
progress: "Perkembangan"
not_started_1: "belum mulai"
started_1: "mulai"
complete_1: "selesai"
exp_levels: "Perluas level"
rem_hero: "Melepaskan Hero"
status: "Status"
complete_2: "Lengkapi"
started_2: "Dimulai"
not_started_2: "Belum Dimulai"
view_solution: "Klik untuk melihat solusi."
view_attempt: "Klik untuk melihat percobaan."
latest_achievement: "Prestasi Terakhir"
playtime: "Waktu bermain"
last_played: "Yang terakhir dimainkan"
leagues_explanation: "Bermain dalam liga melawan anggota klan lain di instansi arena multipemain."
track_concepts1: "Mengikuti konsep"
track_concepts2a: "dipelajari oleh setiap siswa"
track_concepts2b: "dipelajari oleh setiap anggota"
track_concepts3a: "Mengikuti level yang sudah selesai untuk setiap siswa"
track_concepts3b: "Mengikuti level yang sudah selesai untuk setiap anggota"
track_concepts4a: "Lihat siswa kamu'"
track_concepts4b: "Lihat anggota kamu'"
track_concepts5: "solusi"
track_concepts6a: "Urutkan siswa berdasarkan nama atau perkembangan"
track_concepts6b: "Urutkan anggota berdasarkan nama atau perkembangan"
track_concepts7: "Membutuhkan undangan"
track_concepts8: "untuk bergabung"
private_require_sub: "Klan privat membutuhkan langganan untuk membuat atau bergabung."
courses:
create_new_class: "Buat Kelas Baru"
hoc_blurb1: "Coba"
hoc_blurb2: "Kode, Mainkan, Bagikan"
hoc_blurb3: "aktivitas! Buat empat game mini yang berbeda untuk mempelajari dasar-dasar pengembangan game, lalu buat sendiri!"
solutions_require_licenses: "Solusi level akan tersedia bagi guru yang memiliki lisensi"
unnamed_class: "Kelas Tanpa Nama"
edit_settings1: "Ubah Pengaturan Kelas"
add_students: "Tambah Siswa"
stats: "Statistik"
student_email_invite_blurb: "Siswa-siswa anda juga bisa menggunakan kode kelas <strong>__classCode__</strong> ketika membuat Akun Siswa, tanpa membutuhkan email."
total_students: "Jumlah siswa:"
average_time: "Rata-rata waktu bermain level:"
total_time: "Total waktu bermain:"
average_levels: "Rata-rata level yang terselesaikan:"
total_levels: "Total level yang terselesaikan:"
students: "Siswa-siswa"
concepts: "Konsep-konsep"
play_time: "Waktu bermain:"
completed: "Terselesaikan:"
enter_emails: "Pisahkan tiap alamat email dengan jeda baris ataupun koma"
send_invites: "Undang Siswa"
number_programming_students: "Jumlah Siswa Programming"
number_total_students: "Jumlah Siswa di Sekolah/Wilayah"
enroll: "Daftar"
enroll_paid: "Daftarkan Siswa di Kursus Berbayar"
get_enrollments: "Dapatkan Lisensi Lebih"
change_language: "Mengganti Bahasa"
keep_using: "Tetap Menggunakan"
switch_to: "Mengganti Menjadi"
greetings: "Hai!"
back_classrooms: "Kembali ke ruang kelasku"
back_classroom: "Kembali ke ruang kelas"
back_courses: "Kembali ke kursusku"
edit_details: "Ubah detail kelas"
purchase_enrollments: "Membeli Lisensi Siswa"
remove_student: "hapus siswa"
assign: "Daftarkan"
to_assign: "daftarkan kursus berbayar."
student: "<NAME>"
teacher: "<NAME>"
arena: "Arena"
available_levels: "Level yang Tersedia"
started: "dimulai"
complete: "selesai"
practice: "latihan"
required: "wajib"
welcome_to_courses: "Para petualang, selamat datang di Kursus!" # {change}
ready_to_play: "Siap untuk bermain?"
start_new_game: "Memulai Permainan Baru"
play_now_learn_header: "Bermain sekarang untuk belajar"
play_now_learn_1: "sintaks dasar untuk mengontrol karaktermu"
play_now_learn_2: "perulangan untuk memecahkan puzzle yang menganggu"
play_now_learn_3: "strings & variabel-variabel untuk mengatur tindakan-tindakan"
play_now_learn_4: "bagaimana cara mengalahkan raksasa (keahlian hidup yang penting!)"
my_classes: "Kelas Saat Ini"
class_added: "Kelas berhasil ditambahkan!"
view_map: "lihap peta"
view_videos: "lihat video"
view_project_gallery: "lihat proyek teman kelasku"
join_class: "Bergabung Ke Kelas"
join_class_2: "Ikut Kelas"
ask_teacher_for_code: "Tanya ke gurumu jika kamu memiliki kode kelas CodeCombat! Jika iya, masukkan kode di:"
enter_c_code: "<Masukkan Kode Kelas>"
join: "Bergabung"
joining: "Ikuti kelas"
course_complete: "Kursus Selesai"
play_arena: "Arena Bermain"
view_project: "Lihat Proyek"
start: "Mulai"
last_level: "Level terakhir yang dimainkan"
not_you: "Bukan Kamu?"
continue_playing: "Lanjutkan Bermain"
option1_header: "Undang Siswa Melalui Email"
remove_student1: "<NAME>"
are_you_sure: "Apakah anda yakin ingin menghapus siswa ini dari kelas ini?"
remove_description1: "Siswa akan kehilangan akses untuk kelas ini dan kelas yang diikuti. Perkembangan dan gameplay TIDAK hilang, dan siswa dapat dimasukkan kembali ke kelas kapanpun"
remove_description2: "Lisensi berbayar yang telah aktif tidak dapat dikembalikan."
license_will_revoke: "Lisensi berbayar siswa ini akan dicabut dan menjadi tersedia untuk diberikan ke siswa lain."
keep_student: "Simpan Siswa"
removing_user: "Menghapus siswa"
subtitle: "Mengulas ikhtisar kursus dan level" # Flat style redesign
select_language: "Pilih bahasa"
select_level: "Pilih level"
play_level: "Mainkan Level"
concepts_covered: "Konsep tercakup"
view_guide_online: "Level Ikhtisar dan Solusi"
# lesson_slides: "Lesson Slides"
grants_lifetime_access: "Berikan akses ke semua Kursus."
enrollment_credits_available: "Lisensi Tersedia:"
language_select: "Pilih bahasa" # ClassroomSettingsModal
language_cannot_change: "Bahasa tidak dapat diganti setelah siswa bergabung ke kelas."
avg_student_exp_label: "Pengalaman Pemrograman Rata-rata Siswa"
avg_student_exp_desc: "Ini akan membantu kita mengerti bagaimana cara menjalankan kursus lebih baik."
avg_student_exp_select: "Pilih opsi terbaik"
avg_student_exp_none: "Belum Berpengalaman - sedikit atau belum berpengalaman"
avg_student_exp_beginner: "Pemula - memiliki beberapa pemaparan atau basis-blok"
avg_student_exp_intermediate: "Menengah - ada pengalaman dengan mengetik kode"
avg_student_exp_advanced: "Lanjutan - pengalaman luas dengan mengetik kode"
avg_student_exp_varied: "Level Variasi Pengalaman"
student_age_range_label: "Jarak Usia Siswa"
student_age_range_younger: "Lebih muda dari 6"
student_age_range_older: "Lebih tua dari 18"
student_age_range_to: "sampai"
estimated_class_dates_label: "Perkiraan Tanggal Kelas"
estimated_class_frequency_label: "Estimasi Frekuensi Kelas"
classes_per_week: "kelas per minggu"
minutes_per_class: "menit per kelas"
create_class: "Buat Kelas"
class_name: "Nama Kelas"
teacher_account_restricted: "Akun kamu adalah akun guru dan tidak dapat mengakses konten siswa."
account_restricted: "Akun siswa diperlukan untuk mengakses halaman ini."
update_account_login_title: "Masuk atau perbaharui akunmu"
update_account_title: "Akunmu membutuhkan perhatian!"
update_account_blurb: "Sebelum kamu dapat mengakses kelasmu, pilihlah bagaimana kamu ingin menggunakan akun ini."
update_account_current_type: "Tipe Akun Saat Ini:"
update_account_account_email: "Akun Email/Username:"
update_account_am_teacher: "Saya adalah seorang guru"
update_account_keep_access: "Pertahankan akses ke kelas yang saya buat"
update_account_teachers_can: "Akun guru dapat:"
update_account_teachers_can1: "Membuat/mengatur/menambah kelas"
update_account_teachers_can2: "Tentukan/daftarkan siswa dalam kursus"
update_account_teachers_can3: "Membuka semua level kursus untuk mencoba"
update_account_teachers_can4: "Akses fitur terbaru hanya untuk guru ketika kita mengeluarkan fitur tersebut"
update_account_teachers_warning: "Perhatian: Kamu akan dihapus dari semua kelas yang kamu telah ikuti sebelumnya dan tidak akan dapat bermain kembali sebagai siswa."
update_account_remain_teacher: "Tetap Sebagai Guru"
update_account_update_teacher: "Perbaharui Sebagai Guru"
update_account_am_student: "Saya adalah seorang siswa"
update_account_remove_access: "Hapus akses ke kelas yang telah saya buat"
update_account_students_can: "Akun siswa dapat:"
update_account_students_can1: "Bergabung ke kelas"
update_account_students_can2: "Bermain melalui kursus sebagai siswa dan merekam proses milikmu"
update_account_students_can3: "Bersaing dengan teman kelas di arena"
update_account_students_can4: "Mengakses fitur baru hanya untuk siswa selagi kita mengeluarkan fitur tersebut"
update_account_students_warning: "Perhatian: Kamu tidak dapat mengatur kelas manapun yang telah kamu buat sebelumnya ataupun membuat kelas baru."
unsubscribe_warning: "Perhatian: Kamu akan berhenti berlangganan dari langganan bulananmu."
update_account_remain_student: "Tetap sebagai Siswa"
update_account_update_student: "Perbaharui sebagai Siswa"
need_a_class_code: "Kamu akan membutuhkan Kode Kelas untuk kelas yang kamu ikuti:"
update_account_not_sure: "Tidak yakin yang mana yang dipilih? Email"
update_account_confirm_update_student: "Apakah kamu yakin ingin memperbaharui akunmu menjadi sebuah pengalaman Siswa?"
update_account_confirm_update_student2: "Kamu akan tidak dapat mengatur kelas manapun yang kamu buat sebelumnya atau membuat kelas baru. Kelas yang terbuat sebelumnya olehmu akan dihapus dari CodeCombat dan tidak dapat dikembalikan."
instructor: "Peng<NAME>: "
youve_been_invited_1: "Kamu telah diundang untuk bergabung "
youve_been_invited_2: ", dimana kamu akan belajar "
youve_been_invited_3: " dengan teman kelasmu di CodeCombat."
by_joining_1: "Dengan bergabung "
by_joining_2: "akan dapat membantu mengulang kata kunci kamu jika kamu lupa atau menghilangkannya. Kamu juga dapat melakukan verifikasi emailmu sehingga kamu dapat mengulang kata kuncimu sendiri!"
sent_verification: "Kami telah mengirim verifikasi email ke:"
you_can_edit: "Kamu dapat mengganti alamat emailmu di "
account_settings: "Pengaturan Akun"
select_your_hero: "Pilih Jagoan Kamu"
select_your_hero_description: "Kamu dapat selalu mengganti jagoanmu dengan pergi ke halaman Kursus dan memilih \"Ganti Jagoan\""
select_this_hero: "Pilih Jagoan Ini"
current_hero: "Jagoan Saat Ini:"
current_hero_female: "Jagoan Saat Ini:"
web_dev_language_transition: "Semua kelas program dalam HTML / JavaScript untuk kursus ini. Kelas yang telah menggunakan Python akan mulai dengan level pengenalan extra JavaScript untuk mempermudah transisi. Kelas yang telah menggunakan JavaScript akan melewati level pengenalan."
course_membership_required_to_play: "Kamu butuh bergabung dengan sebuah kursus untuk memainkan level ini."
license_required_to_play: "Tanyakan gurumu untuk memberikan lisensi ke kamu supaya kamu dapat melanjutkan bermain CodeCombat!"
update_old_classroom: "Tahun ajaran baru, level baru!"
update_old_classroom_detail: "Untuk memastikan kamu mendapatkan level paling baru, pastikan kamu membuat kelas baru untuk semester ini dengan menekan Buat Kelas Baru di "
teacher_dashboard: "beranda guru"
update_old_classroom_detail_2: "dan berikan siswa-siswa Kelas Kode yang baru muncul"
view_assessments: "Lihat Penilaian"
view_challenges: "lihat level tantangan"
challenge: "Tantangan:"
challenge_level: "Level Tantangan:"
status: "Status:"
assessments: "Penilaian"
challenges: "Tantangan"
level_name: "Nama Level:"
keep_trying: "Terus Mencoba"
start_challenge: "Memulai Tantangan"
locked: "Terkunci"
concepts_used: "Konsep yang Digunakan:"
show_change_log: "Tunjukkan perubahan pada level kursus ini"
hide_change_log: "Sembunyikan perubahan pada level kursus ini"
concept_videos: "Video Konsep"
concept: "Konsep:"
basic_syntax: "Sintaks Dasar"
while_loops: "While Loops"
variables: "Variabel"
basic_syntax_desc: "Sintaks adalah cara kita menulis kode. Sama seperti ejaan dan tata bahasa penting dalam menulis narasi dan esai, sintaksis penting saat menulis kode. Manusia pandai memahami arti sesuatu, meskipun tidak sepenuhnya benar, tetapi komputer tidak sepintar itu, dan mereka membutuhkan Anda untuk menulis dengan sangat tepat. "
while_loops_desc: "Perulangan adalah cara mengulangi tindakan dalam program. Anda dapat menggunakannya sehingga Anda tidak perlu terus menulis kode berulang, dan jika Anda tidak tahu persis berapa kali suatu tindakan perlu terjadi menyelesaikan tugas. "
variables_desc: "Bekerja dengan variabel seperti mengatur berbagai hal dalam kotak sepatu. Anda memberi nama kotak sepatu, seperti \"Perlengkapan Sekolah\", lalu Anda memasukkannya ke dalamnya. Isi sebenarnya dari kotak dapat berubah seiring waktu, tetapi apa pun yang ada di dalamnya akan selalu disebut \"Perlengkapan Sekolah\". Dalam pemrograman, variabel adalah simbol yang digunakan untuk menyimpan data yang akan berubah selama program berlangsung. Variabel dapat menampung berbagai jenis data, termasuk angka dan string. "
locked_videos_desc: "Terus mainkan game untuk membuka kunci video konsep __concept_name__."
unlocked_videos_desc: "Tinjau video konsep __concept_name__."
video_shown_before: "ditampilkan sebelum __level__"
link_google_classroom: "Tautkan Google Kelas"
select_your_classroom: "Pilih Kelas Anda"
no_classrooms_found: "Tidak ditemukan ruang kelas"
create_classroom_manually: "Buat kelas secara manual"
classes: "Kelas"
certificate_btn_print: "Cetak"
certificate_btn_toggle: "Alihkan"
ask_next_course: "Ingin bermain lebih banyak? Minta akses guru Anda ke kursus berikutnya."
set_start_locked_level: "Kunci level dimulai dari"
no_level_limit: "- (tidak ada level yang dikunci)"
# ask_teacher_to_unlock: "Ask Teacher To Unlock"
# ask_teacher_to_unlock_instructions: "To play the next level, ask your teacher to unlock it on their Course Progress screen"
# play_next_level: "Play Next Level"
# play_tournament: "Play Tournament"
# levels_completed: "Levels Completed: __count__"
# ai_league_team_rankings: "AI League Team Rankings"
# view_standings: "View Standings"
# view_winners: "View Winners"
# classroom_announcement: "Classroom Announcement"
project_gallery:
no_projects_published: "Jadilah yang pertama mempublikasi proyek di kursus ini!"
view_project: "Lihat Proyek"
edit_project: "Ubah Project"
teacher:
assigning_course: "Menetapkan kursus"
back_to_top: "Kembali ke Atas"
click_student_code: "Klik di level manapun yang siswa telah mulai atau selesaikan dibawah ini untuk melihat kode yang mereka tulis."
code: "Kode __name__'"
complete_solution: "Solusi Lengkap"
course_not_started: "Siswa belum memulai kursus ini."
hoc_happy_ed_week: "Selamat Minggu Pendidikan Ilmu Komputer!"
hoc_blurb1: "Pelajari tentang yang gratis"
hoc_blurb2: "Kode, Mainkan, Bagikan"
hoc_blurb3: "aktivitas, unduh rencana pelajaran guru baru, dan beri tahu siswa Anda untuk masuk untuk bermain!"
hoc_button_text: "Lihat Aktivitas"
no_code_yet: "Siswa belum menulis kode apapun di level ini."
open_ended_level: "Level Akhir-Terbuka"
partial_solution: "Solusi Sebagian"
capstone_solution: "Solusi Capstone"
removing_course: "Menghapus kursus"
solution_arena_blurb: "Para siswa didorong untuk memecahkan level arena secara kreatif. Solusi yang tersedia di bawah memenuhi persyaratan level arena."
solution_challenge_blurb: "Para siswa didorong untuk memecahkan tantangan level akhir-terbuka secara kreatif. Salah satu solusi kemungkinan ditampilkan di bawah."
solution_project_blurb: "Para siswa didorong untuk membangun proyek kreatif di level ini. Solusi yang tersedia di bawah memenuhi persyaratan level proyek."
students_code_blurb: "Solusi yang benar untuk setiap level tersedia jika perlu. Dalam beberapa kasus, memungkinkan jika siswa memecahkan level dengan kode yang berbeda. Solusi tidak ditampilkan untuk level di mana siswa belum memulainya."
course_solution: "Solusi Kursus"
level_overview_solutions: "Ikhtisar Level dan Solusi"
no_student_assigned: "Tidak ada siswa yang ditetapkan di kursus ini."
paren_new: "(baru)"
student_code: "Kode Siswa __name__"
teacher_dashboard: "Beranda Guru" # Navbar
my_classes: "Kelasku"
courses: "Panduan Kursus"
enrollments: "Lisensi Siswa"
resources: "Sumber Daya"
help: "Bantuan"
language: "Bahasa"
edit_class_settings: "ubah setingan kelas"
access_restricted: "Wajib Perbaharui Akun"
teacher_account_required: "akun guru dibutuhkan untuk mengakses konten ini."
create_teacher_account: "Buat Akun Guru"
what_is_a_teacher_account: "Apakah Akun Guru?"
teacher_account_explanation: "Akun Guru CodeCombat memungkinkan kamu mmempersiapkan ruang kelas, memonitor perkembangan siswa selagi mereka mengerjakan kursus, mengatur lisensi dan mengakses sumber daya untuk membantu membangun kurikulummu."
current_classes: "Kelas Saat Ini"
archived_classes: "Kelas yang Diarsipkan"
# shared_classes: "Shared Classes"
archived_classes_blurb: "Kelas dapat diarsip untuk referensi kedepan. Membuka arsip kelas untuk melihatnya di daftar Kelas Saat Ini."
view_class: "lihat kelas"
# view_ai_league_team: "View AI League team"
archive_class: "arsip kelas"
unarchive_class: "buka arsip kelas"
unarchive_this_class: "Buka arsip kelas ini"
no_students_yet: "Kelas ini belum memiliki siswa."
no_students_yet_view_class: "Lihat kelas untuk menambahkan siswa."
try_refreshing: "(Kamu mungkin harus membuka ulang page ini)"
create_new_class: "Buat Kelas Baru"
class_overview: "Ikhtisar Kelas" # View Class page
avg_playtime: "Rata-rata waktu bermain level"
total_playtime: "Total waktu bermain"
avg_completed: "Rata-rata level yang terselesaikan"
total_completed: "Total level yang terselesaikan"
created: "Dibuat"
concepts_covered: "Pencakupan konsep"
earliest_incomplete: "Level awal yang belum selesai"
latest_complete: "Level akhir yang terselesaikan"
enroll_student: "<NAME> <NAME>"
apply_license: "Gunakan Lisensi"
revoke_license: "Cabut Lisensi"
revoke_licenses: "Cabut Semua Lisensi"
course_progress: "Perkembangan Kursus"
not_applicable: "Tidak Tersedia"
edit: "ubah"
edit_2: "Ubah"
remove: "hapus"
latest_completed: "Terakhir terselesaikan:"
sort_by: "Urutkan berdasar"
progress: "Perkembangan"
concepts_used: "Konsep digunakan oleh Siswa:"
concept_checked: "Konsep diperiksa:"
completed: "Selesai"
practice: "Latihan"
started: "Mulai"
no_progress: "Belum ada perkembangan"
not_required: "Tidak wajib"
view_student_code: "Klik untuk melihat kode siswa"
select_course: "Pilih kursus untuk melihat"
progress_color_key: "Warna kunci perkembangan:"
level_in_progress: "Perkembangan di Level"
level_not_started: "Level Belum Dimulai"
project_or_arena: "Proyek atau Arena"
students_not_assigned: "Siswa yang belum ditetapkan {{courseName}}"
course_overview: "Ikhtisar Kursus"
copy_class_code: "Salin Kode Kelas"
class_code_blurb: "Para Siswa dapat bergabung di kelas kamu menggunakan Kode Kelas. Tidak membutuhkan alamat email ketika membuat akun siswa dengan Kode Kelas ini."
copy_class_url: "Salin URL Kelas"
class_join_url_blurb: "Kamu juga dapat mengirim URL Kelas unik ini ke halaman web bersama."
add_students_manually: "Undang Siswa dengan Email"
bulk_assign: "Pilih kursus"
assigned_msg_1: "{{numberAssigned}} siswa di ditetapkan {{courseName}}."
assigned_msg_2: "{{numberEnrolled}} lisensi dipakai."
assigned_msg_3: "Kamu sekarang memiliki {{remainingSpots}} sisa lisensi yang tersedia."
assign_course: "Daftarkan Kursus"
removed_course_msg: "{{numberRemoved}} siswa telah dihapus dari {{courseName}}."
remove_course: "Hapus Kursus"
not_assigned_msg_1: "Tidak dapat menambahkan pengguna ke contoh kursus sampai mereka ditambahkan ke prabayar yang mencakup kursus ini"
not_assigned_modal_title: "Kursus belum ditetapkan"
not_assigned_modal_starter_body_1: "Kursus ini membutuhkan Lisensi Awal. Kamu tidak memiliki cukup Lisensi Awal yang tersedia untuk menetapkan kursus ini ke semua __selected__ siswa terpilih."
not_assigned_modal_starter_body_2: "Beli Lisensi Awal untuk berikan akses ke kursus ini"
not_assigned_modal_full_body_1: "Kursus ini membutuhkan Lisensi Penuh. Kamu tidak memiliki cukup Lisensi Penuh yang tersedia untuk menetapkan kursus ke semua __selected__ siswa terpilih."
not_assigned_modal_full_body_2: "Kamu hanya memiliki __numFullLicensesAvailable__ Lisensi Penuh yang tersedia (__numStudentsWithoutFullLicenses__ siswa saat ini tidak memiliki Lisensi Penuh yang aktif)."
not_assigned_modal_full_body_3: "Silakan memilih siswa yang lebih sedikit, atau jangkau ke __supportEmail__ untuk bantuan."
assigned: "Tetapkan"
enroll_selected_students: "<NAME> <NAME>"
no_students_selected: "Tidak ada siswa yang terpilih."
show_students_from: "Tampilkan siswa dari" # Enroll students modal
apply_licenses_to_the_following_students: "Gunakan Lisensi untuk Siswa Berikut"
select_license_type: "Pilih Jenis Lisensi untuk Diterapkan"
students_have_licenses: "Siswa berikut telah memiliki lisensi:"
all_students: "Semua Siswa"
apply_licenses: "Pakai Lisensi"
not_enough_enrollments: "Lisensi yang tersedia tidak cukup."
enrollments_blurb: "Para siswa diwajibkan untuk memiliki lisensi untuk mengakses konton manapun setelah kursus pertama."
how_to_apply_licenses: "Bagaimana cara Menggunakan Lisensi"
export_student_progress: "Ekspor Perkembangan Siswa (CSV)"
send_email_to: "Kirim Pemulihan Kata Kunci ke Email:"
email_sent: "Email terkirim"
send_recovery_email: "Kirim pemulihan email"
enter_new_password_below: "Masukkan kata kunci baru di bawah:"
change_password: "<PASSWORD>"
changed: "Terganti"
available_credits: "Lisensi Tersedia"
pending_credits: "Lisensi Tertunda"
empty_credits: "Lisensi Habis"
license_remaining: "lisensi yang tersisa"
licenses_remaining: "lisensi yang tersisa"
student_enrollment_history: "Riwayat Pendaftaran Siswa"
enrollment_explanation_1: "The"
enrollment_explanation_2: "Riwayat Pendaftaran Siswa"
enrollment_explanation_3: "menampilkan jumlah total siswa unik yang terdaftar di semua guru dan ruang kelas yang ditambahkan ke dasbor Anda. Ini termasuk siswa di ruang kelas yang diarsipkan dan yang tidak diarsipkan dengan tanggal pembuatan kelas antara tanggal 1- Juli 30 setiap tahun sekolah masing-masing. "
enrollment_explanation_4: "Ingat"
enrollment_explanation_5: "kelas dapat diarsipkan dan lisensi dapat digunakan kembali sepanjang tahun ajaran, jadi tampilan ini memungkinkan administrator untuk memahami berapa banyak siswa yang benar-benar berpartisipasi dalam program secara keseluruhan."
one_license_used: "1 dari __totalLicenses__ lisensi telah digunakan"
num_licenses_used: "__numLicensesUsed__ dari __totalLicenses__ lisensi telah digunakan"
starter_licenses: "lisensi awal"
start_date: "tanggal mulai:"
end_date: "tanggal berakhir:"
get_enrollments_blurb: " Kami membantu anda membangun solusi yang memenuhi kebutuhan kelas, sekolah, ataupun wilayah kamu."
# see_also_our: "See also our"
# for_more_funding_resources: "for how to leverage CARES Act funding sources like ESSER and GEER."
how_to_apply_licenses_blurb_1: "Ketika guru menetapkan kursus untuk siswa untuk pertamakali, kami secara otomatis menggunakan lisensi. Gunakan penetapan-masal tarik-turun di ruang kelasmu untuk menetapkan kursus untuk siswa yang terpilih:"
how_to_apply_licenses_blurb_2: "Dapatkan saya menggunakan lisensi tanpa menetapkan ke sebuah kursus?"
how_to_apply_licenses_blurb_3: "Ya - pergi ke label Status Lisensi di ruang kelasmu dan klik \"Pakai Lisensi\" ke siswa manapun yang tidak memiliki lisensi aktif."
request_sent: "Permintaan Dikirim!"
assessments: "Penilaian"
license_status: "Status Lisensi"
status_expired: "Kadaluarsa pada {{date}}"
status_not_enrolled: "Belum Terdaftar"
status_enrolled: "Kadaluarsa pada {{date}}"
select_all: "Pilih Semua"
project: "Proyek"
project_gallery: "Galeri Proyek"
view_project: "Lihat Proyek"
unpublished: "(belum terpublikasi)"
view_arena_ladder: "Lihat Tangga Arena"
resource_hub: "Pusat Sumber Daya"
pacing_guides: "Panduang Berulang Ruang-Kelas-di-Dalam-Kotak"
pacing_guides_desc: "Belajar bagaimana menggabungkan semua sumber daya CodeCombat untuk merancang tahun sekolahmu!"
pacing_guides_elem: "Panduang Berulang Sekolah Dasar"
pacing_guides_middle: "Panduan Berulang Sekolah Menengah Pertama"
pacing_guides_high: "Panduang Berulang Sekolah Menengah Atas"
getting_started: "Memulai"
educator_faq: "FAQ Pengajar"
educator_faq_desc: "Pertanyaan yang paling sering diajukan mengenai menggunakan CodeCombat di kelas atau di sekolahmu."
teacher_getting_started: "Panduan Guru untuk Memulai"
teacher_getting_started_desc: "Baru di CodeCombat? Unduh Panduan Guru untuk Memulai ini untuk mempersiapkan akunmu, membuat kelas pertamamu, dan mengundang siswa untuk kursus pertama."
student_getting_started: "Panduan Memulai Cepat Siswa"
student_getting_started_desc: "Kamu dapat membagikan panduan ini kepada siswamu sebelum memulai CodeCombat supaya mereka dapat membiasakan diri mereka dengan editor kode. Panduan ini dapat digunakan baik untuk kelas Python dan JavaScript."
standardized_curricula: "Kurikulum Standar"
ap_cs_principles: "Kepala Sekolah Ilmu Komputer AP"
ap_cs_principles_desc: "Kepala Sekolah Ilmu Komputer AP memberikan siswa pengenalan luas mengenai kekuatan, pengaruh, dan kemungkinan dalam Ilmu Komputer. Kursus menekankan pemikiran komputasional dan pemecahan masalah sambil mengajar dasar pemrograman."
cs1: "Pengenalan Ilmu Komputer"
cs2: "Ilmu Komputer 2"
cs3: "Ilmu Komputer 3"
cs4: "Ilmu Komputer 4"
cs5: "Ilmu Komputer 5"
cs1_syntax_python: "Kursus 1 Panduan Sintaks Python"
cs1_syntax_python_desc: "Contekan dengan referensi sintaks Python yang umum dimana siswa akan belajar di Pengenalan Ilmu Komputer."
cs1_syntax_javascript: "Kursus 1 Panduan Sintaks JavaScript"
cs1_syntax_javascript_desc: "Contekan dengan referensi sintaks JavaScript yang umum dimana siswa akan belajar di Pengenalan Ilmu Komputer."
coming_soon: "Panduan tambahan segera akan datang!"
engineering_cycle_worksheet: "Lembar Kerja Siklus Teknis"
engineering_cycle_worksheet_desc: "Gunakan lembar kerja ini untuk mengajar para siswa dasar dari siklus teknis: menilai, mendesain, mengimplementasi, dan mendebug. Lihat lembar kerja yang selesai sebagai panduan."
engineering_cycle_worksheet_link: "Lihat contoh"
progress_journal: "Jurnal Perkembangan"
progress_journal_desc: "Mendorong siswa untuk mengikuti terus perkembangan mereka via jurnal perkembangan."
cs1_curriculum: "Pengenalan Ilmu Komputer - Panduan Kurikulum"
cs1_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 1."
arenas_curriculum: "Level Arena - Panduan Guru"
arenas_curriculum_desc: "Instruksi untuk menjalankan Wakka Maul, Cross Bones, dan Power Peak multiplayer arena dengan kelasmu."
assessments_curriculum: "Tingkat Penilaian - Panduan Guru"
assessments_curriculum_desc: "Pelajari cara menggunakan Level Tantangan dan level Tantangan Kombo untuk menilai hasil belajar siswa."
cs2_curriculum: "Ilmu Komputer 2 - Panduan Kurikulum"
cs2_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 2"
cs3_curriculum: "Ilmu Komputer 3 - Panduan Kurikulum"
cs3_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 3"
cs4_curriculum: "Ilmu Komputer 4 - Panduan Kurikulum"
cs4_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 4"
cs5_curriculum_js: "Ilmu Komputer 5 - Panduan Kurikulum (JavaScript)"
cs5_curriculum_desc_js: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk kelas Kursus 5 menggunakan JavaScript."
cs5_curriculum_py: "Ilmu Komputer 5 - Panduan Kurikulum (Python)"
cs5_curriculum_desc_py: "Cakupan dan urutan, rencana pelajaran, aktivitas, dan lainnya untuk kelas Kursus 5 menggunakan Python."
cs1_pairprogramming: "Aktivitas Pemrograman Berpasangan"
cs1_pairprogramming_desc: "Mengenalkan siswa untuk berlatih pemrograman berpasangan yang mampu membantu mereka menjadi pendengar dan pembicara yang lebih baik."
gd1: "Pengembangan Permainan 1"
gd1_guide: "Pengembangan Permainan 1 - Panduan Proyek"
gd1_guide_desc: "Gunakan panduan ini untuk siswa anda selagi mereka membuat proyek permainan pertama yang bisa dibagikan dalam 5 hari"
gd1_rubric: "Pengembangan Permainan 1 - Rubrik Proyek"
gd1_rubric_desc: "Gunakan rubrik ini untuk menilai proyek siswa di akhir Pengembangan Permainan 1."
gd2: "Pengembangan Permainan 2"
gd2_curriculum: "Pengembangan Permainan 2 - Panduan Kurikulum"
gd2_curriculum_desc: "Rencana belajar untuk Pengembangan Permainan 2."
gd3: "Pengembangan Permainan 3"
gd3_curriculum: "Pengembangan Permainan 3 - Panduan Kurikulum"
gd3_curriculum_desc: "Rencana belajar untuk Pengembangan Permainan 3."
wd1: "Pengembangan Web 1"
wd1_curriculum: "Pengembangan Web 1 - Panduan Kurikulum"
wd1_curriculum_desc: "Lingkup dan urutan, rencana pelajaran, aktivitas, dan lainnya untuk Pengembangan Web 1."
wd1_headlines: "Aktivitas Pokok Bahasan dan Header"
wd1_headlines_example: "Lihat contoh solusi"
wd1_headlines_desc: "Mengapa paragraf dan tag header sangat penting? Gunakan aktivitas ini untuk menunjukkan header yang terpilih dengan baik membuat halaman web lebih mudah dibaca. Ada banyak solusi tepat untuk ini!"
wd1_html_syntax: "Panduan Sintaks HTML"
wd1_html_syntax_desc: "Referensi satu halaman untuk bentuk HTML yang para siswa pelajari dalam Pengembangan Web 1."
wd1_css_syntax: "Panduan Sintaks CSS"
wd1_css_syntax_desc: "Referensi satu halaman untuk CSS dan bentuk sintaks yang para siswa pelajari dalam Pengembangan Web 1."
wd2: "Pengembangan Web 2"
wd2_jquery_syntax: "Panduan Sintaks Fungsi jQuery"
wd2_jquery_syntax_desc: "Referensi satu halaman untuk fungsi jQuery yang para siswa pelajari di Pengembangan Web 2."
wd2_quizlet_worksheet: "Lembar Kerja Perencanaan Quiz"
wd2_quizlet_worksheet_instructions: "Lihat instruksi dan contoh"
wd2_quizlet_worksheet_desc: "Sebelum siswa anda membangun proyek quiz kepribadian mereka di akhir Pengembangan Web 2, mereka harus merencanakan pertanyaan quiz mereka, hasil dan respon menggunakan lembar kerja ini. Guru akan mendistribusikan instruksi dan contoh rujukan kepada siswa."
student_overview: "Ikhtisar"
student_details: "Detail Siswa"
student_name: "<NAME>"
no_name: "Tidak ada nama."
no_username: "Tidak ada username."
no_email: "Siswa tidak menulis alamat email."
student_profile: "Profil Siswa"
playtime_detail: "Detail Waktu Bermain"
student_completed: "Siswa yang Selesai"
student_in_progress: "Siswa yang Mengerjakan"
class_average: "Rata-rata Kelas"
not_assigned: "belum ditetapkan ke kursus berikut"
playtime_axis: "Waktu Bermain dalam Detik"
levels_axis: "Level dalam"
student_state: "Bagaimana"
student_state_2: "melakukannya?"
student_good: "melakukannya dengan baik"
student_good_detail: "Siswa ini mampu mengikuti kecepatan waktu penyelesaian level rata-rata kelas."
student_warn: "mungkin membutuhkan bantuan"
student_warn_detail: "Waktu penyelesaian level rata-rata siswanya menunjukkan bahwa mereka mungkin memerlukan bantuan dengan konsep baru yang telah diperkenalkan dalam kursus ini."
student_great: "sangat bagus"
student_great_detail: "Siswa ini mungkin merupakan kandidat yang baik untuk membantu siswa lain mengerjakan kursus ini, berdasarkan waktu penyelesaian level rata-rata."
full_license: "Lisensi Penuh"
starter_license: "Lisensi Awal"
customized_license: "Lisensi Khusus"
trial: "Percobaan"
hoc_welcome: "Selamat Pekan Pendidikan Ilmu Komputer"
hoc_title: "Hour of Code Games - Aktivitas Gratis untuk Mempelajari Bahasa Coding yang Sebenarnya"
hoc_meta_description: "Buat game Anda sendiri atau buat kode untuk keluar dari penjara bawah tanah! CodeCombat memiliki empat aktivitas Hour of Code yang berbeda dan lebih dari 60 level untuk mempelajari kode, bermain, dan menciptakan sesuatu."
hoc_intro: "Ada tiga jalan untuk supaya kelasmu dapat berpartisipasi dalam Hour of Code dengan CodeCombat"
hoc_self_led: "Permainan Mandiri"
hoc_self_led_desc: "Siswa dapat bermain sampai dua jam pengajaran Kode CodeCombat secara mandiri"
hoc_game_dev: "Pengembangan Permainan"
hoc_and: "dan"
hoc_programming: "Pemrograman JavaScript/Python"
hoc_teacher_led: "Pelajaran yang dipimpin oleh Guru"
hoc_teacher_led_desc1: "Unduh"
hoc_teacher_led_link: "Rencana pembelajaran Pengenalan Ilmu Komputer" # {change}
hoc_teacher_led_desc2: "Untuk mengenalan para siswa untuk konsep pemrograman menggunakan aktivitas luring"
hoc_group: "Permainan Kelompok"
hoc_group_desc_1: "Guru dapat menggunakan pelajaran sebagai penghubung dengan kursus Pengenalam Ilmu Komputer kami untuk merekam perkembangan siswa. Lihat"
hoc_group_link: "Panduan Memulai"
hoc_group_desc_2: "untuk lebih detail"
hoc_additional_desc1: "Untuk tambahan sumber daya dan aktivitas CodeCombat, lihat"
hoc_additional_desc2: "Pertanyaan"
hoc_additional_contact: "Hubungi"
# regenerate_class_code_tooltip: "Generate a new Class Code"
# regenerate_class_code_confirm: "Are you sure you want to generate a new Class Code?"
revoke_confirm: "Apakah kamu ingin mencabut Lisensi Penuh dari {{student_name}}? Lisensi tersebut akan tersedia untuk dipasang ke siswa lainnya."
revoke_all_confirm: "Apakah anda ingin mencabut Lisensi Penuh dari semua siswa di kelas ini?"
revoking: "Mencabut..."
unused_licenses: "Kamu memiliki lisensi yang tidak digunakan yang memungkinkan anda untuk menetapkan siswa pada kursus berbayar ketika mereka siap untuk belajar lebih!"
remember_new_courses: "Ingatlah untuk menetapkan kursus baru!"
more_info: "Info Lanjut"
how_to_assign_courses: "Bagaimana cara Menetapkan Kursus"
select_students: "Pilih Siswa"
select_instructions: "Klik pada kotak centang sebelah siswa yang ingin anda pasang di kursus."
choose_course: "Pilih Kursus"
choose_instructions: "Pilih kursus dari menu tarik bawah yang kamu ingin tetapkan, lalu klik “Tetapkan Ke Siswa yang Dipilih”."
push_projects: "Kami merekomendasikan mengikuti Pengembangan Web 1 atau Pengembangan Permainan 1 setelah siswa menyelesaikan Pengenalan Ilmu Komputer! Lihat {{resource_hub}} untuk lebih lanjut mengenai kursus tersebut."
teacher_quest: "Pencarian Guru untuk Sukses"
quests_complete: "Pencarian Selesai"
teacher_quest_create_classroom: "Buat Ruang Kelas"
teacher_quest_add_students: "Tambahkan Siswa"
teacher_quest_teach_methods: "Bantu siswa anda belajar bagaimana cara `memanggil method`."
teacher_quest_teach_methods_step1: "Dapatkan minimal 75% dari satu kelas untuk melewati level pertama, Dungeons of Kithgard"
teacher_quest_teach_methods_step2: "Cetak [Panduan Memulai Cepat Siswa](http://files.codecombat.com/docs/resources/StudentQuickStartGuide.pdf) di Pusat Sumber Daya."
teacher_quest_teach_strings: "Jangan melupakan siswa Anda, ajari mereka `string`."
teacher_quest_teach_strings_step1: "Dapatkan minimal 75% dari satu kelas melalui True Names."
teacher_quest_teach_strings_step2: "Gunakan Pemilih Level Guru di halaman [Panduan Kursus](/teachers/courses) untuk melihat True Names."
teacher_quest_teach_loops: "Jaga siswa anda dalam perulangan lingkaran mengenai `perulangan`"
teacher_quest_teach_loops_step1: "Dapatkan minimal 75% dari satu kelas melalui Fire Dancing."
teacher_quest_teach_loops_step2: "Gunakan Loops Activity di [Panduan Kurikulum IlKom1](/teachers/resources/cs1) untuk memperkuat konsep ini."
teacher_quest_teach_variables: "Ubahlah dengan `pengubah`"
teacher_quest_teach_variables_step1: "Dapatkan minimal 75% dari satu kelas melalui Known Enemy."
teacher_quest_teach_variables_step2: "Dorong kolaborasi dengan [Aktivitas Pemrograman Berpasangan](/teachers/resources/pair-programming)."
teacher_quest_kithgard_gates_100: "Kabur dari Kithgard Gates dengan kelasmu."
teacher_quest_kithgard_gates_100_step1: "Dapatkan minimal 75% dari satu kelas melalui Kithgard Gates."
teacher_quest_kithgard_gates_100_step2: "Pandu siswa anda untuk memikirkan masalah-masalah sukar dengan menggunakan [Lembar Kerja Siklus Teknis](http://files.codecombat.com/docs/resources/EngineeringCycleWorksheet.pdf)."
teacher_quest_wakka_maul_100: "Bersiap-siap untuk bertarung di Wakka Maul."
teacher_quest_wakka_maul_100_step1: "Dapatkan minimal 75% dari satu kelas melalui Wakka Maul."
teacher_quest_wakka_maul_100_step2: "Lihat [Panduan Arena](/teachers/resources/arenas) di [Pusat Sumber Daya](/teachers/resources) untuk tip-tip tentang cara menjalankan hari arena yang sukses."
teacher_quest_reach_gamedev: "Jelajahi dunia baru!"
teacher_quest_reach_gamedev_step1: "[Dapatkan lisensi](/teachers/licenses) supaya siswa anda dapat menjelajahi dunia baru, seperti Pengembangan Permainan dan Pengembangan Web!"
teacher_quest_done: "Ingin siswa anda belajar kode lebh lagi? Hubungi [spesialis sekolah](mailto:<EMAIL>) kami hari ini!"
teacher_quest_keep_going: "Teruskan! Inilah yang dapat anda lakukan berikutnya:"
teacher_quest_more: "Lihat semua pencarian"
teacher_quest_less: "Lihat lebih sedikit pencarian"
refresh_to_update: "(muat ulang halaman untuk melihat pembaharuan)"
view_project_gallery: "Lihat Galeri Proyek"
office_hours: "Webinars Guru"
office_hours_detail: "Belajar bagaimana cara mengikuti perkembangan siswa anda selagi mereka membuat permainan dan memulai perjalanan koding mereka! Datang dan hadiri"
office_hours_link: "webinar guru"
office_hours_detail_2: "sesi."
success: "Sukses"
in_progress: "Dalam Pengembangan"
not_started: "Belum Mulai"
mid_course: "Pertengahan Kursus"
end_course: "Akhir Kursus"
none: "Belum terdeteksi"
explain_open_ended: "Catatan: Siswa didorong untuk memecahkan level ini dengan kreatif - salah satu kemungkinan solusi tersedia dibawah."
level_label: "Level:"
time_played_label: "Waktu Bermain:"
back_to_resource_hub: "Kembali ke Pusat Sumber Daya"
back_to_course_guides: "Kembali ke Panduan Kursus"
print_guide: "Cetak panduan ini"
combo: "Kombo"
combo_explanation: "Siswa melewati tantangan level Combo dengan menggunakan salah satu konsep yang terdaftar. Tinjau kode siswa dengan mengklik titik perkembangan."
concept: "Konsep"
sync_google_classroom: "Sinkronkan Google Kelas"
try_ozaria_footer: "Coba game petualangan baru kami, Ozaria!"
try_ozaria_free: "Coba Ozaria gratis"
ozaria_intro: "Memperkenalkan Program Ilmu Komputer Baru Kami"
# share_class: "share class"
# permission: "Permission"
# not_write_permission: "You don't have write permission to the class"
# not_read_permission: "You don't have read permission to the class"
teacher_ozaria_encouragement_modal:
title: "Membangun Keterampilan Ilmu Komputer untuk Menyelamatkan Ozaria"
sub_title: "Anda diundang untuk mencoba game petualangan baru dari CodeCombat"
cancel: "Kembali ke CodeCombat"
accept: "Coba Unit Pertama Gratis"
bullet1: "Mempererat hubungan siswa untuk belajar melalui kisah epik dan alur game yang imersif"
bullet2: "Ajarkan dasar-dasar Ilmu Komputer, Python atau JavaScript, dan keterampilan abad ke-21"
bullet3: "Buka kreativitas melalui proyek batu penjuru"
bullet4: "Mendukung petunjuk melalui sumber daya kurikulum khusus"
you_can_return: "Anda selalu dapat kembali ke CodeCombat"
educator_signup_ozaria_encouragement:
recommended_for: "Direkomendasikan untuk:"
independent_learners: "Pembelajar mandiri"
homeschoolers: "homeschooler"
educators_continue_coco: "Pengajar yang ingin terus menggunakan CodeCombat di kelasnya"
continue_coco: "Lanjutkan dengan CodeCombat"
ozaria_cta:
title1: "Standar Kurikulum Inti yang Disejajarkan"
description1: "Kurikulum berbasis cerita yang imersif yang memenuhi semua standar CSTA kelas 6 - 8"
title2: "Rencana Pelajaran Turnkey"
description2: "Presentasi dan lembar kerja mendalam bagi guru untuk membimbing siswa melalui tujuan pembelajaran."
title3: "Dasbor Baru untuk Admin & Guru"
description3: "Semua wawasan yang dapat ditindaklanjuti yang dibutuhkan pengajar dalam sekejap, seperti kemajuan siswa dan pemahaman konsep."
share_licenses:
share_licenses: "Bagikan Lisensi"
shared_by: "D<NAME>:"
add_teacher_label: "Masukan email guru yang tepat:"
add_teacher_button: "Tambahkan Guru"
subheader: "Anda dapat membuat lisensi anda tersedia bagi guru lain di organisasi anda. Setiap lisensi akan hanya digunakan oleh satu siswa dalam satu waktu."
teacher_not_found: "Guru tidak ditemukan. Harap pastikan guru ini telah membuat Akun Guru."
teacher_not_valid: "Ini bukan Akun Guru yang valid. Hanya akun guru yang bisa membagikan lisensi."
already_shared: "Anda telah membagikan lisensi dengan guru tersebut."
have_not_shared: "Anda belum berbagi lisensi ini dengan guru Anda."
teachers_using_these: "Guru yang dapat mengakses lisensi ini:"
footer: "Ketika guru mencabut lisensi dari siswa, lisensi akan dikembalikan ke kumpulan lisensi untuk digunakan oleh guru lainnya di dalam grup."
you: "(Kamu)"
one_license_used: "(1 lisensi digunakan)"
licenses_used: "(__licensesUsed__ lisensi digunakan)"
more_info: "Info lanjut"
sharing:
game: "Permainan"
webpage: "Halaman Web"
your_students_preview: "Siswa anda akan mengeklik di sini untuk melihat proyek yang mereka selesaikan. Tidak tersedia dalam pratinjau guru."
unavailable: "Berbagi tautan tidak tersedia dalam pratinjau guru."
share_game: "Bagikan Permainan Ini"
share_web: "Bagikan Halaman Web Ini"
victory_share_prefix: "Bagikan tautan ini untuk mengundang teman dan keluarga kamu untuk"
victory_share_prefix_short: "Undang orang untuk"
victory_share_game: "bermain level permainanmu"
victory_share_web: "melihat halaman web kamu"
victory_share_suffix: "."
victory_course_share_prefix: "Tautan ini memungkinkan teman & keluarga kamu"
victory_course_share_game: "bermain permainan"
victory_course_share_web: "melihat halaman web"
victory_course_share_suffix: "yang kamu buat."
copy_url: "Salin URL"
share_with_teacher_email: "Kirimkan ke gurumu"
# share_ladder_link: "Share Multiplayer Link"
# ladder_link_title: "Share Your Multiplayer Match Link"
# ladder_link_blurb: "Share your AI battle link so your friends and family can play versus your code:"
game_dev:
creator: "Pembuat"
web_dev:
image_gallery_title: "Galeri Gambar"
select_an_image: "Pilih gambar yang mau kamu gunakan"
scroll_down_for_more_images: "(Gulirkan kebawah untuk melihat image lebih banyak)"
copy_the_url: "Salin URL di bawah"
copy_the_url_description: "Berguna jika kamu ingin mengganti gambar saat ini."
copy_the_img_tag: "Salin tag <img>"
copy_the_img_tag_description: "Berguna jika anda ingin memasukkan gambar yang baru."
copy_url: "Salin URL"
copy_img: "Salin <img>"
how_to_copy_paste: "Bagaimana cara Salin/Tempel"
copy: "Salin"
paste: "Tempel"
back_to_editing: "Kembali ke Sunting"
classes:
archmage_title: "Penyihir Tinggi"
archmage_title_description: "(Koder)"
archmage_summary: "Jika kamu seorang pengembang yang tertarik dalam membuat kode permainan edukasi, jadilah Penyihir Tinggi untuk membantu kami membangun CodeCombat!"
artisan_title: "Pengerajin"
artisan_title_description: "(Pembangun Level)"
artisan_summary: "Bangun dan bagikan level untuk anda dan teman anda untuk dimainkan. Menjadi seorang Pengerajin untuk belajar seni mengajar orang lain untuk memprogram."
adventurer_title: "<NAME>"
adventurer_title_description: "(Penguji Level Permainan)"
adventurer_summary: "Dapatkan level terbaru kami (bahkan untuk konten pelanggan) lebih awal secara gratis seminggu dan bantu kami mengatasi bug sebelum rilis ke publik."
scribe_title: "<NAME>"
scribe_title_description: "(Editor Artikel)"
scribe_summary: "Kode yang bagus membutuhkan dokumentasi yang baik. Tulis, ubah, dan perbaiki dokument yang dibaca oleh jutaan pemain di seluruh dunia."
diplomat_title: "Diplomat"
diplomat_title_description: "(Alih Bahasa)"
diplomat_summary: "CodeCombat di lokalkan dalam 45+ bahasa oleh Diplomat kami. Bantu kami dan berkontribusilah dalam alih bahasa."
ambassador_title: "Duta Besar"
ambassador_title_description: "(Pendukung)"
ambassador_summary: "Pandu pengguna forum kami dan berikan arahan bagi mereka yang memiliki pertanyaan. Duta Besar kami mewakili CodeCombat kepada dunia."
teacher_title: "<NAME>"
editor:
main_title: "Editor CodeCombat"
article_title: "Editor Artikel"
thang_title: "Editor Thang"
level_title: "Editor Level"
course_title: "Editor Kursus"
achievement_title: "Editor Prestasi"
poll_title: "Editor Jajak Pendapat"
back: "Kembali"
revert: "Kembalikan"
revert_models: "Kembalikan Model"
pick_a_terrain: "Pilih Medan"
dungeon: "Ruang Bawah Tanah"
indoor: "Dalam ruangan"
desert: "Gurun"
grassy: "Rumput"
mountain: "Gunung"
glacier: "Gletser"
small: "Kecil"
large: "Besar"
fork_title: "Fork Versi Baru"
fork_creating: "Membuat Fork ..."
generate_terrain: "Buat Medan"
more: "Lainnya"
wiki: "Wiki"
live_chat: "Obrolan Langsung"
thang_main: "Utama"
thang_spritesheets: "Spritesheets"
thang_colors: "Warna"
level_some_options: "Beberapa Opsi?"
level_tab_thangs: "Thang"
level_tab_scripts: "Script"
level_tab_components: "Komponen"
level_tab_systems: "Sistem"
level_tab_docs: "Dokumentasi"
level_tab_thangs_title: "Thang Saat Ini"
level_tab_thangs_all: "Semua"
level_tab_thangs_conditions: "Kondisi Awal"
level_tab_thangs_add: "Tambahkan Thangs"
level_tab_thangs_search: "Telusuri"
add_components: "Tambahkan Komponen"
component_configs: "Konfigurasi Komponen"
config_thang: "Klik dua kali untuk mengkonfigurasi thang"
delete: "Hapus"
duplicate: "Duplikat"
stop_duplicate: "Hentikan Duplikat"
rotate: "Putar"
level_component_tab_title: "Komponen Saat Ini"
level_component_btn_new: "Buat Komponen Baru"
level_systems_tab_title: "Sistem Saat Ini"
level_systems_btn_new: "Buat Sistem Baru"
level_systems_btn_add: "Tambahkan Sistem"
level_components_title: "Kembali ke Semua Hal"
level_components_type: "Tipe"
level_component_edit_title: "Edit Komponen"
level_component_config_schema: "Skema Konfigurasi"
level_system_edit_title: "Edit Sistem"
create_system_title: "Buat Sistem Baru"
new_component_title: "Buat Komponen Baru"
new_component_field_system: "Sistem"
new_article_title: "Buat Artikel Baru"
new_thang_title: "Buat Jenis Thang Baru"
new_level_title: "Buat Tingkat Baru"
new_article_title_login: "Masuk untuk Membuat Artikel Baru"
new_thang_title_login: "Masuk untuk Membuat Jenis Thang Baru"
new_level_title_login: "Masuk untuk Membuat Tingkat Baru"
new_achievement_title: "Ciptakan Prestasi Baru"
new_achievement_title_login: "Masuk untuk Menciptakan Prestasi Baru"
new_poll_title: "Buat Jajak Pendapat Baru"
new_poll_title_login: "Masuk untuk Membuat J<NAME>"
article_search_title: "Telusuri Artikel Di Sini"
thang_search_title: "Telusuri Jenis Thang Di Sini"
level_search_title: "Telusuri Tingkat Di Sini"
achievement_search_title: "Pencapaian Penelusuran"
poll_search_title: "Telusuri Jajak Pendapat"
read_only_warning2: "Catatan: Anda tidak dapat menyimpan hasil edit apa pun di sini, karena Anda belum masuk."
no_achievements: "Belum ada pencapaian yang ditambahkan untuk level ini."
achievement_query_misc: "Pencapaian utama dari bermacam-macam"
achievement_query_goals: "Pencapaian utama dari target level"
level_completion: "Penyelesaian Level"
pop_i18n: "Isi I18N"
tasks: "Tugas"
clear_storage: "Hapus perubahan lokal Anda"
add_system_title: "Tambahkan Sistem ke Tingkat"
done_adding: "Selesai Menambahkan"
article:
edit_btn_preview: "Pratijau"
edit_article_title: "Ubah Artikel"
polls:
priority: "Prioritas"
contribute:
page_title: "Berkontribusi"
intro_blurb: "CodeCombat adalah bagian dari komunitas open source! Ratusan pemain yang berdedikasi telah membantu kami membangun game seperti sekarang ini. Bergabunglah dengan kami dan tulis bab berikutnya dalam misi CodeCombat untuk mengajari dunia kode!"
alert_account_message_intro: "Halo!"
alert_account_message: "Untuk berlangganan email kelas, Anda harus masuk terlebih dahulu."
archmage_introduction: "Salah satu bagian terbaik tentang membuat game adalah mereka mensintesis banyak hal yang berbeda. Grafik, suara, jaringan waktu nyata, jaringan sosial, dan tentu saja banyak aspek pemrograman yang lebih umum, dari pengelolaan basis data tingkat rendah , dan administrasi server untuk desain yang dihadapi pengguna dan pembuatan antarmuka. Ada banyak hal yang harus dilakukan, dan jika Anda seorang programmer berpengalaman dengan keinginan untuk benar-benar menyelami seluk beluk CodeCombat, kelas ini mungkin cocok untuk Anda. Kami akan senang untuk mendapatkan bantuan Anda dalam membuat game pemrograman terbaik. "
class_attributes: "Atribut Kelas"
archmage_attribute_1_pref: "Pengetahuan dalam"
archmage_attribute_1_suf: ", atau keinginan untuk belajar. Sebagian besar kode kami dalam bahasa ini. Jika Anda penggemar Ruby atau Python, Anda akan merasa seperti di rumah sendiri. Ini JavaScript, tetapi dengan sintaks yang lebih baik."
archmage_attribute_2: "Beberapa pengalaman dalam pemrograman dan inisiatif pribadi. Kami akan membantu Anda berorientasi, tetapi kami tidak dapat menghabiskan banyak waktu untuk melatih Anda."
how_to_join: "<NAME>"
join_desc_1: "Siapa pun dapat membantu! Lihat saja di "
join_desc_2: "untuk memulai, dan centang kotak di bawah ini untuk menandai diri Anda sebagai Archmage pemberani dan mendapatkan berita terbaru melalui email. Ingin mengobrol tentang apa yang harus dilakukan atau bagaimana cara untuk terlibat lebih dalam?"
join_desc_3: ", atau temukan kami di"
join_desc_4: "dan kita akan pergi dari sana!"
join_url_email: "Email kami"
join_url_slack: "saluran Slack publik"
archmage_subscribe_desc: "Dapatkan email tentang pengumuman dan peluang pengkodean baru."
artisan_introduction_pref: "Kita harus membangun level tambahan! Orang-orang berteriak-teriak meminta lebih banyak konten, dan kami hanya dapat membuat sendiri begitu banyak. Saat ini workstation Anda berada di level satu; editor level kami hampir tidak dapat digunakan bahkan oleh pembuatnya, jadi waspadalah. Jika Anda memiliki visi kampanye yang mencakup beberapa putaran hingga "
artisan_introduction_suf: ", maka kelas ini mungkin cocok untuk Anda."
artisan_attribute_1: "Pengalaman apa pun dalam membuat konten seperti ini akan menyenangkan, seperti menggunakan editor level Blizzard. Tapi tidak wajib!"
artisan_attribute_2: "Ingin sekali melakukan banyak pengujian dan pengulangan. Untuk membuat level yang baik, Anda perlu membawanya ke orang lain dan melihat mereka memainkannya, dan bersiaplah untuk menemukan banyak hal untuk diperbaiki."
artisan_attribute_3: "Untuk saat ini, ketahanan setara dengan seorang Petualang. Editor Tingkat kami sangat awal dan membuat frustasi untuk digunakan. Anda telah diperingatkan!"
artisan_join_desc: "Gunakan Editor Tingkat dalam langkah-langkah ini, memberi atau menerima:"
artisan_join_step1: "Baca dokumentasinya."
artisan_join_step2: "Buat level baru dan jelajahi level yang ada."
artisan_join_step3: "Temukan kami di saluran Slack publik kami untuk mendapatkan bantuan."
artisan_join_step4: "Posting level Anda di forum untuk mendapatkan masukan."
artisan_subscribe_desc: "Dapatkan email tentang pengumuman dan pembaruan editor level."
adventurer_introduction: "Mari perjelas tentang peran Anda: Anda adalah tanknya. Anda akan menerima kerusakan parah. Kami membutuhkan orang untuk mencoba level baru dan membantu mengidentifikasi cara membuat segalanya lebih baik. Rasa sakitnya akan luar biasa; membuat game yang bagus adalah proses yang panjang dan tidak ada yang melakukannya dengan benar pada kali pertama. Jika Anda bisa bertahan dan memiliki skor konstitusi yang tinggi, maka kelas ini mungkin cocok untuk Anda. "
adventurer_attribute_1: "Haus untuk belajar. Anda ingin belajar cara membuat kode dan kami ingin mengajari Anda cara membuat kode. Anda mungkin akan melakukan sebagian besar pengajaran dalam kasus ini."
adventurer_attribute_2: "Karismatik. Bersikaplah lembut tetapi jelaskan tentang apa yang perlu ditingkatkan, dan tawarkan saran tentang cara meningkatkan."
adventurer_join_pref: "Kumpulkan (atau rekrut!) seorang Artisan dan bekerja dengan mereka, atau centang kotak di bawah ini untuk menerima email ketika ada level baru untuk diuji. Kami juga akan memposting tentang level untuk ditinjau di jaringan kami seperti "
adventurer_forum_url: "forum kami"
adventurer_join_suf: "jadi jika Anda lebih suka diberi tahu dengan cara itu, daftar di sana!"
adventurer_subscribe_desc: "Dapatkan email saat ada level baru untuk diuji."
scribe_introduction_pref: "CodeCombat tidak hanya berupa sekumpulan level. Ini juga akan menyertakan sumber daya untuk pengetahuan, wiki konsep pemrograman yang dapat digunakan oleh level. Dengan cara itu, setiap Artisan tidak harus menjelaskan secara detail apa a operator perbandingan adalah, mereka dapat dengan mudah menautkan level mereka ke Artikel yang menjelaskan mereka yang sudah ditulis untuk pendidikan pemain. Sesuatu di sepanjang baris apa "
scribe_introduction_url_mozilla: "Jaringan Pengembang Mozilla"
scribe_introduction_suf: "telah dibangun. Jika ide Anda tentang kesenangan adalah mengartikulasikan konsep pemrograman dalam bentuk Penurunan Harga, maka kelas ini mungkin cocok untuk Anda."
scribe_attribute_1: "Keterampilan dalam kata-kata adalah semua yang Anda butuhkan. Tidak hanya tata bahasa dan ejaan, tetapi juga mampu menyampaikan ide yang rumit kepada orang lain."
contact_us_url: "Hubungi Kami"
scribe_join_description: "ceritakan sedikit tentang diri Anda, pengalaman Anda dengan pemrograman, dan hal-hal apa yang ingin Anda tulis. Kami akan mulai dari sana!"
scribe_subscribe_desc: "Dapatkan email tentang pengumuman penulisan artikel."
diplomat_introduction_pref: "Jadi, jika ada satu hal yang kami pelajari dari"
diplomat_introduction_url: "komunitas sumber terbuka"
diplomat_introduction_suf: "karena ada minat yang cukup besar terhadap CodeCombat di negara lain! Kami sedang membangun korps penerjemah yang ingin mengubah satu rangkaian kata menjadi rangkaian kata lain agar CodeCombat dapat diakses di seluruh dunia sebanyak mungkin. Jika Anda suka melihat sekilas konten yang akan datang dan menyampaikan level ini ke sesama warga negara secepatnya, maka kelas ini mungkin cocok untuk Anda. "
diplomat_attribute_1: "Kefasihan dalam bahasa Inggris dan bahasa tujuan menerjemahkan. Saat menyampaikan ide yang rumit, penting untuk memiliki pemahaman yang kuat tentang keduanya!"
diplomat_i18n_page_prefix: "Anda dapat mulai menerjemahkan level kami dengan membuka"
diplomat_i18n_page: "halaman terjemahan"
diplomat_i18n_page_suffix: ", atau antarmuka dan situs web kami di GitHub."
diplomat_join_pref_github: "Temukan file lokal bahasa Anda"
diplomat_github_url: "di GitHub"
diplomat_join_suf_github: ", edit secara online, dan kirim pull request. Juga, centang kotak di bawah ini untuk mengikuti perkembangan internasionalisasi baru!"
diplomat_subscribe_desc: "Dapatkan email tentang perkembangan i18n dan level untuk diterjemahkan."
ambassador_introduction: "Ini adalah komunitas yang kami bangun, dan Anda adalah koneksinya. Kami memiliki forum, email, dan jaringan sosial dengan banyak orang untuk diajak bicara dan membantu mengenal game dan belajar darinya. Jika Anda ingin membantu orang-orang untuk terlibat dan bersenang-senang, serta merasakan denyut nadi CodeCombat dan kemana tujuan kita, maka kelas ini mungkin cocok untuk Anda. "
ambassador_attribute_1: "Keterampilan komunikasi. Mampu mengidentifikasi masalah yang dialami pemain dan membantu mereka menyelesaikannya. Selain itu, beri tahu kami semua tentang apa yang dikatakan pemain, apa yang mereka sukai dan tidak sukai, dan inginkan lebih banyak!"
ambassador_join_desc: "ceritakan sedikit tentang diri Anda, apa yang telah Anda lakukan, dan apa yang ingin Anda lakukan. Kami akan mulai dari sana!"
ambassador_join_step1: "Baca dokumentasinya."
ambassador_join_step2: "Temukan kami di saluran Slack publik kami."
ambassador_join_step3: "Bantu orang lain dalam kategori Duta."
ambassador_subscribe_desc: "Dapatkan email tentang pembaruan dukungan dan perkembangan multipemain."
teacher_subscribe_desc: "Dapatkan email tentang pembaruan dan pengumuman untuk guru."
changes_auto_save: "Perubahan disimpan secara otomatis saat Anda mengaktifkan kotak centang."
diligent_scribes: "Penulis Rajin Kami:"
powerful_archmages: "Archmages Kuat Kami:"
creative_artisans: "Pengrajin Kreatif Kami:"
brave_adventurers: "Petualang Berani Kami:"
translating_diplomats: "Diplomat Penerjemah Kami:"
helpful_ambassadors: "Duta Kami yang Suka Menolong:"
ladder:
title: "Arena Multipemain"
arena_title: "__arena__ | Arena Multipemain"
my_matches: "Pertandingan Saya"
simulate: "Simulasikan"
simulation_explanation: "Dengan mensimulasikan game, Anda bisa mendapatkan peringkat game Anda lebih cepat!"
simulation_explanation_leagues: "Anda terutama akan membantu mensimulasikan game untuk pemain sekutu di klan dan kursus Anda."
simulate_games: "Simulasikan Game!"
games_simulated_by: "Game yang Anda simulasi:"
games_simulated_for: "Game yang disimulasikan untuk Anda:"
games_in_queue: "Game saat ini dalam antrean:"
games_simulated: "Game yang disimulasikan"
games_played: "Game dimainkan"
ratio: "Rasio"
leaderboard: "Papan Peringkat"
battle_as: "Bertempur sebagai"
summary_your: "Milik Anda"
summary_matches: "Cocok -"
summary_wins: "Menang"
summary_losses: "Kekalahan"
rank_no_code: "Tidak Ada Kode Baru untuk Diperingkat"
rank_my_game: "Rangking Game Saya!"
rank_submitting: "Mengirim ..."
rank_submitted: "Dikirim untuk Pemeringkatan"
rank_failed: "Gagal Ranking"
rank_being_ranked: "Game Menjadi Peringkat"
rank_last_submitted: "Kirim"
help_simulate: "Membantu mensimulasikan game?"
code_being_simulated: "Kode baru Anda sedang disimulasikan oleh pemain lain untuk peringkat. Ini akan menyegarkan saat pertandingan baru masuk."
no_ranked_matches_pre: "Tidak ada peringkat yang cocok untuk"
no_ranked_matches_post: " tim! Bermain melawan beberapa pesaing lalu kembali ke sini untuk mendapatkan peringkat game Anda."
choose_opponent: "<NAME> <NAME>"
select_your_language: "Pilih bahasa Anda!"
tutorial_play: "Mainkan Tutorial"
tutorial_recommended: "Direkomendasikan jika Anda belum pernah bermain sebelumnya"
tutorial_skip: "Lewati Tutorial"
tutorial_not_sure: "Tidak yakin apa yang terjadi?"
tutorial_play_first: "Mainkan Tutorial dulu."
simple_ai: "CPU Sederhana"
warmup: "Pemanasan"
friends_playing: "Teman Bermain"
log_in_for_friends: "Masuk untuk bermain dengan teman Anda!"
social_connect_blurb: "Terhubung dan bermain melawan teman-temanmu!"
invite_friends_to_battle: "Undang temanmu untuk bergabung denganmu dalam pertempuran!"
fight: "Bertarung!" # {change}
watch_victory: "Perhatikan kemenanganmu"
defeat_the: "Kalahkan"
watch_battle: "Tonton pertempurannya"
# tournament_starts: "Tournament starts __timeElapsed__"
tournament_started: ", dimulai"
tournament_ends: "Turnamen berakhir"
tournament_ended: "Turnamen berakhir"
# tournament_results_published: ", results published"
tournament_rules: "Aturan Turnamen"
tournament_blurb_criss_cross: "Menangkan tawaran, membangun jalur, mengecoh lawan, raih permata, dan tingkatkan karier Anda di turnamen Criss-Cross kami! Lihat detailnya"
tournament_blurb_zero_sum: "Bebaskan kreativitas coding Anda dalam taktik mengumpulkan emas dan bertempur dalam pertandingan cermin alpen antara penyihir merah dan penyihir biru. Turnamen dimulai pada hari Jumat, 27 Maret dan akan berlangsung hingga Senin, 6 April pukul 17.00 PDT. Bersainglah untuk bersenang-senang dan mulia! Lihat detailnya "
tournament_blurb_ace_of_coders: "Bertarunglah di gletser beku dalam pertandingan cermin bergaya dominasi ini! Turnamen dimulai pada hari Rabu, 16 September dan akan berlangsung hingga Rabu, 14 Oktober pukul 17.00 PDT. Lihat detailnya"
tournament_blurb_blog: "di blog kami"
rules: "Aturan"
winners: "Pemenang"
league: "Liga"
red_ai: "CPU Merah" # "Red AI Wins", at end of multiplayer match playback
blue_ai: "CPU Biru"
wins: "Menang" # At end of multiplayer match playback
# losses: "Losses"
# win_num: "Wins"
# loss_num: "Losses"
# win_rate: "Win %"
humans: "Mer<NAME>" # Ladder page display team name
ogres: "Biru"
tournament_end_desc: "Turnamen selesai, terima kasih sudah bermain"
age: "Usia"
# age_bracket: "Age Bracket"
bracket_0_11: "0-11"
bracket_11_14: "11-14"
bracket_14_18: "14-18"
# bracket_11_18: "11-18"
bracket_open: "Buka"
user:
user_title: "__name__ - <NAME>ode dengan CodeCombat"
stats: "Statistik"
singleplayer_title: "Level Pemain Tunggal"
multiplayer_title: "Level Multi Pemain"
achievements_title: "Prestasi"
last_played: "Terakhir Dimainkan"
status: "Status"
status_completed: "Selesai"
status_unfinished: "Belum Selesai"
no_singleplayer: "Belum ada permainan Pemain Tunggal yang dimainkan."
no_multiplayer: "Belum ada permainan Multi Pemain yang dimainkan"
no_achievements: "Belum ada Prestasi yang dicapai."
favorite_prefix: "Bahasa favorit adalah "
favorite_postfix: "."
not_member_of_clans: "Belum menjadi anggota klan manapun."
certificate_view: "lihat sertifikat"
certificate_click_to_view: "klik untuk melihat sertifikat"
certificate_course_incomplete: "kursus belum selesai"
certificate_of_completion: "Sertifikat Penyelesaian"
certificate_endorsed_by: "Didukung oleh"
certificate_stats: "Statistik Kursus"
certificate_lines_of: "baris ke"
certificate_levels_completed: "level selesai"
certificate_for: "Untuk"
certificate_number: "Nomor"
achievements:
last_earned: "Terakhir diperoleh"
amount_achieved: "Jumlah"
achievement: "Prestasi"
current_xp_prefix: ""
current_xp_postfix: " secara keseluruhan"
new_xp_prefix: ""
new_xp_postfix: " diperoleh"
left_xp_prefix: ""
left_xp_infix: " sampai tingkat "
left_xp_postfix: ""
account:
title: "Akun"
settings_title: "Pengaturan Akun"
unsubscribe_title: "Berhenti berlangganan"
payments_title: "Pembayaran"
subscription_title: "Berlangganan"
invoices_title: "Faktur"
prepaids_title: "Prabayar"
payments: "Pembayaran"
prepaid_codes: "Kode Prabayar"
purchased: "Dibeli"
subscribe_for_gems: "Berlangganan untuk permata"
subscription: "Berlangganan"
invoices: "Tagihan"
service_apple: "Apple"
service_web: "Web"
paid_on: "Dibayar Pada"
service: "Servis"
price: "Harga"
gems: "Permata"
active: "Aktif"
subscribed: "Berlangganan"
unsubscribed: "Berhenti Berlangganan"
active_until: "Aktif Sampai"
cost: "Biaya"
next_payment: "Pembayaran Berikutnya"
card: "Kartu"
status_unsubscribed_active: "Anda tidak berlangganan dan tidak akan ditagih, tetapi akun anda masih aktif sampai saat ini."
status_unsubscribed: "Dapatkan akses level baru, jagoan, barang, dan bonus permata dengan berlangganan CodeCombat!"
not_yet_verified: "Belum diverifikasi."
resend_email: "Kirim ulang email"
email_sent: "Email terkirim! Cek kotak masuk anda."
verifying_email: "Melakukan verifikasi alamat email anda..."
successfully_verified: "Anda berhasil memverifikasi alamat email anda!"
verify_error: "Terjadi kesalahan ketika melakukan verifikasi email anda :("
unsubscribe_from_marketing: "Berhenti berlangganan __email__ dari semua marketing email CodeCombat?"
unsubscribe_button: "Ya, berhenti berlangganan"
unsubscribe_failed: "Gagal"
unsubscribe_success: "Sukses"
# manage_billing: "Manage Billing"
account_invoices:
amount: "Jumlah dalam US dollar"
declined: "Kartu anda ditolak"
invalid_amount: "Masukkan jumlah dalam US Dollar"
not_logged_in: "Masuk atau buat akun untuk mengakses tagihan."
pay: "Bayar Tagihan"
purchasing: "Membeli..."
retrying: "Terjadi kesalahan di server, mencoba kembali."
success: "Berhasil dibayar. Terima Kasih!"
account_prepaid:
purchase_code: "Beli Kode Langganan"
purchase_code1: "Kode Langganan dapat ditukarkan untuk menambah waktu langganan premium ke satu atau lebih akun untuk CodeCombat versi Rumah."
purchase_code2: "Setiap akun CodeCombat hanya dapat menukarkan Kode Langganan tertentu sekali."
purchase_code3: "Bulan Kode Langganan akan ditambahkan ke akhir langganan yang ada di akun."
purchase_code4: "Kode Langganan adalah untuk akun yang memainkan CodeCombat versi Home, kode ini tidak dapat digunakan sebagai pengganti Lisensi Pelajar untuk versi Kelas."
purchase_code5: "Untuk informasi lebih lanjut tentang Lisensi Pelajar, hubungi"
users: "Pengguna"
months: "Bulan"
purchase_total: "Total"
purchase_button: "Kirim Pembelian"
your_codes: "Kode Anda"
redeem_codes: "Tukarkan Kode Langganan"
prepaid_code: "Kode Prabayar"
lookup_code: "Cari kode prabayar"
apply_account: "Terapkan ke akun Anda"
copy_link: "Anda dapat menyalin tautan kode dan mengirimkannya ke seseorang."
quantity: "Kuantitas"
redeemed: "Ditebus"
no_codes: "Belum ada kode!"
you_can1: "Anda bisa"
you_can2: "beli kode prabayar"
you_can3: "yang dapat diterapkan ke akun Anda sendiri atau diberikan kepada orang lain."
impact:
hero_heading: "Membangun Program Ilmu Komputer Kelas Dunia"
hero_subheading: "Kami Membantu Memberdayakan Pendidik dan Menginspirasi Siswa di Seluruh Negeri"
featured_partner_story: "Kisah Mitra Unggulan"
partner_heading: "Berhasil Mengajar Coding di Sekolah Judul I"
partner_school: "Bobby Duke Middle School"
featured_teacher: "<NAME>"
teacher_title: "Guru Teknologi Coachella, CA"
implementation: "Implementasi"
grades_taught: "Nil<NAME>"
length_use: "Panjang Penggunaan"
length_use_time: "3 tahun"
students_enrolled: "Siswa yang Mendaftar Tahun Ini"
students_enrolled_number: "130"
courses_covered: "Kursus yang Dicakup"
course1: "Ilmu Komputer 1"
course2: "Ilmu Komputer 2"
course3: "Ilmu Komputer 3"
course4: "Ilmu Komputer 4"
course5: "Pengembangan Game 1"
fav_features: "Fitur Favorit"
responsive_support: "Dukungan Responsif"
immediate_engagement: "Keterlibatan Segera"
paragraph1: "<NAME> Duke Middle School terletak di antara pegunungan California Selatan di Lembah Coachella di barat dan timur dan Laut Salton 33 mil selatan, dan membanggakan populasi siswa 697 siswa dalam populasi seluruh distrik Coachella Valley Unified sebanyak 18.861 siswa . "
paragraph2: "Para siswa Sekolah Menengah <NAME> mencerminkan tantangan sosial ekonomi yang dihadapi penduduk dan siswa Coachella Valley di dalam distrik tersebut. Dengan lebih dari 95% populasi siswa Sekolah Menengah Bobby Duke memenuhi syarat untuk makan gratis dan dengan harga lebih murah dan lebih dari 40% diklasifikasikan sebagai pembelajar bahasa Inggris, pentingnya mengajarkan keterampilan abad ke-21 adalah prioritas utama guru Teknologi Sekolah Menengah B<NAME> Duke, <NAME>. "
paragraph3: "Baily tahu bahwa mengajari siswanya pengkodean adalah jalan utama menuju peluang dalam lanskap pekerjaan yang semakin memprioritaskan dan membutuhkan keterampilan komputasi. Jadi, dia memutuskan untuk mengambil tantangan yang menarik dalam membuat dan mengajar satu-satunya kelas pengkodean di sekolah dan menemukan solusi yang terjangkau, responsif terhadap umpan balik, dan menarik bagi siswa dari semua kemampuan dan latar belakang belajar. "
teacher_quote: "Ketika saya mendapatkan CodeCombat [dan] mulai meminta siswa saya menggunakannya, bola lampu menyala. Hanya siang dan malam dari setiap program lain yang kami gunakan. Mereka bahkan tidak menutup."
quote_attribution: "<NAME>, Guru Teknologi"
read_full_story: "Baca Kisah Lengkap"
more_stories: "Lebih Banyak Kisah Mitra"
partners_heading_1: "Mendukung Banyak Jalur CS dalam Satu Kelas"
partners_school_1: "Preston High School"
partners_heading_2: "Unggul dalam Ujian AP"
partners_school_2: "River Ridge High School"
partners_heading_3: "Mengajar Ilmu Komputer Tanpa Pengalaman Sebelumnya"
partners_school_3: "Riverdale High School"
download_study: "Unduh Studi Riset"
teacher_spotlight: "Sorotan Guru & Siswa"
teacher_name_1: "<NAME>"
teacher_title_1: "Instruktur Rehabilitasi"
teacher_location_1: "Morehead, Kentucky"
spotlight_1: "Melalui belas kasih dan semangatnya untuk membantu mereka yang membutuhkan kesempatan kedua, <NAME> membantu mengubah kehidupan siswa yang membutuhkan teladan positif. Tanpa pengalaman ilmu komputer sebelumnya, <NAME> memimpin siswanya meraih kesuksesan coding dalam kompetisi coding regional . "
teacher_name_2: "<NAME>"
teacher_title_2: "Maysville Community & Technical College"
teacher_location_2: "Lexington, Kentucky"
spotlight_2: "Kaila adalah seorang siswa yang tidak pernah mengira dia akan menulis baris kode, apalagi mendaftar di perguruan tinggi dengan jalan menuju masa depan yang cerah."
teacher_name_3: "<NAME>"
teacher_title_3: "Pustakawan Guru"
teacher_school_3: "Ruby Bridges Elementary"
teacher_location_3: "Alameda, CA"
spotlight_3: "<NAME> mempromosikan suasana yang setara di kelasnya di mana setiap orang dapat menemukan kesuksesan dengan caranya sendiri. Kesalahan dan perjuangan disambut karena semua orang belajar dari tantangan, bahkan dari guru."
continue_reading_blog: "Lanjutkan Membaca di Blog ..."
loading_error:
could_not_load: "Kesalahan memuat dari server. Coba segarkan halaman."
connection_failure: "Koneksi Gagal"
connection_failure_desc: "Sepertinya kamu tidak terhubung dengan internet! Periksa jaringan kamu dan muat ulang halaman ini."
login_required: "<NAME>"
login_required_desc: "Anda harus masuk untuk mengakses halaman ini."
unauthorized: "Anda harus masuk. Apakah anda menonaktifkan cookies?"
forbidden: "Terlarang"
forbidden_desc: "Oh tidak, tidak ada yang kami bisa tunjukkan kepadamu di sini! Pastikan kamu masuk menggunakan akun yang benar, atau kunjungi salah satu tautan dibawah untuk kembali ke pemrograman!"
user_not_found: "Pengguna tidak ditemukan"
not_found: "Tidak Ditemukan"
not_found_desc: "Hm, tidak ada apa-apa di sini. Kunjungi salah satu tautan berikut untuk kembali ke pemrograman!"
not_allowed: "Metode tidak diijinkan."
timeout: "Waktu Server Habis"
conflict: "Konflik sumber daya."
bad_input: "Masukan salah."
server_error: "Kesalahan server."
unknown: "Kesalahan tidak diketahui"
error: "KESALAHAN"
general_desc: "Ada yang salah, dan mungkin itu salah kami. Coba tunggu sebentar lalu muat ulang halaman, atau kunjungi salah satu tautan dibawah untuk kembali ke pemrograman!"
too_many_login_failures: "Terlalu banyak upaya login yang gagal. Silakan coba lagi nanti."
resources:
level: "Level"
patch: "Perbaikan"
patches: "Perbaikan"
system: "Sistem"
systems: "Sistem"
component: "Komponen"
components: "Komponen"
hero: "Jagoan"
campaigns: "Kampanye"
concepts:
advanced_css_rules: "Aturan CSS Lanjutan"
advanced_css_selectors: "Advanced CSS Selectors"
advanced_html_attributes: "Atribut HTML Lanjutan"
advanced_html_tags: "Tag HTML Lanjutan"
algorithm_average: "Rata-Rata Algoritme"
algorithm_find_minmax: "Algoritma Temukan Min / Maks"
algorithm_search_binary: "Biner Penelusuran Algoritme"
algorithm_search_graph: "Grafik Penelusuran Algoritme"
algorithm_sort: "Urutan Algoritme"
algorithm_sum: "Jumlah Algoritme"
arguments: "Argumen"
arithmetic: "Aritmatika"
array_2d: "Larik 2D"
array_index: "Pengindeksan Array"
array_iterating: "Iterasi Terhadap Array"
array_literals: "Array Literals"
array_searching: "Pencarian Array"
array_sorting: "Penyortiran Array"
arrays: "Array"
basic_css_rules: "Aturan CSS dasar"
basic_css_selectors: "Pemilih CSS dasar"
basic_html_attributes: "Atribut HTML Dasar"
basic_html_tags: "Tag HTML Dasar"
basic_syntax: "Sintaks Dasar"
binary: "Biner"
boolean_and: "Boolean Dan"
boolean_inequality: "Pertidaksamaan Boolean"
boolean_equality: "Persamaan Boolean"
boolean_greater_less: "Boolean Lebih Besar / Kurang"
boolean_logic_shortcircuit: "Boolean Logika Shortcircuit"
boolean_not: "Boolean Not"
boolean_operator_precedence: "Prioritas Operator Boolean"
boolean_or: "Boolean Atau"
boolean_with_xycoordinates: "Perbandingan Koordinat"
bootstrap: "Bootstrap"
break_statements: "Pernyataan Hentian"
classes: "Kelas"
continue_statements: "Pernyataan Lanjutan"
dom_events: "Event DOM"
dynamic_styling: "Penataan Gaya Dinamis"
events: "Event"
event_concurrency: "Konkurensi Event"
event_data: "Data Event"
event_handlers: "Penangan Event"
event_spawn: "Bibit Event"
for_loops: "For Loop"
for_loops_nested: "For Loops Bersarang"
for_loops_range: "Untuk Rentang Pengulangan"
functions: "Fungsi"
functions_parameters: "Parameter"
functions_multiple_parameters: "Beberapa Parameter"
game_ai: "Game AI"
game_goals: "Tujuan Game"
game_spawn: "Game Spawn"
graphics: "Grafik"
graphs: "Grafik"
heaps: "Heap"
if_condition: "Pernyataan Bersyarat If"
if_else_if: " Pernyataan Jika / Jika Lain"
if_else_statements: "Pernyataan If / Else"
if_statements: "Jika Pernyataan"
if_statements_nested: "Pernyataan Jika Bersarang"
indexing: "Indeks Array"
input_handling_flags: "Penanganan Input - Bendera"
input_handling_keyboard: "Penanganan Input - Keyboard"
input_handling_mouse: "Penanganan Input - Mouse"
intermediate_css_rules: "Aturan CSS Menengah"
intermediate_css_selectors: "Pemilih CSS Menengah"
intermediate_html_attributes: "Atribut HTML Menengah"
intermediate_html_tags: "Tag HTML Menengah"
jquery: "jQuery"
jquery_animations: "Animasi jQuery"
jquery_filtering: "Pemfilteran Elemen jQuery"
jquery_selectors: "jQuery Selector"
length: "Panjang Array"
math_coordinates: "Matematika Koordinat"
math_geometry: "Geometri"
math_operations: "Operasi Perpustakaan Matematika"
math_proportions: "Proporsi Matematika"
math_trigonometry: "Trigonometri"
object_literals: "Objek literal"
parameters: "Parameter"
programs: "Program"
properties: "Properti"
property_access: "Mengakses Properti"
property_assignment: "Menetapkan Properti"
property_coordinate: "Properti Koordinat"
queues: "Struktur Data - Antrian"
reading_docs: "Membaca Dokumen"
recursion: "Rekursi"
return_statements: "Pernyataan Pengembalian"
stacks: "Struktur Data - Tumpukan"
strings: "String"
strings_concatenation: "Penggabungan String"
strings_substrings: "Substring"
trees: "Struktur Data - Pohon"
variables: "Variabel"
vectors: "Vektor"
while_condition_loops: "While Loops dengan Persyaratan"
while_loops_simple: "While Loops"
while_loops_nested: "Nested While Loops"
xy_coordinates: "Pasangan Koordinat"
advanced_strings: "String Lanjutan" # Rest of concepts are deprecated
algorithms: "Algoritme"
boolean_logic: "Boolean Logic"
basic_html: "HTML Dasar"
basic_css: "CSS Dasar"
basic_web_scripting: "Pembuatan Skrip Web Dasar"
intermediate_html: "HTML Menengah"
intermediate_css: "CSS Menengah"
intermediate_web_scripting: "Pembuatan Skrip Web Menengah"
advanced_html: "HTML Lanjutan"
advanced_css: "CSS Lanjutan"
advanced_web_scripting: "Pembuatan Skrip Web Tingkat Lanjut"
input_handling: "Penanganan Input"
while_loops: "While Loops"
place_game_objects: "Tempatkan objek game"
construct_mazes: "Bangun labirin"
create_playable_game: "Buat proyek game yang dapat dimainkan dan dapat dibagikan"
alter_existing_web_pages: "Ubah halaman web yang ada"
create_sharable_web_page: "Buat halaman web yang bisa dibagikan"
basic_input_handling: "Penanganan Input Dasar"
basic_game_ai: "AI Game Dasar"
basic_javascript: "JavaScript Dasar"
basic_event_handling: "Penanganan Event Dasar"
create_sharable_interactive_web_page: "Buat halaman web interaktif yang dapat dibagikan"
anonymous_teacher:
notify_teacher: "<NAME>"
create_teacher_account: "Buat akun guru gratis"
enter_student_name: "Nama anda:"
enter_teacher_email: "Email guru anda:"
teacher_email_placeholder: "<EMAIL>"
student_name_placeholder: "ketik nama anda di sini"
teachers_section: "Guru:"
students_section: "Siswa:"
teacher_notified: "Kami telah memberi tahu guru kamu bahwa kamu ingin memainkan lebih CodeCombat di kelasmu!"
delta:
added: "Ditambahkan"
modified: "Berubah"
not_modified: "Tidak Berubah"
deleted: "Dihapus"
moved_index: "Indeks Pindah"
text_diff: "Perbedaan Teks"
merge_conflict_with: "GABUNG PERBEDAAN DENGAN"
no_changes: "Tidak Ada Perubahan"
legal:
page_title: "Hukum"
opensource_introduction: "CodeCombat adalah bagian dari komunitas open source."
opensource_description_prefix: "Lihat"
github_url: "GitHub kami"
opensource_description_center: "dan bantu jika Anda suka! CodeCombat dibangun di atas lusinan proyek open source, dan kami menyukainya. Lihat"
archmage_wiki_url: "wiki Archmage kami"
opensource_description_suffix: "untuk daftar perangkat lunak yang memungkinkan permainan ini."
practices_title: "Praktik Terbaik yang Menghormati"
practices_description: "Ini adalah janji kami untuk Anda, pemain, dalam bahasa yang tidak terlalu legal."
privacy_title: "Privasi"
privacy_description: "Kami tidak akan menjual informasi pribadi Anda."
security_title: "Keamanan"
security_description: "Kami berusaha keras untuk menjaga keamanan informasi pribadi Anda. Sebagai proyek sumber terbuka, situs kami terbuka secara bebas bagi siapa saja untuk meninjau dan meningkatkan sistem keamanan kami."
email_title: "Email"
email_description_prefix: "Kami tidak akan membanjiri Anda dengan spam. Melalui"
email_settings_url: "setelan email Anda"
email_description_suffix: "atau melalui tautan di email yang kami kirim, Anda dapat mengubah preferensi dan berhenti berlangganan dengan mudah kapan saja."
cost_title: "Biaya"
cost_description: "CodeCombat gratis dimainkan untuk semua level intinya, dengan langganan $ {{price}} USD / bln untuk akses ke cabang level ekstra dan {{gems}} permata bonus per bulan. Anda dapat membatalkan dengan klik, dan kami menawarkan jaminan uang kembali 100%. " # {change}
copyrights_title: "Hak Cipta dan Lisensi"
contributor_title: "Perjanjian Lisensi Kontributor"
contributor_description_prefix: "Semua kontribusi, baik di situs dan di repositori GitHub kami, tunduk pada"
cla_url: "CLA"
contributor_description_suffix: "yang harus Anda setujui sebelum berkontribusi."
code_title: "Kode Sisi Klien - MIT"
client_code_description_prefix: "Semua kode sisi klien untuk codecombat.com di repositori GitHub publik dan dalam database codecombat.com, dilisensikan di bawah"
mit_license_url: "lisensi MIT"
code_description_suffix: "Ini termasuk semua kode dalam Sistem dan Komponen yang disediakan oleh CodeCombat untuk tujuan membuat level."
art_title: "Seni / Musik - Creative Commons"
art_description_prefix: "Semua konten umum tersedia di bawah"
cc_license_url: "Lisensi Internasional Creative Commons Attribution 4.0"
art_description_suffix: "Konten umum adalah segala sesuatu yang secara umum disediakan oleh CodeCombat untuk tujuan membuat Level. Ini termasuk:"
art_music: "Musik"
art_sound: "Suara"
art_artwork: "Karya Seni"
art_sprites: "Sprite"
art_other: "Semua karya kreatif non-kode lainnya yang tersedia saat membuat Level."
art_access: "Saat ini tidak ada sistem universal dan mudah untuk mengambil aset ini. Secara umum, ambil dari URL seperti yang digunakan oleh situs, hubungi kami untuk bantuan, atau bantu kami dalam memperluas situs untuk membuat aset ini lebih mudah diakses . "
art_paragraph_1: "Untuk atribusi, harap beri nama dan tautkan ke codecombat.com di dekat tempat sumber digunakan atau jika sesuai untuk medianya. Misalnya:"
use_list_1: "Jika digunakan dalam film atau game lain, sertakan codecombat.com dalam kreditnya."
use_list_2: "Jika digunakan di situs web, sertakan tautan di dekat penggunaan, misalnya di bawah gambar, atau di laman atribusi umum tempat Anda juga dapat menyebutkan karya Creative Commons lainnya dan perangkat lunak sumber terbuka yang digunakan di situs itu. sudah dengan jelas mereferensikan CodeCombat, seperti entri blog yang menyebutkan CodeCombat, tidak memerlukan atribusi terpisah. "
art_paragraph_2: "Jika konten yang digunakan bukan dibuat oleh CodeCombat melainkan oleh pengguna codecombat.com, atributkan konten tersebut sebagai gantinya, dan ikuti petunjuk atribusi yang diberikan dalam deskripsi sumber daya tersebut jika ada."
rights_title: "Hak Dilindungi"
rights_desc: "Semua hak dilindungi undang-undang untuk Level itu sendiri. Ini termasuk"
rights_scripts: "Skrip"
rights_unit: "Konfigurasi unit"
rights_writings: "Tulisan"
rights_media: "Media (suara, musik) dan konten kreatif lainnya yang dibuat khusus untuk Tingkat itu dan tidak tersedia secara umum saat membuat Tingkat."
rights_clarification: "Untuk memperjelas, apa pun yang tersedia di Editor Tingkat untuk tujuan membuat tingkat berada di bawah CC, sedangkan konten yang dibuat dengan Editor Tingkat atau diunggah selama pembuatan Tingkat tidak."
nutshell_title: "Sekilas"
nutshell_description: "Sumber daya apa pun yang kami sediakan di Editor Tingkat bebas digunakan sesuka Anda untuk membuat Tingkat. Namun kami berhak membatasi distribusi Tingkat itu sendiri (yang dibuat di codecombat.com) sehingga dapat dikenai biaya untuk."
nutshell_see_also: "Lihat juga:"
canonical: "Versi bahasa Inggris dari dokumen ini adalah versi definitif dan kanonik. Jika ada perbedaan antara terjemahan, dokumen bahasa Inggris diutamakan."
third_party_title: "Layanan Pihak Ketiga"
third_party_description: "CodeCombat menggunakan layanan pihak ketiga berikut (antara lain):"
cookies_message: "CodeCombat menggunakan beberapa cookie penting dan non-esensial."
cookies_deny: "Tolak cookie yang tidak penting"
cookies_allow: "Izinkan cookie"
calendar:
year: "Tahun"
day: "Hari"
month: "Bulan"
january: "Januari"
february: "Februari"
march: "Maret"
april: "April"
may: "Mei"
june: "Juni"
july: "Juli"
august: "Agustus"
september: "September"
october: "Oktober"
november: "November"
december: "Desember"
code_play_create_account_modal:
title: "Kamu berhasil!" # This section is only needed in US, UK, Mexico, India, and Germany
body: "Anda sekarang dalam perjalanan untuk menjadi master coder. Daftar untuk menerima <strong> 100 Permata </strong> ekstra & Anda juga akan dimasuki untuk kesempatan <strong> memenangkan $2.500 & Hadiah Lenovo lainnya </strong>. "
sign_up: "Daftar & pertahankan coding ▶"
victory_sign_up_poke: "Buat akun gratis untuk menyimpan kode Anda & masuki kesempatan untuk memenangkan hadiah!"
victory_sign_up: "Daftar & ikuti <strong> win $2.500 </strong>"
server_error:
email_taken: "Email telah diambil"
username_taken: "Username telah diambil"
easy_password: "<PASSWORD>"
reused_password: "<PASSWORD>"
esper:
line_no: "Baris $1:"
uncaught: "Tidak tertangkap $1" # $1 will be an error type, eg "Uncaught SyntaxError"
reference_error: "Kesalahan Referensi: "
argument_error: "Kesalahan Argumen: "
type_error: "Kesalahan Tipe: "
syntax_error: "Kesalahan Sintaks: "
error: "Kesalahan: "
x_not_a_function: "$1 bukan fungsi"
x_not_defined: "$1 tidak ditentukan"
spelling_issues: "Waspadai masalah ejaan: apakah yang Anda maksud adalah `$1`, bukan `$2`?"
capitalization_issues: "Perhatikan kapitalisasi: `$1` seharusnya `$2`."
py_empty_block: "Kosongkan $1. Letakkan 4 spasi di depan pernyataan di dalam pernyataan $2."
fx_missing_paren: "Jika Anda ingin memanggil `$1` sebagai fungsi, Anda memerlukan `()`'s "
unmatched_token: "Tidak cocok `$1`. Setiap pembukaan `$2` membutuhkan penutup `$3` untuk mencocokkannya. "
unterminated_string: "String tidak diakhiri. Tambahkan `\"` yang cocok di akhir string Anda. "
missing_semicolon: "Titik koma tidak ada."
missing_quotes: "Kutipan tidak ada. Coba `$1` "
argument_type: "Argumen `$1` `$2` seharusnya memiliki jenis `$3`, tetapi mendapatkan `$4`: `$5`. "
argument_type2: "Argumen `$1` `$2` seharusnya memiliki jenis `$3`, tetapi mendapatkan `$4`."
target_a_unit: "Targetkan sebuah unit."
attack_capitalization: "Serang $1, bukan $2. (Huruf kapital penting.)"
empty_while: "Statement while kosong. Letakkan 4 spasi di depan pernyataan di dalam pernyataan while."
line_of_site: "Argumen `$1` `$2` bermasalah. Apakah masih ada musuh dalam garis pandang Anda?"
need_a_after_while: "Membutuhkan `$1` setelah `$2`."
too_much_indentation: "Terlalu banyak indentasi di awal baris ini."
missing_hero: "Kata kunci `$1` tidak ada; seharusnya `$2`."
takes_no_arguments: "`$1` tidak membutuhkan argumen. "
no_one_named: "Tidak ada yang bernama \"$1\" untuk ditargetkan."
separated_by_comma: "Pemanggilan fungsi paramaters harus dipisahkan oleh `,`s"
protected_property: "Tidak dapat membaca properti yang dilindungi: $1"
need_parens_to_call: "Jika Anda ingin memanggil `$1` sebagai fungsi, Anda memerlukan `()`'s "
expected_an_identifier: "Mengharapkan pengenal dan malah melihat '$1'."
unexpected_identifier: "Pengenal tak terduga"
unexpected_end_of: "Akhir masukan tak terduga"
unnecessary_semicolon: "Titik koma tidak perlu."
unexpected_token_expected: "Token tidak terduga: diharapkan $1 tetapi menemukan $2 saat mengurai $3"
unexpected_token: "Token tak terduga $1"
unexpected_token2: "Token tidak terduga"
unexpected_number: "Angka tidak terduga"
unexpected: "'$1' tak terduga."
escape_pressed_code: "Escape ditekan; kode dibatalkan."
target_an_enemy: "Targetkan musuh dengan nama, seperti `$1`, bukan string `$2`."
target_an_enemy_2: "Targetkan musuh dengan nama, seperti $1."
cannot_read_property: "Tidak dapat membaca properti '$1' dari undefined"
attempted_to_assign: "Mencoba menugaskan ke properti hanya-baca."
unexpected_early_end: "Akhir program yang tidak terduga."
you_need_a_string: "Anda memerlukan string untuk membuat; salah satu dari $1"
unable_to_get_property: "Tidak bisa mendapatkan properti '$1' dari referensi tidak terdefinisi atau null" # TODO: Do we translate undefined/null?
code_never_finished_its: "Kode tidak pernah selesai. Bisa sangat lambat atau memiliki putaran tak terbatas."
unclosed_string: "String tidak tertutup"
unmatched: "Tidak ada yang cocok '$1'."
error_you_said_achoo: "Anda mengatakan: $1, tetapi sandinya adalah: $2. (Huruf kapital penting.)"
indentation_error_unindent_does: "Kesalahan Indentasi: unindent tidak cocok dengan tingkat indentasi luar mana pun"
indentation_error: "Kesalahan indentasi."
need_a_on_the: "Perlu `:` di akhir baris setelah `$1`. "
attempt_to_call_undefined: "coba panggil '$1' (nilai nihil)"
unterminated: "Tidak diakhiri `$1` "
target_an_enemy_variable: "Targetkan variabel $1, bukan string $2. (Coba gunakan $3.)"
error_use_the_variable: "Gunakan nama variabel seperti `$1` sebagai ganti string seperti `$2`"
indentation_unindent_does_not: "Indentasi tidak indentasi tidak cocok dengan tingkat indentasi luar mana pun"
unclosed_paren_in_function_arguments: "$1 tidak ditutup dalam argumen fungsi."
unexpected_end_of_input: "Akhir input tak terduga"
there_is_no_enemy: "Tidak ada `$1`. Gunakan `$2` dulu." # Hints start here
try_herofindnearestenemy: "Coba `$1`"
there_is_no_function: "Tidak ada fungsi `$1`, tetapi `$2` memiliki metode `$3`. "
attacks_argument_enemy_has: "Argumen `$1` `$2` bermasalah."
is_there_an_enemy: "Apakah masih ada musuh dalam garis pandang Anda?"
target_is_null_is: "Targetnya $1. Apakah selalu ada target untuk diserang? (Gunakan $2?)"
hero_has_no_method: "`$1` tidak memiliki metode `$2`."
there_is_a_problem: "Ada masalah dengan kode Anda."
did_you_mean: "Apakah maksud Anda $1? Anda tidak memiliki item yang dilengkapi dengan keterampilan itu."
missing_a_quotation_mark: "Tanda petik tidak ada."
missing_var_use_var: "Tidak ada `$1`. Gunakan `$2` untuk membuat variabel baru."
you_do_not_have: "Anda tidak memiliki item yang dilengkapi dengan keahlian $1."
put_each_command_on: "Tempatkan setiap perintah pada baris terpisah"
are_you_missing_a: "Apakah Anda kehilangan '$1' setelah '$2'?"
your_parentheses_must_match: "Tanda kurung Anda harus cocok."
apcsp:
title: "AP Computer Science Principals | College Board Endorsed"
meta_description: "Hanya kurikulum CodeCombat yang komprehensif dan program pengembangan profesional yang Anda butuhkan untuk menawarkan kursus ilmu komputer terbaru College Board kepada siswa Anda."
syllabus: "Silabus Prinsip AP CS"
syllabus_description: "Gunakan sumber daya ini untuk merencanakan kurikulum CodeCombat untuk kelas AP Computer Science Principles Anda."
computational_thinking_practices: "Praktik Berpikir Komputasi"
learning_objectives: "Tujuan Pembelajaran"
curricular_requirements: "Persyaratan Kurikuler"
unit_1: "Unit 1: Teknologi Kreatif"
unit_1_activity_1: "Aktivitas Unit 1: Tinjauan Kegunaan Teknologi"
unit_2: "Unit 2: Pemikiran Komputasi"
unit_2_activity_1: "Aktivitas Unit 2: Urutan Biner"
unit_2_activity_2: "Kegiatan Unit 2: Menghitung Proyek Pelajaran"
unit_3: "Unit 3: Algoritme"
unit_3_activity_1: "Aktivitas Unit 3: Algoritma - Panduan Penumpang"
unit_3_activity_2: "Kegiatan Unit 3: Simulasi - Predator & Mangsa"
unit_3_activity_3: "Aktivitas Unit 3: Algoritma - Desain dan Pemrograman Pasangan"
unit_4: "Unit 4: Pemrograman"
unit_4_activity_1: "Aktivitas Unit 4: Abstraksi"
unit_4_activity_2: "Aktivitas Unit 4: Menelusuri & Menyortir"
unit_4_activity_3: "Aktivitas Unit 4: Refactoring"
unit_5: "Unit 5: Internet"
unit_5_activity_1: "Aktivitas Unit 5: Cara Kerja Internet"
unit_5_activity_2: "Aktivitas Unit 5: Simulator Internet"
unit_5_activity_3: "Aktivitas Unit 5: Simulasi Ruang Obrolan"
unit_5_activity_4: "Aktivitas Unit 5: Keamanan Siber"
unit_6: "Unit 6: Data"
unit_6_activity_1: "Kegiatan Unit 6: Pengantar Data"
unit_6_activity_2: "Aktivitas Unit 6: Big Data"
unit_6_activity_3: "Aktivitas Unit 6: Kompresi Lossy & Lossless"
unit_7: "Unit 7: Dampak Pribadi & Global"
unit_7_activity_1: "Aktivitas Unit 7: Dampak Pribadi & Global"
unit_7_activity_2: "Aktivitas Unit 7: Sumber Daya Crowdsourcing"
unit_8: "Unit 8: Tugas Kinerja"
unit_8_description: "Persiapkan siswa untuk Membuat Tugas dengan membuat game mereka sendiri dan mempraktikkan konsep utama."
unit_8_activity_1: "Membuat Latihan Tugas 1: Pengembangan Game 1"
unit_8_activity_2: "Membuat Latihan Tugas 2: Pengembangan Game 2"
unit_8_activity_3: "Buat Latihan Tugas 3: Pengembangan Game 3"
unit_9: "Unit 9: Ulasan AP"
unit_10: "Unit 10: Pasca-AP"
unit_10_activity_1: "Aktivitas Unit 10: Kuis Web"
parents_landing_2:
splash_title: "Temukan keajaiban coding di rumah."
learn_with_instructor: "Belajar dengan Instruktur"
live_classes: "Kelas Daring Langsung"
live_classes_offered: "CodeCombat sekarang menawarkan kelas ilmu komputer online langsung untuk siswa yang belajar di rumah. Cocok untuk siswa yang bekerja paling baik dalam pengaturan 1: 1 atau kelompok kecil di mana hasil belajar disesuaikan dengan kebutuhan mereka."
live_class_details_1: "Kelompok kecil atau pelajaran pribadi"
live_class_details_2: "Pengodean JavaScript dan Python, ditambah konsep inti Ilmu Komputer"
live_class_details_3: "Diajarkan oleh instruktur pengkodean ahli"
live_class_details_4: "Masukan pribadi dan instan"
live_class_details_5: "Kurikulum dipercaya oleh lebih dari 80.000 pendidik"
try_free_class: "Coba kelas 60 menit gratis"
pricing_plans: "Paket Harga"
choose_plan: "Pilih Paket"
per_student: "per siswa"
sibling_discount: "Diskon Saudara 15%!"
small_group_classes: "Kelas Pengkodean Grup Kecil"
small_group_classes_detail: "4 Sesi Grup / Bulan."
small_group_classes_price: "$159/bln"
small_group_classes_detail_1: "Rasio siswa dan instruktur 4:1"
small_group_classes_detail_2: "Kelas 60 menit"
small_group_classes_detail_3: "Buat proyek dan berikan masukan kepada siswa lain"
small_group_classes_detail_4: "Berbagi layar untuk mendapatkan umpan balik langsung tentang pengkodean dan debugging"
private_classes: "Kelas Pengodean Pribadi"
four_sessions_per_month: "4 Sesi Pribadi / Bulan"
eight_sessions_per_month: "8 Sesi Pribadi / Bulan"
four_private_classes_price: "$219 / bln"
eight_private_classes_price: "$399 / bln"
private_classes_detail: "4 atau 8 Sesi Pribadi / Bulan."
private_classes_price: "$219/bln atau $399/bln"
private_classes_detail_1: "Rasio siswa dan instruktur 1: 1"
private_classes_detail_2: "kelas 60 menit"
private_classes_detail_3: "Jadwal fleksibel yang disesuaikan dengan kebutuhan Anda"
private_classes_detail_4: "Rencana pelajaran dan masukan langsung yang disesuaikan dengan gaya belajar, kecepatan, dan tingkat kemampuan siswa"
best_seller: "Penjualan terbaik"
best_value: "Nilai terbaik"
codecombat_premium: "CodeCombat Premium"
learn_at_own_pace: "Belajar dengan Kecepatan Anda Sendiri"
monthly_sub: "Langganan Bulanan"
buy_now: "Beli sekarang"
per_month: "/bulan"
lifetime_access: "Akses Seumur Hidup"
premium_details_title: "Bagus untuk pelajar mandiri yang berkembang dengan otonomi penuh."
premium_details_1: "Akses ke pahlawan, hewan peliharaan, dan keterampilan khusus pelanggan"
premium_details_2: "Dapatkan permata bonus untuk membeli perlengkapan, hewan peliharaan, dan lebih banyak pahlawan"
premium_details_3: "Buka pemahaman yang lebih dalam tentang konsep inti dan keterampilan seperti pengembangan web dan game"
premium_details_4: "Dukungan premium untuk pelanggan"
premium_details_5: "Buat klan pribadi untuk mengundang teman dan bersaing di papan peringkat grup"
premium_need_help: "Butuh bantuan atau lebih suka Paypal? Email <a href=\"mailto:<EMAIL>\"> <EMAIL> </a>"
not_sure_kid: "Tidak yakin apakah CodeCombat tepat untuk anak Anda? Tanya mereka!"
share_trailer: "Bagikan cuplikan game kami dengan anak Anda dan minta mereka membuat akun untuk memulai."
why_kids_love: "Mengapa Anak-Anak Suka CodeCombat"
learn_through_play: "Belajar Melalui Permainan"
learn_through_play_detail: "Siswa mengembangkan keterampilan pengkodean mereka, dan juga menggunakan keterampilan pemecahan masalah untuk maju melalui level dan memperkuat pahlawan mereka."
skills_they_can_share: "Keterampilan yang Dapat Mereka Bagikan"
skills_they_can_share_details: "Siswa membangun keterampilan dunia nyata dan membuat proyek, seperti game dan halaman web, yang dapat mereka bagikan dengan teman dan keluarga."
help_when_needed: "Bantuan Saat Mereka Membutuhkannya"
help_when_needed_detail: "Dengan menggunakan data, setiap level telah dibangun untuk menantang, tetapi tidak pernah mengecewakan. Siswa didukung dengan petunjuk saat mereka mengalami kebuntuan."
book_first_class: "Pesan kelas pertama Anda"
why_parents_love: "Mengapa Orang Tua Suka CodeCombat"
most_engaging: "Cara paling menarik untuk mempelajari kode yang diketik"
most_engaging_detail: "Anak Anda akan memiliki semua yang mereka butuhkan di ujung jari mereka untuk memprogram algoritme dalam Python atau JavaScript, membuat situs web, dan bahkan merancang game mereka sendiri, sambil mempelajari materi yang selaras dengan standar kurikulum nasional."
critical_skills: "Membangun keterampilan penting untuk abad ke-21"
critical_skills_detail: "Anak Anda akan belajar cara menavigasi dan menjadi warga negara di dunia digital. CodeCombat adalah solusi yang meningkatkan pemikiran kritis, kreativitas, dan ketahanan anak Anda, memberdayakan mereka dengan keterampilan yang mereka butuhkan untuk industri apa pun."
parent_support: "Didukung oleh orang tua seperti Anda"
parent_support_detail: "Di CodeCombat, kami adalah orang tua. Kami pembuat kode. Kami adalah pendidik. Namun yang terpenting, kami adalah orang-orang yang percaya dalam memberi anak-anak kami kesempatan terbaik untuk sukses dalam apa pun yang mereka putuskan untuk lakukan . "
everything_they_need: "Semua yang mereka butuhkan untuk mulai mengetik kode sendiri"
beginner_concepts: "Konsep Pemula"
beginner_concepts_1: "Sintaks dasar"
beginner_concepts_2: "While loop"
beginner_concepts_3: "Argumen"
beginner_concepts_4: "String"
beginner_concepts_5: "Variable"
beginner_concepts_6: "Algoritme"
intermediate_concepts: "Konsep Menengah"
intermediate_concepts_1: "Pernyataan Jika"
intermediate_concepts_2: "Perbandingan Boolean"
intermediate_concepts_3: "Kondisional bertingkat"
intermediate_concepts_4: "Fungsi"
intermediate_concepts_5: "Penanganan input dasar"
intermediate_concepts_6: "Kecerdasan buatan permainan dasar"
advanced_concepts: "Konsep Lanjutan"
advanced_concepts_1: "Penanganan Event"
advanced_concepts_2: "Bersyarat saat loop"
advanced_concepts_3: "Objek literals"
advanced_concepts_4: "Parameter"
advanced_concepts_5: "Vektor"
advanced_concepts_6: "Operasi perpustakaan matematika"
advanced_concepts_7: "Rekursi"
get_started: "Memulai"
quotes_title: "Apa yang orang tua dan anak-anak katakan tentang CodeCombat"
quote_1: "\"Ini adalah pengkodean tingkat berikutnya untuk anak-anak dan sangat menyenangkan. Saya akan belajar satu atau dua hal dari ini juga. \""
quote_2: "\"Saya suka mempelajari keterampilan baru yang belum pernah saya lakukan sebelumnya. Saya suka ketika saya berjuang, saya bisa menemukan tujuan. Saya juga senang Anda dapat melihat kode tersebut berfungsi dengan benar. \""
quote_3: "\"<NAME>’s Python akan segera hadir. Dia menggunakan CodeCombat untuk membuat gim videonya sendiri. Dia menantang saya untuk memainkan permainannya, lalu tertawa ketika saya kalah. \""
quote_4: "\"Ini adalah salah satu hal favorit saya untuk dilakukan. Setiap pagi saya bangun dan bermain CodeCombat. Jika saya harus memberi CodeCombat peringkat dari 1 sampai 10, saya akan memberikannya 10!\""
parent: "Orang Tua"
student: "<NAME>"
grade: "Tingkat"
subscribe_error_user_type: "Sepertinya Anda sudah mendaftar untuk sebuah akun. Jika Anda tertarik dengan CodeCombat Premium, silakan hubungi kami di <EMAIL>."
subscribe_error_already_subscribed: "Anda sudah mendaftar untuk akun Premium."
start_free_trial_today: "Mulai uji coba gratis hari ini"
live_classes_title: "Kelas pengkodean langsung dari CodeCombat!"
live_class_booked_thank_you: "Kelas langsung Anda telah dipesan, terima kasih!"
book_your_class: "Pesan Kelas Anda"
call_to_book: "Telepon sekarang untuk memesan"
modal_timetap_confirmation:
congratulations: "Selamat!"
paragraph_1: "Petualangan coding siswa Anda menanti."
paragraph_2: "Kami telah memesan anak Anda untuk kelas online dan kami sangat senang bertemu dengan mereka!"
paragraph_3: "Sebentar lagi Anda akan menerima undangan email dengan detail jadwal kelas serta nama instruktur kelas dan informasi kontak Anda."
paragraph_4: "Jika karena alasan apa pun Anda perlu mengubah pilihan kelas, menjadwalkan ulang, atau hanya ingin berbicara dengan spesialis layanan pelanggan, cukup hubungi menggunakan informasi kontak yang disediakan dalam undangan email Anda."
paragraph_5: "Terima kasih telah memilih CodeCombat dan semoga sukses dalam perjalanan ilmu komputer Anda!"
back_to_coco: "Kembali ke CodeCombat"
hoc_2018:
banner: "Selamat Datang di Hour of Code!"
page_heading: "Siswa Anda akan belajar membuat kode dengan membuat game mereka sendiri!"
# page_heading_ai_league: "Your students will learn to code their own multiplayer AI!"
step_1: "Langkah 1: Tonton Video Ikhtisar"
step_2: "Langkah 2: Coba Sendiri"
step_3: "Langkah 3: Unduh Rencana Pelajaran"
try_activity: "Coba Aktivitas"
download_pdf: "Unduh PDF"
teacher_signup_heading: "Ubah Jam Kode menjadi Tahun Kode"
teacher_signup_blurb: "Semua yang Anda butuhkan untuk mengajarkan ilmu komputer, tidak perlu pengalaman sebelumnya."
teacher_signup_input_blurb: "Dapatkan kursus pertama gratis:"
teacher_signup_input_placeholder: "Alamat email guru"
teacher_signup_input_button: "Dapatkan CS1 Gratis"
activities_header: "Jam Lebih Banyak Aktivitas Kode"
activity_label_1: "Kabur dari Dungeon!"
activity_label_2: "Pemula: Buat Game!"
activity_label_3: "Lanjutan: Buat Game Arkade!"
# activity_label_hoc_2018: "Intermediate GD: Code, Play, Create"
# activity_label_ai_league: "Beginner CS: Road to the AI League"
activity_button_1: "Lihat Pelajaran"
about: "Tentang CodeCombat"
about_copy: "Program ilmu komputer berbasis permainan dan selaras dengan standar yang mengajarkan Python dan JavaScript yang nyata dan diketik."
point1: "✓ Kerangka Dibuat"
point2: "✓ Dibedakan"
point3: "✓ Penilaian"
point4: "✓ Kursus berbasis proyek"
point5: "✓ Pelacakan siswa"
point6: "✓ Rencana pelajaran lengkap"
title: "HOUR OF CODE"
acronym: "HOC"
hoc_2018_interstitial:
welcome: "Selamat datang di CodeCombat's Hour of Code!"
educator: "<NAME>id<NAME>"
show_resources: "Tunjukkan sumber daya guru!"
student: "<NAME>"
ready_to_code: "Saya siap membuat kode!"
hoc_2018_completion:
congratulations: "Selamat, Anda telah menyelesaikan tantangan Code, Play, Share!"
send: "Kirim game Hour of Code Anda ke teman dan keluarga!"
copy: "Salin URL"
get_certificate: "Dapatkan sertifikat kelulusan untuk merayakan bersama kelas Anda!"
get_cert_btn: "Dapatkan Sertifikat"
first_name: "<NAME>"
last_initial: "<NAME>"
teacher_email: "Alamat email guru"
school_administrator:
title: "Dasbor Administrator Sekolah"
my_teachers: "Guru Saya"
last_login: "Login Terakhir"
licenses_used: "lisensi yang digunakan"
total_students: "total students"
active_students: "siswa aktif"
projects_created: "proyek dibuat"
other: "Lainnya"
notice: "Administrator sekolah berikut memiliki akses hanya lihat ke data kelas Anda:"
add_additional_teacher: "Perlu menambah pengajar tambahan? Hubungi Manajer Akun CodeCombat Anda atau kirim email ke <EMAIL>."
license_stat_description: "Lisensi akun yang tersedia untuk jumlah lisensi yang tersedia untuk guru, termasuk Lisensi Bersama."
students_stat_description: "Total akun siswa untuk semua siswa di semua ruang kelas, terlepas dari apakah mereka memiliki lisensi yang diterapkan."
active_students_stat_description: "Siswa aktif menghitung jumlah siswa yang login ke CodeCombat dalam 60 hari terakhir."
project_stat_description: "Proyek yang dibuat menghitung jumlah total proyek pengembangan Game dan Web yang telah dibuat."
no_teachers: "Anda tidak mengadminkan guru."
totals_calculated: "Bagaimana cara menghitung total ini?"
totals_explanation_1: "Bagaimana cara menghitung total ini?"
totals_explanation_2: "Lisensi yang digunakan"
totals_explanation_3: "Menghitung total lisensi yang diterapkan ke siswa dari total lisensi yang tersedia."
totals_explanation_4: "Jumlah siswa"
totals_explanation_5: "Menghitung jumlah siswa guru di semua kelas aktif mereka. Untuk melihat total siswa yang terdaftar di kelas aktif dan yang diarsipkan, buka halaman Lisensi Siswa"
totals_explanation_6: "Siswa aktif"
totals_explanation_7: "Menghitung terakhir semua siswa yang aktif dalam 60 hari."
totals_explanation_8: "Proyek dibuat"
totals_explanation_9: "Menghitung total game dan halaman web yang dibuat."
date_thru_date: "__startDateRange__ thru __endDateRange__"
interactives:
phenomenal_job: "Pekerjaan Fenomenal!"
try_again: "Ups, coba lagi!"
select_statement_left: "Ups, pilih pernyataan dari kiri sebelum menekan \"Kirim.\""
fill_boxes: "Ups, pastikan untuk mengisi semua kotak sebelum menekan \"Kirim.\""
browser_recommendation:
title: "CodeCombat bekerja paling baik di Chrome!"
pitch_body: "Untuk pengalaman CodeCombat terbaik, sebaiknya gunakan Chrome versi terbaru. Unduh versi terbaru chrome dengan mengeklik tombol di bawah!"
download: "Unduh Chrome"
ignore: "Abaikan"
admin:
license_type_full: "Kursus Lengkap"
license_type_customize: "Sesuaikan Kursus"
# outcomes:
# outcomes_report: "Outcomes Report"
# customize_report: "Customize Report"
# done_customizing: "Done Customizing"
# start_date: "Start date"
# end_date: "End date"
# school_admin: "School Administrator"
# school_network: "School Network"
# school_subnetwork: "School Subnetwork"
# classroom: "Classroom"
# view_outcomes_report: "View Outcomes Report"
# key_concepts: "Key Concepts"
# code_languages: "Code Languages"
# using_codecombat: "Using CodeCombat's personalized learning engine..."
# wrote: "wrote..."
# across_an_estimated: "across an estimated..."
# in: "in..."
# include: "Include "
# archived: "Archived"
# max: "Max "
# multiple: "s"
# computer_program: "computer program"
# computer_programs: "computer programs"
# line_of_code: "line of code"
# lines_of_code: "lines of code"
# coding_hours: "coding hours"
# expressed_creativity: "and expressed creativity by building"
# report_content_1: "standalone game and web "
# project: "project"
# projects: "projects"
# progress_stats: "Progress stats based on sampling __sampleSize__ of __populationSize__ students."
# standards_coverage: "Standards Coverage"
# coverage_p1: "The full CodeCombat curriculum covers major programming standards in several widely-adopted frameworks, including those of the International Society for Technology in Education (ISTE), the Computer Science Teacher Association (CSTA), and the K-12 Computer Science Framework."
# coverage_p2: "At CodeCombat, we believe that students will be most prepared for both real-world computing jobs and further study of computer science by using real, typed code in full programming languages, so instead of using block-based visual programming languages for beginners, we teach Python and JavaScript – the same languages used widely today by companies ranging from Google to the New York Times."
# questions: "Have questions or want more information? We'd be happy to help."
# reach_out_manager: "Reach out to your Account Manager __name__ at "
# stats_include: "stats include __number__ other __name__"
league:
student_register_1: "Menjadi Juara AI berikutnya!"
student_register_2: "Daftar, buat tim Anda sendiri, atau gabung dengan tim lain untuk mulai berkompetisi."
student_register_3: "Berikan informasi di bawah ini agar memenuhi syarat untuk mendapatkan hadiah."
teacher_register_1: "Daftar untuk mengakses halaman profil liga kelas Anda dan mulai kelas Anda."
general_news: "Dapatkan email tentang berita terbaru dan pembaruan tentang Liga AI dan turnamen kami."
team: "tim"
how_it_works1: "Gabung dengan __team__"
seasonal_arena_tooltip: "Bertarung melawan rekan satu tim dan orang lain saat Anda menggunakan keterampilan pemrograman terbaik untuk mendapatkan poin dan peringkat papan peringkat Liga AI sebelum menghadapi arena Kejuaraan di akhir musim."
summary: "CodeCombat AI League secara unik merupakan simulator pertarungan AI yang kompetitif dan mesin game untuk mempelajari kode Python dan JavaScript yang sebenarnya."
join_now: "Gabung Sekarang"
tagline: "CodeCombat AI League menggabungkan kurikulum yang disesuaikan dengan standar berbasis proyek kami, game coding berbasis petualangan yang menarik, dan turnamen global pengkodean AI tahunan kami ke dalam kompetisi akademik terorganisir yang tidak seperti yang lain."
ladder_subheader: "Gunakan keahlian coding dan strategi pertempuran Anda untuk naik peringkat!"
earn_codepoints: "Dapatkan PoinKode dengan menyelesaikan level"
codepoints: "PoinKode"
free_1: "Akses arena multipemain kompetitif, papan peringkat, dan kejuaraan pengkodean global"
free_2: "Dapatkan poin dengan menyelesaikan level latihan dan berkompetisi dalam pertandingan head-to-head"
free_3: "Bergabunglah dengan tim coding kompetitif dengan teman, keluarga, atau teman sekelas"
free_4: "Tunjukkan keahlian coding Anda dan bawa pulang hadiah menarik"
compete_season: "Uji semua keterampilan yang telah Anda pelajari! Bersainglah melawan siswa dan pemain dari seluruh dunia dalam puncak musim yang menarik ini."
season_subheading1: "Untuk arena Season dan Championship, setiap pemain memprogram tim “AI Heroes” mereka dengan kode yang ditulis dalam Python, JavaScript, C ++, Lua, atau CoffeeScript."
season_subheading2: "Kode mereka menginformasikan strategi yang akan dijalankan Pahlawan AI mereka dalam pertarungan head-to-head melawan pesaing lain."
team_derbezt: "Pelajari coding dan menangkan hadiah yang disponsori oleh aktor superstar Meksiko, komedian, dan pembuat film <NAME>."
invite_link: "Undang pemain ke tim ini dengan mengirimkan link ini:"
public_link: "Bagikan papan peringkat tim ini dengan tautan publiknya:"
end_to_end: "Tidak seperti platform esports lain yang melayani sekolah, kami memiliki struktur dari atas ke bawah, yang berarti kami tidak terikat dengan pengembang game mana pun atau memiliki masalah dengan perizinan. Itu juga berarti kami dapat membuat modifikasi khusus dalam game untuk sekolah Anda atau organisasi. "
path_success: "Platform game cocok dengan kurikulum Ilmu Komputer biasa, sehingga saat siswa bermain melalui level game, mereka menyelesaikan tugas kursus. Siswa belajar coding dan ilmu komputer sambil bermain, kemudian menggunakan keterampilan ini dalam pertempuran arena saat mereka berlatih dan bermain di platform yang sama. "
unlimited_potential: "Struktur turnamen kami dapat disesuaikan dengan lingkungan atau kasus penggunaan apa pun. Siswa dapat berpartisipasi pada waktu yang ditentukan selama pembelajaran reguler, bermain di rumah secara tidak sinkron, atau berpartisipasi sesuai jadwal mereka sendiri."
edit_team: "<NAME> <NAME>"
start_team: "<NAME>"
leave_team: "Keluar dari <NAME>"
join_team: "<NAME>"
# view_team: "View Team"
# join_team_name: "Join Team __name__"
features: "Fitur"
built_in: "Infrastruktur Kompetitif yang Terpasang"
built_in_subheader: "Platform kami menampung setiap elemen dari proses kompetitif, dari papan peringkat hingga platform game, aset, dan penghargaan turnamen."
custom_dev: "Pengembangan Kustom"
custom_dev_subheader: "Elemen kustomisasi untuk sekolah atau organisasi Anda telah disertakan, ditambah opsi seperti halaman arahan bermerek dan karakter dalam game."
comprehensive_curr: "Kurikulum Komprehensif"
comprehensive_curr_subheader: "CodeCombat adalah solusi Ilmu Komputer yang selaras dengan standar yang membantu pengajar mengajarkan pengkodean nyata dalam JavaScript dan Python, apa pun pengalaman mereka."
roster_management: "Alat Manajemen Daftar"
roster_management_subheader: "Lacak kinerja siswa dalam kurikulum dan dalam game, dan tambahkan atau hapus siswa dengan mudah."
share_flyer: "Bagikan selebaran Liga AI kami dengan pendidik, administrator, orang tua, pelatih esports, atau orang lain yang mungkin tertarik."
download_flyer: "Unduh Flyer"
championship_summary: "Arena kejuaraan __championshipArena__ sekarang dibuka! Bertarunglah di bulan __championshipMonth__ untuk memenangkan hadiah di __championshipArena__ __championshipType__."
play_arena_full: "Mainkan __arenaName__ __arenaType__"
play_arena_short: "Mainkan __arenaName__"
# view_arena_winners: "View __arenaName__ __arenaType__ winners"
arena_type_championship: "Arena Kejuaraan"
arena_type_regular: "Arena Multiplayer (Banyak Pemain)"
blazing_battle: "Pertempuran Berkobar"
infinite_inferno: "Api Tak Berujung"
mages_might: "Penyihir Perkasa"
sorcerers: "Penyihir"
giants_gate: "Gerbang Raksasa"
colossus: "Colossus"
# iron_and_ice: "Iron and Ice"
# tundra_tower: "Tundra Tower"
# magma_mountain: "Magma Mountain"
# lava_lake: "Lava Lake"
# desert_duel: "Desert Duel"
# sandstorm: "Sandstorm"
cup: "Piala"
blitz: "Menggempur"
clash: "Bentrokan"
# season3_announcement_1: "Time to put your coding skills to the test in our season 3 final arena. The Colossus Clash is live and offers a new challenge and a new leaderboard to climb."
# season3_announcement_2: "Need more practice? Stick with the Giant's Gate Arena to refine your skills. You have until December 14th to play both arenas. Note: arena balance adjustments may occur until December 6th."
# season3_announcement_3: "Great prizes available for top performers in the Colossus Clash:"
# season2_announcement_1: "Time to put your coding skills to the test in our season 2 final arena. The Sorcerers Blitz is live and offers a new challenge and a new leaderboard to climb."
# season2_announcement_2: "Need more practice? Stick with the Mage's Might Arena to refine your skills. You have until August 31st to play both arenas. Note: arena balance adjustments may occur until August 23rd."
# season2_announcement_3: "Great prizes available for top performers in the Sorcerers Blitz:"
season1_prize_1: "Beasiswa $1,000"
season1_prize_2: "RESPAWN Kursi Permainan" # {change}
season1_prize_3: "Avatar CodeCombat Khusus"
season1_prize_4: "Dan banyak lagi!"
# season1_prize_hyperx: "HyperX Premium Peripherals"
# codecombat_ai_league: "CodeCombat AI League"
# register: "Register"
# not_registered: "Not Registered"
# register_for_ai_league: "Register for AI League"
# world: "World"
# quickstart_video: "Quickstart Video"
# arena_rankings: "Arena Rankings"
# arena_rankings_blurb: "Global AI League arena rankings"
# arena_rankings_title: "Global leaderboard rank for all players in this team across AI League arenas in the open age bracket."
# competing: "Competing:" # Competing: 3 students
# count_student: "student" # 1 student
# count_students: "students" # 2 students
# top_student: "Top:" # Top: <NAME>
# top_percent: "top" # - top 3%)
# top_of: "of" # (#8 of 35). Perhaps just use "/" if this doesn't translate naturally.
# arena_victories: "Arena Victories"
# arena_victories_blurb: "Global AI League arena recent wins"
# arena_victories_title: "Win count is based on the last 1000 matches played asynchronously by each player in each of their AI League arenas."
# count_wins: "wins" # 100+ wins or 974 wins
# codepoints_blurb: "1 CodePoint = 1 line of code written"
# codepoints_title: "One CodePoint is earned for every non-whitespace line of code needed to beat the level. Each level is worth the same amount of CodePoints according to its standard solution, regardless of whether the student wrote more or fewer lines of code."
# count_total: "Total:" # Total: 300 CodePoints, or Total: 300 wins
# join_teams_header: "Join Teams & Get Cool Stuff!"
# join_team_hyperx_title: "Join Team HyperX, Get 10% Off"
# join_team_hyperx_blurb: "30 team members will be chosen at random for a free gaming mousepad!"
# join_team_derbezt_title: "Join Team DerBezt, Get Exclusive Hero"
# join_team_derbezt_blurb: "Unlock the Armando Hoyos hero from Mexican superstar Eugenio Derbez!"
# join_team_ned_title: "Join Team Ned, Unlock Ned's Hero"
# join_team_ned_blurb: "Get the exclusive spatula-wielding hero from YouTube star, Try Guy Ned Fulmer!"
tournament:
mini_tournaments: "Turname Mini"
usable_ladders: "Semua Tangga yang Dapat Digunakan"
make_tournament: "Buat turnamen mini"
go_tournaments: "Pergi ke turnamen mini"
class_tournaments: "Kelas turnamen mini"
no_tournaments_owner: "Tidak ada turnamen sekarang, buatlah turnamen"
no_tournaments: "Tidak ada turnamen sekarang"
edit_tournament: "Edit Turnamen"
create_tournament: "Buat Turnamen"
# upcoming: "Upcoming"
# starting: "Starting"
# ended: "Ended"
# view_results: "View Results"
# estimate_days: "In __time__ Days"
# payments:
# student_licenses: "Student Licenses"
# computer_science: "Computer Science"
# web_development: "Web Development"
# game_development: "Game Development"
# per_student: "Per Student"
# just: "Just"
# teachers_upto: "Teacher can purchase upto"
# great_courses: "Great Courses included for"
# studentLicense_successful: "Congratulations! Your licenses will be ready to use in a min. Click on the Getting Started Guide in the Resource Hub to learn how to apply them to your students."
# onlineClasses_successful: "Congratulations! Your payment was successful. Our team will reach out to you with the next steps."
# homeSubscriptions_successful: "Congratulations! Your payment was successful. Your premium access will be available in few minutes."
# failed: "Your payment failed, please try again"
# session_week_1: "1 session/week"
# session_week_2: "2 sessions/week"
# month_1: "Monthly"
# month_3: "Quarterly"
# month_6: "Half-yearly"
# year_1: "Yearly"
# most_popular: "Most Popular"
# best_value: "Best Value"
# purchase_licenses: "Purchase Licenses easily to get full access to CodeCombat and Ozaria"
# homeschooling: "Homeschooling Licenses"
# recurring_month_1: "Recurring billing every month"
# recurring_month_3: "Recurring billing every 3 months"
# recurring_month_6: "Recurring billing every 6 months"
# recurring_year_1: "Recurring billing every year"
# form_validation_errors:
# required: "Field is required"
# invalidEmail: "Invalid email"
# invalidPhone: "Invalid phone number"
# emailExists: "Email already exists"
# numberGreaterThanZero: "Should be a number greater than 0"
# teacher_dashboard:
# read: "View Only"
# write: "Full Access"
# read_blurb: "View Only permits the added teacher to view your class and student progress without the ability to make changes to your class."
# write_blurb: "Full Access grants the added teacher the ability to make modifications to your class (add/remove students, assign chapters, modify licensure)"
# shared_with_none: "This class is not currently shared with any other teachers."
# share_info: "To give other teachers access to the class, add their emails below."
# class_owner: "Class Owner"
# share: "Share"
| true | module.exports = nativeDescription: "Bahasa Indonesia", englishDescription: "Indonesian", translation:
new_home:
title: "CodeCombat - Coding game untuk belajar Python dan JavaScript"
meta_keywords: "CodeCombat, python, javascript, Coding Games"
meta_description: "Pelajari kode yang diketik melalui permainan pemrograman. Pelajari Python, JavaScript, dan HTML sambil Anda memecahkan teka-teki dan belajar membuat game dan situs web pengkodean Anda sendiri."
meta_og_url: "https://codecombat.com"
become_investor: "menjadi investor di CodeCombat"
built_for_teachers_title: "Sebuah Game Coding yang Dibuat dengan Guru sebagai Pemeran Utama"
built_for_teachers_blurb: "Mengajari anak-anak membuat kode sering kali terasa berat. CodeCombat membantu semua pengajar mengajari siswa cara membuat kode dalam JavaScript atau Python, dua bahasa pemrograman paling populer. Dengan kurikulum komprehensif yang mencakup enam unit ilmu komputer dan memperkuat pembelajaran melalui pengembangan game berbasis proyek dan unit pengembangan web, anak-anak akan maju dalam perjalanan dari sintaks dasar ke rekursi! "
built_for_teachers_subtitle1: "Ilmu Komputer"
built_for_teachers_subblurb1: "Dimulai dengan kursus Pengantar Ilmu Komputer gratis kami, siswa menguasai konsep pengkodean inti seperti while / for loop, fungsi, dan algoritma."
built_for_teachers_subtitle2: "Pengembangan Game"
built_for_teachers_subblurb2: "Peserta didik membangun labirin dan menggunakan penanganan masukan (input handling) dasar untuk membuat kode permainan mereka sendiri yang dapat dibagikan dengan teman dan keluarga."
built_for_teachers_subtitle3: "Pengembangan Web"
built_for_teachers_subblurb3: "Dengan menggunakan HTML, CSS, dan jQuery, pelajar melatih otot kreatif mereka untuk memprogram laman web mereka sendiri dengan URL khusus untuk dibagikan dengan teman sekelas mereka."
century_skills_title: "Keterampilan Abad 21"
century_skills_blurb1: "Siswa Tidak Hanya Meningkatkan Level Pahlawan Mereka, Mereka Sendiri Meningkatkan Level Keterampilan Coding"
century_skills_quote1: "Kamu merasa gagal ... karena itu kamu harus memikirkan tentang semua cara yang mungkin untuk memperbaikinya, lalu coba lagi. Aku tidak akan bisa sampai di sini tanpa berusaha keras."
century_skills_subtitle1: "Berpikir Kritis"
century_skills_subblurb1: "Dengan teka-teki pengkodean yang secara alami disusun menjadi level yang semakin menantang, game pemrograman CodeCombat memastikan anak-anak selalu mempraktikkan pemikiran kritis."
century_skills_quote2: "Semua orang membuat labirin, jadi saya pikir, 'tangkap bendera' dan itulah yang saya lakukan."
century_skills_subtitle2: "Kreativitas"
century_skills_subblurb2: "CodeCombat mendorong siswa untuk menunjukkan kreativitas mereka dengan membuat dan berbagi game dan halaman web mereka sendiri."
century_skills_quote3: "Jika saya terjebak pada suatu level. Saya akan bekerja dengan orang-orang di sekitar saya sampai kita semua dapat melaluinya."
century_skills_subtitle3: "Kolaborasi"
century_skills_subblurb3: "Sepanjang permainan, ada peluang bagi siswa untuk berkolaborasi saat mereka mengalami kebuntuan dan untuk bekerja sama menggunakan panduan pemrograman berpasangan."
century_skills_quote4: "Saya selalu memiliki aspirasi untuk mendesain video game dan mempelajari cara membuat kode ... ini memberi saya titik awal yang bagus."
# century_skills_quote4_author: "PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI"
century_skills_subtitle4: "Komunikasi"
century_skills_subblurb4: "Coding mengharuskan anak-anak untuk mempraktikkan bentuk komunikasi baru, termasuk berkomunikasi dengan komputer itu sendiri dan menyampaikan ide-ide mereka menggunakan kode yang paling efisien."
classroom_in_box_title: "Kami Berusaha Untuk:"
classroom_in_box_blurb1: "Libatkan setiap siswa sehingga mereka yakin bahwa kemampuan coding bermanfaat untuk mereka."
classroom_in_box_blurb2: "Berdayakan semua pendidik untuk merasa percaya diri saat mengajar coding."
classroom_in_box_blurb3: "Menginspirasi semua pimpinan sekolah untuk membuat program ilmu komputer kelas dunia."
classroom_in_box_blurb4: ""
click_here: "Klik di sini"
creativity_rigor_title: "Di Mana Kreativitas Bertemu dengan Ketelitian"
creativity_rigor_subtitle1: "Jadikan coding menyenangkan dan ajarkan keterampilan dunia nyata"
creativity_rigor_blurb1: "Siswa mengetik Python dan JavaScript nyata sambil bermain game yang mendorong coba-dan-gagal (trial-and-error), berpikir kritis, dan kreativitas. Siswa kemudian menerapkan keterampilan pengkodean yang telah mereka pelajari dengan mengembangkan game dan situs web mereka sendiri dalam kursus berbasis proyek. "
creativity_rigor_subtitle2: "Jangkau siswa di level mereka"
creativity_rigor_blurb2: "Setiap level CodeCombat dirancang berdasarkan jutaan poin data dan dioptimalkan untuk beradaptasi dengan setiap pelajar. Level dan petunjuk latihan membantu siswa saat mereka mengalami kebuntuan, dan level tantangan menilai pembelajaran siswa selama game."
creativity_rigor_subtitle3: "Dibuat untuk semua guru, apa pun pengalamannya"
creativity_rigor_blurb3: "Kurikulum CodeCombat yang serba cepat dan selaras dengan standar memungkinkan pengajaran ilmu komputer untuk semua orang. CodeCombat membekali guru dengan pelatihan, sumber daya instruksional, dan dukungan khusus untuk merasa percaya diri dan sukses di kelas."
featured_partners_title1: "Ditampilkan Dalam"
featured_partners_title2: "Penghargaan & Mitra"
featured_partners_blurb1: "Mitra PPI:NAME:<NAME>END_PI"
featured_partners_blurb2: "Alat Kreativitas Terbaik untuk Siswa"
featured_partners_blurb3: "Pilihan Terbaik untuk Belajar"
featured_partners_blurb4: "Mitra Resmi Code.org"
featured_partners_blurb5: "Anggota Resmi CSforAll"
featured_partners_blurb6: "Mitra Aktifitas Hour of Code"
for_leaders_title: "Untuk Pimpinan Sekolah"
for_leaders_blurb: "Program Ilmu Komputer yang Selaras dengan Standar"
for_leaders_subtitle1: "Penerapan yang Mudah"
for_leaders_subblurb1: "Program berbasis web yang tidak memerlukan dukungan TI. Mulailah dalam waktu kurang dari 5 menit menggunakan Google atau Clever Single Sign-On (SSO)."
for_leaders_subtitle2: "Kurikulum Coding Lengkap"
for_leaders_subblurb2: "Kurikulum yang selaras dengan standar dengan sumber daya instruksional dan pengembangan profesional untuk memungkinkan semua guru mengajarkan ilmu komputer."
for_leaders_subtitle3: "Kasus Penggunaan Fleksibel"
for_leaders_subblurb3: "Apakah Anda ingin membangun mata pelajaran pengkodean Sekolah Menengah, jalur CTE, atau mengajar kelas Pengantar Ilmu Komputer, CodeCombat disesuaikan dengan kebutuhan Anda."
for_leaders_subtitle4: "Keterampilan Dunia Nyata"
for_leaders_subblurb4: "Siswa membangun daya tahan dan mengembangkan pola pikir yang berkembang melalui tantangan pengkodean yang mempersiapkan mereka untuk 500K+ pekerjaan komputasi terbuka."
for_teachers_title: "Untuk Guru"
for_teachers_blurb: "Alat untuk Membuka Potensi Siswa"
for_teachers_subtitle1: "Pembelajaran Berbasis Proyek"
for_teachers_subblurb1: "Promosikan kreativitas, pemecahan masalah, dan kepercayaan diri dalam kursus berbasis proyek tempat siswa mengembangkan game dan halaman web mereka sendiri."
for_teachers_subtitle2: "Dasbor Guru"
for_teachers_subblurb2: "Melihat data tentang kemajuan siswa, menemukan sumber daya kurikulum, dan mengakses dukungan waktu nyata untuk memberdayakan pembelajaran siswa."
for_teachers_subtitle3: "Penilaian Bawaan"
for_teachers_subblurb3: "Personalisasi instruksi dan pastikan siswa memahami konsep inti dengan penilaian formatif dan sumatif."
for_teachers_subtitle4: "Diferensiasi Otomatis"
for_teachers_subblurb4: "Libatkan semua pelajar di kelas yang berbeda dengan tingkat latihan yang menyesuaikan dengan kebutuhan belajar setiap siswa."
game_based_blurb: "CodeCombat adalah program ilmu komputer berbasis game tempat siswa mengetik kode nyata dan melihat karakter mereka bereaksi dalam waktu nyata."
get_started: "Memulai"
global_title: "Bergabunglah dengan Komunitas Global untuk Pelajar dan Pendidik"
global_subtitle1: "Peserta"
global_subtitle2: "Garis Kode"
global_subtitle3: "Guru"
global_subtitle4: "Negara"
go_to_my_classes: "Masuk ke kelas saya"
go_to_my_courses: "Masuk ke kursus saya"
quotes_quote1: "Sebutkan program apa pun secara online, saya sudah mencobanya. Tidak ada yang cocok dengan CodeCombat. Setiap guru yang ingin siswanya belajar cara membuat kode ... mulai dari sini!" # {change}
quotes_quote2: "Saya terkejut tentang betapa mudah dan intuitifnya CodeCombat dalam mempelajari ilmu komputer. Nilai ujian AP jauh lebih tinggi dari yang saya harapkan dan saya yakin CodeCombat adalah alasan mengapa hal ini terjadi."
quotes_quote3: "CodeCombat telah menjadi hal yang paling bermanfaat untuk mengajar siswa saya kemampuan pengkodean kehidupan nyata. Suami saya adalah seorang insinyur perangkat lunak dan dia telah menguji semua program saya. Dia menempatkan ini sebagai pilihan utamanya."
quotes_quote4: "Umpan baliknya… sangat positif sehingga kami menyusun kelas ilmu komputer di sekitar CodeCombat. Program ini benar-benar melibatkan siswa dengan platform gaya permainan yang menghibur dan instruksional pada saat yang sama. Pertahankan kerja bagus, CodeCombat ! "
# quotes_quote5: "Even though the class starts every Saturday at 7am, my son is so excited that he wakes up before me! CodeCombat creates a pathway for my son to advance his coding skills."
# quotes_quote5_author: "PI:NAME:<NAME>END_PI, Parent"
see_example: "Lihat contoh"
slogan: "Game untuk belajar pemrograman paling menyenangkan."
# slogan_power_of_play: "Learn to Code Through the Power of Play"
teach_cs1_free: "Ajarkan CS1 Gratis"
teachers_love_codecombat_title: "Guru Suka CodeCombat"
teachers_love_codecombat_blurb1: "Laporkan bahwa siswanya senang menggunakan CodeCombat untuk mempelajari cara membuat kode"
teachers_love_codecombat_blurb2: "Akan merekomendasikan CodeCombat kepada guru ilmu komputer lainnya"
teachers_love_codecombat_blurb3: "Katakan bahwa CodeCombat membantu mereka mendukung kemampuan pemecahan masalah siswa"
teachers_love_codecombat_subblurb: "Bekerja sama dengan McREL International, pemimpin dalam panduan berbasis penelitian dan evaluasi teknologi pendidikan."
top_banner_blurb: "Para orang tua, berikan anak Anda hadiah coding dan pengajaran yang dipersonalisasi dengan pengajar langsung kami!"
# top_banner_summer_camp: "Enrollment now open for our summer coding camps–ask us about our week-long virtual sessions starting at just $199."
# top_banner_blurb_funding: "New: CARES Act funding resources guide to ESSER and GEER funds for your CS programs."
try_the_game: "Coba permainan"
classroom_edition: "Edisi Ruang Kelas:"
learn_to_code: "Belajar membuat kode:"
play_now: "Mainkan Sekarang"
im_a_parent: "Saya Orang Tua"
im_an_educator: "Saya seorang Pendidik"
im_a_teacher: "Aku seorang guru"
im_a_student: "Aku seorang siswa"
learn_more: "Pelajari lebih lanjut"
classroom_in_a_box: "Sebuah ruangan kelas di-dalam-kotak untuk belajar ilmu komputer."
codecombat_is: "CodeCombat adalah sebuah wadah <strong>untuk para siswa<strong> untuk belajar ilmu komputer sambil bermain permainan yang sesungguhnya."
our_courses: "Kursus kami telah diuji oleh para pemain secara khusus untuk <strong>menjadi lebih baik di ruang kelas</strong>, bahkan oleh para guru yang mempunyai sedikit atau tanpa pengalaman pemrograman sebelumnya."
watch_how: "Saksikan CodeCombat mentransformasi cara orang-orang belajar ilmu komputer."
top_screenshots_hint: "Para siswa menulis kode dan melihat mereka mengganti secara langsung"
designed_with: "Dirancang untuk para guru"
real_code: "Kode asli yang diketik"
from_the_first_level: "dari tingkat pertama"
getting_students: "Mengajak siswa untuk mengetik kode secepat mungkin sangatlah penting untuk mempelajari sintaks pemrograman dan struktur yang tepat."
educator_resources: "Sumber pendidik"
course_guides: "dan panduan rangkaian pelajaran"
teaching_computer_science: "Mengajari ilmu komputer tidak memerlukan gelar yang mahal, karena kami menyediakan peralatan untuk menunjang pendidik dari segala macam latar belakang."
accessible_to: "Dapat diakses oleh"
everyone: "semua orang"
democratizing: "Mendemokrasikan proses belajar membuat kode adalah inti dari filosofi kami. Semua orang yang mampu untuk belajar membuat kode."
forgot_learning: "Saya pikir mereka benar-benar lupa bahwa mereka sebenarnya belajar tentang sesuatu."
wanted_to_do: "Belajar membuat kode adalah sesuatu yang selalu saya ingin lakukan, dan saya tidak pernah berpikir saya akan bisa mempelajarinya di sekolah."
builds_concepts_up: "Saya suka bagaimana CodeCombat membangun konsep. Sangat mudah dipahami dan menyenangkan."
why_games: "Mengapa belajar melalui bermain sangatlah penting?"
games_reward: "Permainan memberikan imbalan terhadap perjuangan yang produktif."
encourage: "Gaming adalah perantara yang mendorong interaksi, penemuan, dan mencoba-coba. Sebuah permainan yang baik menantang pemain untuk menguasai keterampilan dari waktu ke waktu, yang merupakan proses penting sama yang dilalui siswa saat mereka belajar."
excel: "Permainan unggul dalam memberikan prestasi"
struggle: "Perjuangan yang produktif"
kind_of_struggle: "jenis perjuangan yang menghasilkan pembelajaran yang menarik dan"
motivating: "memotivasi"
not_tedious: "tidak membosankan."
gaming_is_good: "Studi menunjukkan permainan itu baik untuk otak anak-anak. (itu benar!)"
game_based: "Ketika sistem pembelajaran berbasis permainan"
compared: "dibandingkan"
conventional: "terhadap metode pengajaran konvensional, perbedaannya jelas: permainan merupakan pilihan yang lebih baik untuk membantu siswa mempertahankan pengetahuan, berkonsentrasi dan"
perform_at_higher_level: "tampil di tingkat yang lebih tinggi dari prestasi"
feedback: "Permainan juga memberikan umpan balik langsung yang memungkinkan siswa untuk menyesuaikan solusi cara mereka dan memahami konsep-konsep yang lebih holistik, daripada hanya terbatas dengan jawaban “benar” atau “salah” saja."
real_game: "Sebuah permainan yang sebenarnya, dimainkan dengan pengkodean yang nyata."
great_game: "Sebuah permainan yang hebat merupakan lebih dari sekedar lencana dan prestasi - melainkan tentang perjalanan pemain, teka-teki yang dirancang dengan baik, dan kemampuan untuk mengatasi tantangan dengan kepercayaan diri."
agency: "CodeCombat adalah permainan yang memberikan pemain kepercayaan diri dengan mesin ketik kode kami yang kuat, yang membantu pemula dan lanjutan mahasiswa menulis kode yang valid, dan tepat."
request_demo_title: "Ajak siswa-siswamu mulai sekarang!"
request_demo_subtitle: "Meminta demonstrasi dan ajak siswa-siswamu memulai kurang dari satu jam."
get_started_title: "Atur kelas kamu sekarang"
get_started_subtitle: "Atur kelas, tambahkan siswa-siswamu dan pantau perkembangan mereka selama mereka belajar ilmu komputer."
request_demo: "Minta demonstrasi"
request_quote: "Minta Penawaran"
setup_a_class: "Atur Kelas"
have_an_account: "Sudah mempunyai akun?"
logged_in_as: "Kamu saat ini masuk sebagai"
computer_science: "Kursus cepat kami mencakup sintaks dasar sampai konsep lanjutan"
ffa: "Gratis untuk semua siswa"
coming_soon: "Segera hadir!"
courses_available_in: "Kursus tersedia dalam JavaScript dan Python. Kursus Pengembangan Web menggunakan HTML, CSS, dan jQuery"
boast: "Teka-teki yang cukup kompleks untuk memikat pemain dan pengkode."
winning: "Kombinasi yang unggul dari permainan RPG dan pemrograman pekerjaan rumah yang berhasil membuat pendidikan ramah anak yang pasti menyenangkan."
run_class: "Semua yang Anda butuhkan untuk menjalankan kelas ilmu komputer di sekolah Anda hari ini, latar belakang IT tidak diperlukan."
goto_classes: "Pergi ke Kelasku"
view_profile: "Lihat Profilku"
view_progress: "Lihat Kemajuan"
go_to_courses: "Pergi ke Kursusku"
want_coco: "Mau CodeCombat ada di sekolahmu?"
educator: "PI:NAME:<NAME>END_PI"
student: "PI:NAME:<NAME>END_PI"
our_coding_programs: "Program Coding Kami"
codecombat: "CodeCombat"
ozaria: "Ozaria"
codecombat_blurb: "Game coding asli kami. Direkomendasikan untuk orang tua, individu, pendidik, dan siswa yang ingin merasakan salah satu game coding yang paling disukai di dunia."
ozaria_blurb: "Sebuah game petualangan dan program Ilmu Komputer tempat siswa menguasai keajaiban coding yang hilang untuk menyelamatkan dunia mereka. Direkomendasikan untuk pengajar dan siswa."
try_codecombat: "Coba CodeCombat"
try_ozaria: "Coba Ozaria"
# explore_codecombat: "Explore CodeCombat"
# explore_ai_league: "Explore AI League"
# explore_ozaria: "Explore Ozaria"
# explore_online_classes: "Explore Online Classes"
# explore_pd: "Explore Professional Development"
# new_adventure_game_blurb: "Ozaria is our brand new adventure game and your turnkey solution for teaching Computer science. Our student-facing __slides__ and teacher-facing notes make planning and delivering lessons easier and faster."
# lesson_slides: "lesson slides"
# pd_blurb: "Learn the skills to effectively teach computer science with our self-directed, CSTA-accredited professional development course. Earn up to 40 credit hours any time, from any device. Pairs well with Ozaria Classroom."
# ai_league_blurb: "Competitive coding has never been so epic with this educational esports league, uniquely both an AI battle simulator and game engine for learning real code."
# codecombat_live_online_classes: "CodeCombat Live Online Classes"
# learning_technology_blurb: "Our original game teaches real-world skills through the power of play. The scaffolded curriculum systematically builds on student’s experiences and knowledge as they progress."
# learning_technology_blurb_short: "Our innovative game-based learning technology has transformed the way students learn to code."
# online_classes_blurb: "Our online coding classes combine the power of gameplay and personalized instruction for an experience your child will love. With both private or group options available, this is remote learning that works."
# for_educators: "For Educators"
# for_parents: "For Parents"
# for_everyone: "For Everyone"
# what_our_customers_are_saying: "What Our Customers Are Saying"
# game_based_learning: "Game-Based Learning"
# unique_approach_blurb: "With our unique approach, students embrace learning as they play and write code from the very start of their adventure, promoting active learning and a growth mindset."
# text_based_coding: "Text-Based Coding"
# custom_code_engine_blurb: "Our custom code engine and interpreter is designed for beginners, teaching true Python, JavaScript, and C++ programming languages using human, beginner-friendly terms."
# student_impact: "Student Impact"
# help_enjoy_learning_blurb: "Our products have helped over 20 million students enjoy learning Computer Science, teaching them to be critical, confident, and creative learners. We engage all students, regardless of experience, helping them to realize a pathway to success in Computer Science."
# global_community: "Join Our Global Community"
# million: "__num__ Million"
# billion: "__num__ Billion"
nav:
educators: "PI:NAME:<NAME>END_PI"
follow_us: "PI:NAME:<NAME>END_PI"
general: "Utama"
map: "Peta"
play: "Tingkatan" # The top nav bar entry where players choose which levels to play
community: "Komunitas"
courses: "Kursus"
blog: "Blog"
forum: "Forum"
account: "PI:NAME:<NAME>END_PI"
my_account: "PI:NAME:<NAME>END_PI"
profile: "Profil"
home: "Beranda"
contribute: "Kontribusi"
legal: "Hukum"
privacy: "Pemberitahuan Privasi"
about: "Tentang"
impact: "Pengaruh"
contact: "KontPI:NAME:<NAME>END_PI"
twitter_follow: "Ikuti"
my_classrooms: "Kelasku"
my_courses: "Kursusku"
my_teachers: "Guruku"
careers: "KarPI:NAME:<NAME>END_PI"
facebook: "Facebook"
twitter: "Twitter"
create_a_class: "Buat sebuah kelas"
other: "Lain-lain"
learn_to_code: "Belajar membuat kode!"
toggle_nav: "Aktifkan navigasi"
schools: "Sekolah"
get_involved: "Ambil Andil"
open_source: "Open source (GitHub)"
support: "Bantuan"
faqs: "Tanya Jawab"
copyright_prefix: "Hak Cipta"
copyright_suffix: "Seluruh Hak Cipta"
help_pref: "Butuh bantuan? Email"
help_suff: "dan kita akan menghubungi!"
resource_hub: "Pusat Sumber Daya"
apcsp: "Fundamental AP CS"
parent: "Orang Tua"
esports: "Esports"
browser_recommendation: "Untuk pengalaman yang lebih baik, kami merekomendasikan menggunakan browser chrome terbaru. Download browser disini"
# ozaria_classroom: "Ozaria Classroom"
# codecombat_classroom: "CodeCombat Classroom"
# ozaria_dashboard: "Ozaria Dashboard"
# codecombat_dashboard: "CodeCombat Dashboard"
# professional_development: "Professional Development"
# new: "New!"
# admin: "Admin"
# api_dashboard: "API Dashboard"
# funding_resources_guide: "Funding Resources Guide"
modal:
close: "Tutup"
okay: "Baik"
cancel: "Batal"
not_found:
page_not_found: "Laman tidak ditemukan"
diplomat_suggestion:
title: "Bantu menerjemahkan CodeCombat!" # This shows up when a player switches to a non-English language using the language selector.
sub_heading: "Kami membutuhkan kemampuan berbahasamu."
pitch_body: "Kami mengembangkan CodeCombat dalam bahasa Inggris, tapi kami sudah memiliki pemain di seluruh dunia. Banyak dari mereka ingin bermain di Indonesia, tetapi tidak berbicara bahasa Inggris, jadi jika Anda dapat menguasai kedua bahasa tersebut, silakan mempertimbangkan untuk mendaftar untuk menjadi Diplomat dan membantu menerjemahkan kedua situs CodeCombat dan semua tingkatan ke Bahasa Indonesia."
missing_translations: "Hingga kami bisa menerjemahkan semuanya ke dalam bahasa Indonesia, Anda akan melihat bahasa Inggris ketika bahasa Indonesia belum tersedia."
learn_more: "Pelajari lebih lanjut tentang menjadi seorang Diplomat"
subscribe_as_diplomat: "Berlangganan sebagai seorang Diplomat"
# new_home_faq:
# what_programming_languages: "What programming languages are available?"
# python_and_javascript: "We currently support Python and JavaScript."
# why_python: "Why should you choose Python?"
# why_python_blurb: "Python is both beginner-friendly and currently used by major corporations (such as Google). If you have younger or first-time learners, we strongly recommend Python."
# why_javascript: "Why should you choose JavaScript?"
# why_javascript_blurb: "JavaScript is the language of the web and is used across nearly every website. You may prefer to choose JavaScript if you are planning to also study web development. We’ve also made it easy for students to transition from Python to JavaScript-based web development."
# javascript_versus_python: "JavaScript’s syntax is a little more difficult for beginners than Python, so if you cannot decide between the two, we recommend Python."
# how_do_i_get_started: "How do I get started?"
# getting_started_1: "Create your Teacher Account"
# getting_started_2: "Create a class"
# getting_started_3: "Add students"
# getting_started_4: "Sit back and watch your students have fun learning to code"
# main_curriculum: "Can I use CodeCombat or Ozaria as my main curriculum?"
# main_curriculum_blurb: "Absolutely! We’ve spent time consulting with education specialists to craft classroom curriculum and materials specifically for teachers who are using CodeCombat or Ozaria without any prior computer science experience themselves. Many schools are implementing CodeCombat and/or Ozaria as the main computer science curriculum."
# clever_instant_login: "Does CodeCombat and Ozaria support Clever Instant Login?"
# clever_instant_login_blurb: "Yes! Check out our __clever__ for more details on how to get started."
# clever_integration_faq: "Clever Integration FAQ"
# google_classroom: "What about Google Classroom?"
# google_classroom_blurb1: "Yup! Be sure to use the Google Single Sign-On (SSO) Modal to sign up for your teacher account. If you already have an account using your Google email, use the Google SSO modal to log in next time. In the Create Class modal, you will see an option to Link Google Classroom. We only support rostering via Google Classroom at this time."
# google_classroom_blurb2: "Note: you must use Google SSO to sign up or log in at least once in order to see the Google Classroom integration option."
# how_much_does_it_cost: "How much does it cost to access all of the available courses and resources?"
# how_much_does_it_cost_blurb: "We customize solutions for schools and districts and work with you to understand your use case, context, and budget. __contact__ for further details! See also our __funding__ for how to leverage CARES Act funding sources like ESSER and GEER."
# recommended_systems: "Is there a recommended browser and operating system?"
# recommended_systems_blurb: "CodeCombat and Ozaria run best on computers with at least 4GB of RAM, on a modern browser such as Chrome, Safari, Firefox, or Edge. Chromebooks with 2GB of RAM may have minor graphics issues in later courses. A minimum of 200 Kbps bandwidth per student is required, although 1+ Mbps is recommended."
# other_questions: "If you have any other questions, please __contact__."
play:
title: "Mainkan Level CodeCombat - Pelajari Python, JavaScript, dan HTML"
meta_description: "Pelajari pemrograman dengan permainan pengkodean untuk pemula. Pelajari Python atau JavaScript saat Anda memecahkan labirin, membuat game Anda sendiri, dan naik level. Tantang teman Anda di level arena multipemain!"
level_title: "__level__ - Belajar Membuat Kode dengan Python, JavaScript, HTML"
video_title: "__video__ | Tingkat Video"
game_development_title: "__level__ | Pengembangan Game"
web_development_title: "__level__ | Pengembangan Web"
anon_signup_title_1: "CodeCombat memiliki"
anon_signup_title_2: "Versi Ruang Kelas!"
anon_signup_enter_code: "Masukkan Kode Kelas:"
anon_signup_ask_teacher: "Belum punya? Tanya guru Anda!"
anon_signup_create_class: "Ingin membuat kelas?"
anon_signup_setup_class: "Siapkan kelas, tambahkan siswa Anda, dan pantau kemajuan!"
anon_signup_create_teacher: "Buat akun guru gratis"
play_as: "Main sebagai" # Ladder page
get_course_for_class: "Berikan Pengembangan Game dan lainnya ke kelasmu!"
request_licenses: "Hubungi spesialis sekolah kami untuk rinciannya"
compete: "Bertanding!" # Course details page
spectate: "Tonton" # Ladder page
simulate_all: "Simulasikan Semua"
players: "pemain" # Hover over a level on /play
hours_played: "jam bermain" # Hover over a level on /play
items: "Barang" # Tooltip on item shop button from /play
unlock: "Buka" # For purchasing items and heroes
confirm: "Konfirmasi"
owned: "Dipunyai" # For items you own
locked: "Terkunci"
available: "Tersedia"
skills_granted: "Kemampuan Diberikan" # Property documentation details
heroes: "Jagoan" # Tooltip on hero shop button from /play
achievements: "Prestasi" # Tooltip on achievement list button from /play
settings: "Pengaturan" # Tooltip on settings button from /play
poll: "Poll" # Tooltip on poll button from /play
next: "Lanjut" # Go from choose hero to choose inventory before playing a level
change_hero: "Ganti Jagoan" # Go back from choose inventory to choose hero
change_hero_or_language: "Ganti Jagoan atau Bahasa"
buy_gems: "Beli Permata"
subscribers_only: "Hanya untuk yang pelanggan!"
subscribe_unlock: "Berlangganan untuk membuka!"
subscriber_heroes: "Berlangganan sekarang untuk segera membuka Amara, Hushbaum, and Hattori!"
subscriber_gems: "Berlangganan sekarang untuk membeli jagoan ini dengan permata!"
anonymous: "Pemain tak bernama"
level_difficulty: "Kesulitan: "
awaiting_levels_adventurer_prefix: "Kami meliris level baru setiap minggunya"
awaiting_levels_adventurer: "Daftar sebagai seorang Petualang"
awaiting_levels_adventurer_suffix: "Untuk menjadi yang pertama memainkan level baru."
adjust_volume: "Atur suara"
campaign_multiplayer: "Arena Multipemain"
campaign_multiplayer_description: "... dimana kamu membuat kode satu lawan satu melawan pemain lainnya."
brain_pop_done: "Kamu telah mengalahkan Raksasa dengan kode! Kamu menang!"
brain_pop_challenge: "Tantang dirimu untuk bermain lagi menggunakan bahasa pemrograman yang berbeda!"
replay: "Ulang"
back_to_classroom: "Kembali ke Kelas"
teacher_button: "Untuk Guru"
get_more_codecombat: "Dapatkan Lebih Lagi CodeCombat"
code:
if: "jika" # Keywords--these translations show up on hover, so please translate them all, even if it's kind of long. (In the code editor, they will still be in English.)
else: "lainnya"
elif: "jika lainnya"
while: "selama"
loop: "ulangi"
for: "untuk"
break: "berhenti"
continue: "lanjutkan"
pass: "PI:PASSWORD:<PASSWORD>END_PI"
return: "kembali"
then: "kemudian"
do: "lakukan"
end: "selesai"
function: "fungsi"
def: "definisi"
var: "variabel"
self: "diri"
hero: "pahlawan"
this: "ini"
or: "atau"
"||": "atau"
and: "dan"
"&&": "dan"
not: "bukan"
"!": "tidak"
"=": "menentukan"
"==": "sama dengan"
"===": "sama persis"
"!=": "tidak sama dengan"
"!==": "tidak sama persis"
">": "lebih besar dari"
">=": "lebih besar dari atau sama dengan"
"<": "kurang dari"
"<=": "kurang dari atau sama"
"*": "dikalikan dengan"
"/": "dibagi dengan"
"+": "penambahan"
"-": "pengurangan"
"+=": "tambahkan dan tetapkan"
"-=": "kurangi dan tetapkan"
True: "Betul"
true: "betul"
False: "Salah"
false: "salah"
undefined: "tidak didefinisikan"
null: "null"
nil: "nihil"
None: "Tidak ada"
share_progress_modal:
blurb: "Kamu membuat kemajuan yang besar! Beritahu orang tuamu berapa banyak kamu telah pelajari dengan CodeCombat."
email_invalid: "Alamat email tidak valid."
form_blurb: "Masukkan alamat email orang tuamu dibawah dan kami akan beritahu mereka!"
form_label: "Alamat Email"
placeholder: "alamat email"
title: "Kerja yang sangat bagus, Murid"
login:
sign_up: "Buat Akun"
email_or_username: "Email atau username"
log_in: "Masuk"
logging_in: "Sedang masuk"
log_out: "Keluar"
forgot_password: "PI:PASSWORD:<PASSWORD>END_PI?"
finishing: "Finishing"
sign_in_with_facebook: "Masuk dengan Facebook"
sign_in_with_gplus: "Masuk dengan Google"
signup_switch: "Ingin membuat akun?"
accounts_merge_confirmation: "Akun tersebut telah digunakan oleh akun google yang lain. Apakah anda ingin menggabungkan kedua akun tersebut?"
signup:
complete_subscription: "Berlanggangan Penuh"
create_student_header: "Membuat Akun Siswa"
create_teacher_header: "Membuat Akun Guru"
create_individual_header: "Membuat Akun Individual"
email_announcements: "Menerima berita mengenai level CodeCombat dan fitur yang baru!"
sign_in_to_continue: "Masuk atau buat akun baru untuk lanjut"
# create_account_to_submit_multiplayer: "Create a free account to rank your multiplayer AI and explore the whole game!"
teacher_email_announcements: "Selalu berikan informasi saya materi, kurikulum, dan kursus!"
creating: "Membuat Akun..."
sign_up: "Masuk"
log_in: "masuk dengan kata sandi"
login: "Masuk"
required: "Kamu wajib masuk sebelum bisa melanjutkannya"
login_switch: "Sudah memiliki akun?"
optional: "opsional"
connected_gplus_header: "Kamu berhasil terhubung dengan Google+"
connected_gplus_p: "Selesaikan pendaftaran supaya kamu bisa masuk dengan akun Google+ milikmu"
connected_facebook_header: "Kamu berhasil terhubung dengan Facebook!"
connected_facebook_p: "Selesaikan pendaftaran supaya kamu bisa terhubung dengan akun Facebook milikmu"
hey_students: "Murid-murid, silakan masukkan kode kelas dari gurumu"
birthday: "Tanggal lahir"
parent_email_blurb: "Kamu tahu bahwa kamu tidak dapat menunggu untuk belajar pemrograman — kamipun juga sangat senang! Orang tua kalian akan menerima email dengan instruksi lebih lanjut tentang membuat akun untukmu. Silakan email {{email_link}} jika kamu memiliki pertanyaan."
classroom_not_found: "Tidak ada kelas dengan Kode Kelas ini. Cek kembali penulisannya atau mintalah bantuan kepada gurumu"
checking: "Sedang mengecek..."
account_exists: "Email ini telah digunakan:"
sign_in: "Masuk"
email_good: "Email dapat digunakan!"
name_taken: "Nama pengguna sudah diambil! Ingin mencoba {{suggestedName}}?"
name_available: "Nama pengguna tersedia!"
name_is_email: "Nama pengguna tidak boleh berupa email"
choose_type: "Pilih tipe akunmu:"
teacher_type_1: "Mengajarkan pemrograman menggunakan CodeCombat!"
teacher_type_2: "Mempersiapkan kelasmu"
teacher_type_3: "Mengakses Panduan Kursus"
teacher_type_4: "Melihat perkembangan siswa"
signup_as_teacher: "Masuk sebagai guru"
student_type_1: "Mempelajari cara pemrograman sambil bermain sebuah permainan yang menarik!"
student_type_2: "Bermain dengan kelasmu"
student_type_3: "Bersaing dalam arena"
student_type_4: "Pilih jagoanmu!"
student_type_5: "Persiapkan Kode Kelasmu!"
signup_as_student: "Masuk sebagai siswa"
individuals_or_parents: "Individu dan Orang Tua"
individual_type: "Untuk pemain yang belajar kode di luar kelas. Para orang tua harus mendaftar akun di sini"
signup_as_individual: "Daftar sebagai individu"
enter_class_code: "Masukkan Kode Kelas kamu"
enter_birthdate: "Masukkan tanggal lahirmu:"
parent_use_birthdate: "Para orang tua, gunakan tanggal lahirmu."
ask_teacher_1: "Tanyakan gurumu untuk Kode Kelas kamu"
ask_teacher_2: "Bukan bagian dari kelas? Buatlah"
ask_teacher_3: "Akun Individu"
ask_teacher_4: " sebagai gantinya."
about_to_join: "Kamu akan bergabung:"
enter_parent_email: "Masukkan email orang tua kamu:"
parent_email_error: "Terjadi kesalahan ketika mencoba mengirim email. Cek alamat email dan coba lagi."
parent_email_sent: "Kamu telah mengirim email dengan instruksi lebih lanjut tentang cara membuat akun. Tanyakan orang tua kamu untuk mengecek kotak masuk mereka."
account_created: "Akun Telah Dibuat!"
confirm_student_blurb: "Tulislah informasi kamu supaya kamu tidak lupa. Gurumu juga dapat membantu untuk mereset kata sandi kamu setiap saat."
confirm_individual_blurb: "Tulis informasi masuk kamu jika kamu membutuhkannya lain waktu. Verifikasi email kamu supaya kamu dapat memulihkan akun kamu jika kamu lupa kata sandimu - check kotak masukmu!"
write_this_down: "Tulislah ini:"
start_playing: "Mulai Bermain!"
sso_connected: "Berhasil tersambung dengan:"
select_your_starting_hero: "Pilihlah Jagoan Awalmu:"
you_can_always_change_your_hero_later: "Kamu dapat mengganti jagoanmu nanti."
finish: "Selesai"
teacher_ready_to_create_class: "Kamu telah siap untuk membuat kelas pertamamu!"
teacher_students_can_start_now: "Siswa-siswamu dapat mulai bermain di kursus pertama, Pengenalan dalam Ilmu Komputer, segera."
teacher_list_create_class: "Di layar berikut, kamu akan dapat membuat sebuah kelas."
teacher_list_add_students: "Tambahkan siswa-siswa ke dalam kelas dengan mengklik link Lihat Kelas, lalu kirimkan siswa-siswamu ke dalam Kode Kelas atau URL. Kamu juga dapat mengundang mereka dari email jika mereka memiliki alamat email."
teacher_list_resource_hub_1: "Periksalah"
teacher_list_resource_hub_2: "Petunjuk Kursus"
teacher_list_resource_hub_3: "Untuk penyelesaian di setiap level, dan"
teacher_list_resource_hub_4: "Pusat Materi"
teacher_list_resource_hub_5: "untuk panduan kurikulum, aktifitas, dan lainnya!"
teacher_additional_questions: "Itu saja! Jika kamu memerlukan tambahan bantuan atau pertanyaan, jangkaulah di __supportEmail__."
dont_use_our_email_silly: "Jangan taruh email kami di sini! Taruhlah di email orangtuamu"
want_codecombat_in_school: "Ingin bermain CodeCombat setiap saat?"
eu_confirmation: "Saya setuju untuk mengizinkan CodeCombat menyimpan data saya di server AS."
eu_confirmation_place_of_processing: "Pelajari lebih lanjut tentang kemungkinan risikonya"
eu_confirmation_student: "Jika Anda tidak yakin, tanyakan pada guru Anda."
eu_confirmation_individual: "Jika Anda tidak ingin kami menyimpan data Anda di server AS, Anda dapat terus bermain secara anonim tanpa menyimpan kode Anda."
password_requirements: "8 hingga 64 karakter tanpa pengulangan"
invalid: "Tidak valid"
invalid_password: "PI:PASSWORD:<PASSWORD>END_PI"
with: "PI:PASSWORD:<PASSWORD>END_PI"
want_to_play_codecombat: "Tidak, saya tidak punya satu pun tapi ingin bermain CodeCombat!"
have_a_classcode: "Punya Kode Kelas?"
yes_i_have_classcode: "Ya, saya memiliki Kode Kelas!"
enter_it_here: "Masukkan di sini:"
recover:
recover_account_title: "Pulihkan Akun"
send_password: "PI:PASSWORD:<PASSWORD>END_PI"
recovery_sent: "Email pemulihan telah dikirim"
items:
primary: "Primer"
secondary: "Sekunder"
armor: "Baju Pelindung"
accessories: "Aksesoris"
misc: "Lain-lain"
books: "Buku-buku"
common:
default_title: "CodeCombat - Coding game untuk belajar Python dan JavaScript"
default_meta_description: "Pelajari kode yang diketik melalui permainan pemrograman. Pelajari Python, JavaScript, dan HTML sambil Anda memecahkan teka-teki dan belajar membuat game dan situs web pengkodean Anda sendiri."
back: "Kembali" # When used as an action verb, like "Navigate backward"
coming_soon: "Segera Hadir!"
continue: "Lanjutkan" # When used as an action verb, like "Continue forward"
next: "Selanjutnya"
default_code: "Kode Asli"
loading: "Memuat..."
overview: "Ikhtisar"
processing: "Memproses..."
solution: "Solusi"
table_of_contents: "Daftar Isi"
intro: "Pengenalan"
saving: "Menyimpan..."
sending: "Mengirim..."
send: "Kirim"
sent: "Terkirim"
cancel: "Batal"
save: "Simpan"
publish: "Publikasi"
create: "Buat"
fork: "Cabangkan"
play: "Mainkan" # When used as an action verb, like "Play next level"
retry: "Coba Lagi"
actions: "Aksi-aksi"
info: "Info"
help: "Bantuan"
watch: "Tonton"
unwatch: "Berhenti Menonton"
submit_patch: "Kirim Perbaikan"
submit_changes: "Kirim Perubahan"
save_changes: "Simpan Perubahan"
required_field: "wajib"
submit: "Kirim"
replay: "Ulangi"
complete: "Selesai"
# pick_image: "Pick Image"
general:
and: "dan"
name: "Nama"
date: "Tanggal"
body: "Badan"
version: "Versi"
pending: "Tertunda"
accepted: "Diterima"
rejected: "Ditolak"
withdrawn: "Ditarik"
accept: "Terima"
accept_and_save: "Terima&Simpan"
reject: "Tolak"
withdraw: "Tarik"
submitter: "PI:NAME:<NAME>END_PI"
submitted: "Diajukan"
commit_msg: "Pesan Perubahan"
version_history: "Histori Versi"
version_history_for: "Histori Versi Untuk: "
select_changes: "Pilih dua perubahan dibawah untuk melihat perbedaan."
undo_prefix: "Urung"
undo_shortcut: "(Ctrl+Z)"
redo_prefix: "Ulangi"
redo_shortcut: "(Ctrl+Shift+Z)"
play_preview: "Mainkan pratinjau untuk level saat ini"
result: "Hasil"
results: "Hasil"
description: "Deskripsi"
or: "atau"
subject: "Subjek"
email: "Email"
password: "PI:PASSWORD:<PASSWORD>END_PI"
confirm_password: "PI:PASSWORD:<PASSWORD>END_PI"
message: "Pesan"
code: "Kode"
ladder: "Tangga"
when: "Ketika"
opponent: "Lawan"
rank: "Peringkat"
score: "Skor"
win: "Menang"
loss: "Kalah"
tie: "Imbang"
easy: "Mudah"
medium: "Sedang"
hard: "Sulit"
player: "Pemain"
player_level: "Level" # Like player level 5, not like level: Dungeons of Kithgard
warrior: "Kesatria"
ranger: "Pemanah"
wizard: "Penyihir"
first_name: "PI:NAME:<NAME>END_PI"
last_name: "PI:NAME:<NAME>END_PI"
last_initial: "Inisial PI:NAME:<NAME>END_PI"
username: "Username"
contact_us: "PI:NAME:<NAME>END_PI"
close_window: "Tutup Jendela"
learn_more: "Pelajari Lagi"
more: "Lebih Banyak"
fewer: "Lebih Sedikit"
with: "dengan"
chat: "Obrolan"
chat_with_us: "Bicaralah dengan kami"
email_us: "Kirimkan email kepada kami"
sales: "Penjualan"
support: "Dukungan"
# here: "here"
units:
second: "detik"
seconds: "detik"
sec: "dtk"
minute: "menit"
minutes: "menit"
hour: "jam"
hours: "jam"
day: "hari"
days: "hari"
week: "minggu"
weeks: "minggu"
month: "bulan"
months: "bulan"
year: "tahun"
years: "tahun"
play_level:
back_to_map: "Kembali ke Peta"
directions: "Arah"
edit_level: "Edit Level"
keep_learning: "Terus Belajar"
explore_codecombat: "Jelajahi CodeCombat"
finished_hoc: "Saya sudah menyelesaikan Jam Code saya"
get_certificate: "Dapatkan sertifikatmu!"
level_complete: "Level Tuntas"
completed_level: "Level yang terselesaikan:"
course: "Kursus:"
done: "Selesai"
next_level: "Level Selanjutnya"
combo_challenge: "Combo Tantangan"
concept_challenge: "Tantangan Konsep"
challenge_unlocked: "Tantangan Terbuka"
combo_challenge_unlocked: "Tantangan Combo Terbuka"
concept_challenge_unlocked: "Tantangan Konsep Terbuka"
concept_challenge_complete: "Tantangan Konsep Selesai!"
combo_challenge_complete: "Tantangan Combo Selesai!"
combo_challenge_complete_body: "Kerja bagus, sepertinya kamu telah mengerti __concept__ dengan baik dalam perjalananmu!"
replay_level: "Ulang Level"
combo_concepts_used: "__complete__/__total__ Konsep Digunakan"
combo_all_concepts_used: "Kamu telah menggunakan semua kemungkinan konsep untuk memecahkan tantangannya. Kerja Bagus!"
combo_not_all_concepts_used: "Kamu telah menggunakan __complete__ dari __total__ kemungkinan konsep untuk menyelesaikan tantangan. Cobalah untuk menggunakan semua __total__ konsep di lain waktu!"
start_challenge: "Memulai Tantangan"
next_game: "Permainan berikutnya"
languages: "Bahasa"
programming_language: "Bahasa pemrograman"
show_menu: "Tampilkan menu permainan"
home: "Beranda" # Not used any more, will be removed soon.
level: "Level" # Like "Level: Dungeons of Kithgard"
skip: "Lewati"
game_menu: "Menu Permainan"
restart: "Mengulang"
goals: "Tujuan"
goal: "Tujuan"
challenge_level_goals: "Tujuan Tantangan Level"
challenge_level_goal: "Tujuan Tantangan Level"
concept_challenge_goals: "Tujuan Tantangan Konsep"
combo_challenge_goals: "Tujuan Tantangan Level"
concept_challenge_goal: "Tujuan Tantangan Konsep"
combo_challenge_goal: "Tujuan Tantangan Level"
running: "Jalankan..."
success: "Berhasil!"
incomplete: "Belum selesai"
timed_out: "Kehabisan waktu"
failing: "Gagal"
reload: "Muat Ulang"
reload_title: "Muat Ulang Semua Kode?"
reload_really: "Apakah kamu yakin ingin memuat ulang semua level kembali ke awal mula?"
reload_confirm: "Muat Ulang Semua"
restart_really: "Anda yakin ingin memulai ulang level? Anda akan kehilangan semua kode yang Anda tulis."
restart_confirm: "Ya, Muat Ulang"
test_level: "Tes Level"
victory: "Menang"
victory_title_prefix: ""
victory_title_suffix: " Selesai"
victory_sign_up: "Daftar untuk Menyimnpan Proses"
victory_sign_up_poke: "Ingin menyimpan kodemu? Buatlah akun gratis!"
victory_rate_the_level: "Seberapa menyenangkan level ini?"
victory_return_to_ladder: "Kembali ke Tingkatan"
victory_saving_progress: "Menyimpan Perkembangan"
victory_go_home: "Kembali ke Beranda"
victory_review: "Beritahu kami lebih lagi!"
victory_review_placeholder: "Bagaimana dengan levelnya?"
victory_hour_of_code_done: "Apakah Kamu Selesai?"
victory_hour_of_code_done_yes: "Ya, saya telah menyelesaikan Jam Kode saya"
victory_experience_gained: "XP Didapat"
victory_gems_gained: "Permata Didapat"
victory_new_item: "Barang Baru"
victory_new_hero: "PI:NAME:<NAME>END_PI"
victory_viking_code_school: "Ya ampun, Itu adalah level yang sulit yang telah kamu selesaikan! Jika kamu belum menjadi pengembang perangkat lunak, kamu seharusnya jadi. Kamu mendapatkan jalur cepat untuk diterima di Viking Code School, dimana kamu dapat mengambil kemampuanmu di level berikutnya dan menjadi pengembang web profesional dalam 14 minggu."
victory_become_a_viking: "Menjadi seorang Viking"
victory_no_progress_for_teachers: "Perkembangan tidak dapat disimpan untuk guru. Tetapi kamu dapat menambahkan akun siswa ke dalam kelasmu untuk dirimu"
tome_cast_button_run: "Jalankan"
tome_cast_button_running: "Berjalan"
tome_cast_button_ran: "Telah berjalan"
tome_cast_button_update: "Perbarui"
tome_submit_button: "Submit"
tome_reload_method: "Memuat ulang kode asli untuk mengulang level"
tome_your_skills: "Kemampuan Kamu"
hints: "Petunjuk"
videos: "Video"
hints_title: "Petunjuk {{number}}"
code_saved: "Kode disimpan"
skip_tutorial: "Lewati (esc)"
keyboard_shortcuts: "Tombol Pintas"
loading_start: "Memulai Level"
loading_start_combo: "Memulai Tantangan Combo"
loading_start_concept: "Memulai Tantangan Konsep"
problem_alert_title: "Perbaiki Kode Kamu"
time_current: "Sekarang:"
time_total: "Maks:"
time_goto: "Menuju ke:"
non_user_code_problem_title: "Tidak dapat memuat ulang Level"
infinite_loop_title: "Perulangan Tak Terhingga Terdeteksi"
infinite_loop_description: "Kode awal untuk membangun dunia tidak pernah selesai. Kemungkinan karena sangat lambat atau terjadi perulangan tak terhingga. Atau mungkin ada kesalahan. Kamu dapat mencoba menjalankan kode ini kembali atau mengulang kode ke keadaan semula. Jika masih tidak bisa, tolong beritahu kami."
check_dev_console: "Kamu dapat membuka developer console untuk melihat apa yang menjadi penyebab kesalahan"
check_dev_console_link: "(instruksi-instruksi)"
infinite_loop_try_again: "Coba Lagi"
infinite_loop_reset_level: "Mengulang Level"
infinite_loop_comment_out: "Mengkomentari Kode Saya"
tip_toggle_play: "Beralih mulai/berhenti dengan Ctrl+P"
tip_scrub_shortcut: "Gunakan Ctrl+[ dan Ctrl+] untuk memutar ulang dan mempercepat."
tip_guide_exists: "Klik panduan, di dalam menu (di bagian atas halaman), untuk info yang bermanfaat."
tip_open_source: "CodeCombat adalah bagian dari komunitas sumber terbuka!"
tip_tell_friends: "Menikmati CodeCombat? Ceritakan kepada temanmu mengenai kami!"
tip_beta_launch: "CodeCombat diluncurkan beta di Oktober 2013."
tip_think_solution: "Pikirkan solusinya, bukan masalahnya."
tip_theory_practice: "Dalam teori, tidak ada perbedaan antara teori dan praktek. Tetapi dalam praktek, ada bedanya. - PI:NAME:<NAME>END_PI"
tip_error_free: "Ada dua cara untuk menulis program yang bebas dari error; tetapi hanya cara ketiga yang berhasil. - PI:NAME:<NAME>END_PI"
tip_debugging_program: "Jika men-debug adalah proses menghilangkan bugs, maka memprogram pastilah proses menaruhnya kembali. - PI:NAME:<NAME>END_PI"
tip_forums: "Pergilah menuju ke forum dan ceritakan apa yang kamu pikirkan!"
tip_baby_coders: "Di masa depan, bahkan para bayi akan menjadi Penyihir Tinggi."
tip_morale_improves: "Proses pemuatan akan dilanjutkan sampai moral naik."
tip_all_species: "Kami percaya bahwa ada kesempatan yang sama untuk belajar pemrograman untuk semua spesies."
tip_reticulating: "Retikulasi tulang belakang."
tip_harry: "Kamu seorang penyihir, "
tip_great_responsibility: "Dengan kemampuan koding yang besar, timbul tanggung jawab men-debug yang besar."
tip_munchkin: "Jika kamu tidak memakan sayuranmu, maka seekor munchkin akan datang kepadamu selagi kamu tertidur."
tip_binary: "Hanya ada 10 tipe orang yang ada di dunia: Mereka yang mengerti biner, dan mereka yang tidak."
tip_commitment_yoda: "Seorang programmer harus memiliki komitmen yang paling dalam, pikiran yang paling serius. ~ Yoda"
tip_no_try: "Lakukan. Atau tidak. Tidak ada coba-coba. - Yoda"
tip_patience: "Kesabaran kamu harus miliki, Padawan muda. - Yoda"
tip_documented_bug: "Sebuah dokumentasi bugs bukanlah bugs; tetapi sebuah fitur."
tip_impossible: "Selalu saja terlihat tidak mungkin sampai hal itu berhasil. - PI:NAME:<NAME>END_PI"
tip_talk_is_cheap: "Bicara itu mudah. Tunjukkan kepadaku kodenya. - PI:NAME:<NAME>END_PI"
tip_first_language: "Hal malapetaka yang pernah kamu pelajari adalah bahasa pemrograman pertamamu. - Alan Kay"
tip_hardware_problem: "Q: Berapa banyak programmer yang dibutuhkan untuk mengganti bohlam lampu? A: Tidak ada, Itu adalah masalah perangkat keras."
tip_hofstadters_law: "Hukum Hofstadter: Selalu saja lebih lama dari yang kamu perkirakan, bahkan ketika kamu memperhitungkan Hukum Hofstadter."
tip_premature_optimization: "Optimasi yang prematur adalah akar dari semua keburukan. - PI:NAME:<NAME>END_PI"
tip_brute_force: "Jika ragu-ragu, gunakanlah kebrutalan. - PI:NAME:<NAME>END_PI"
tip_extrapolation: "Ada dua tipe orang: mereka yang mampu mengekstrapolasi dari data yang tidak lengkap..."
tip_superpower: "Koding adalah hal yang paling dekat bahwa kita memiliki kekuatan super."
tip_control_destiny: "Dalam sumber terbuka sebenarnya, kamu memiliki hak untuk mengontrol nasibmu. PI:NAME:<NAME>END_PI"
tip_no_code: "Tanpa kode lebih cepat daripada tidak tidak mengkode"
tip_code_never_lies: "Kode tidak pernah berbohong, tetapi komentar kadang-kadang. - PI:NAME:<NAME>END_PI"
tip_reusable_software: "Sebelum perangkat lunak dapat digunakan kembali, pertama-tama dia harus bisa digunakan."
tip_optimization_operator: "Semua pemrograman memiliki operator yang dioptimasi. Dalam semua bahasa operator tersebut adalah ‘//’"
tip_lines_of_code: "Mengukur kemajuan pemrograman dari jumlah baris kode sama seperti mengukur proses pembuatan pesawat terbang dari beratnya. - PI:NAME:<NAME>END_PI"
tip_source_code: "Aku ingin mengubah dunia tetapi mereka tidak memberikan aku kode sumbernya."
tip_javascript_java: "Java adalah untuk JavaScript sama seperti Bis dengan Biskuit. - PI:NAME:<NAME>END_PI"
tip_move_forward: "Apapun yang telah kamu lakukan, tetaplah bergerak ke depan. - PI:NAME:<NAME>END_PI Jr."
tip_google: "Punya masalah yang tidak dapat kamu pecahkan? Google saja!"
tip_adding_evil: "Menambahkan sejumput kejahatan."
tip_hate_computers: "Ada sesuatu mengenai orang yang berpikir bahwa mereka benci komputer. Tetapi yang mereka benci sebenarnya adalah programmer yang buruk. - PI:NAME:<NAME>END_PI"
tip_open_source_contribute: "Kamu dapat membantu CodeCombat menjadi lebih baik!"
tip_recurse: "Mengulang adalah manusiawi, Rekursi adalah ilahi. - PI:NAME:<NAME>END_PI"
tip_free_your_mind: "Kamu harus membiarkan semua berlalu, Neo. Ketakutan, keraguan, ketidak percayaan. Bebaskan pikiranmu - Morpheus"
tip_strong_opponents: "Bahkan lawan yang paling kuat sekalipun selalu memiliki kelemahan. Itachi Uchiha"
tip_paper_and_pen: "Sebelum kamu memulai mengkode, kamu dapat selalu berencana dengan sebuah kertas dan sebuah pena."
tip_solve_then_write: "Pertama-tama, pecahkan masalah. Lalu, tulislah kodenya. - PI:NAME:<NAME>END_PI"
tip_compiler_ignores_comments: "Kadang-kadang saya berpikir bahwa compiler acuh kepada komentar saya."
tip_understand_recursion: "Salah satu cara untuk mengerti rekursif adalah mengerti apa itu rekursif"
tip_life_and_polymorphism: "Sumber Terbuka adalah seperti banyak bentuk struktur yang heterogen: Semua tipe dipersilakan."
tip_mistakes_proof_of_trying: "Kesalahan di kode kamu hanyalah sebuah bukti bahwa kamu sedang mencoba."
tip_adding_orgres: "Membulatkan raksasa."
tip_sharpening_swords: "Menajamkan pedang-pedang"
tip_ratatouille: "Kamu tidak boleh membiarkan semua orang mendefinisikan batasmu, karena tempat asalmu. Batasmu hanyalah jiwamu. - GustPI:NAME:<NAME>END_PIau, PI:NAME:<NAME>END_PIille"
tip_nemo: "Ketika kehidupan membuatmu patah semangat, ingin tahu apa yang harus kamu lakukan? Tetaplah berenang, tetaplah berenang. PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI"
tip_internet_weather: "Baru saja pindah ke internet, di sini sangatlah baik. Kami bisa hidup di dalam di mana cuaca selalu luar biasa. - PI:NAME:<NAME>END_PI"
tip_nerds: "Kutu buku diperbolehkan untuk menyukai sesuatu, seperti melompat-naik-turun-di-kursi-tidak-dapat-mengontrol-diri suka sekali. - PI:NAME:<NAME>END_PI"
tip_self_taught: "Saya mengajari diri saya 90% dari apa yang telah saya pelajari. Dan itu normal! - PI:NAME:<NAME>END_PI"
tip_luna_lovegood: "Jangan khawatir, karena kamu sama warasnya dengan aku. - PI:NAME:<NAME>END_PI"
tip_good_idea: "Cara terbaik untuk memiliki ide baik adalah memiliki ide yang sangat banyak. - PI:NAME:<NAME>END_PI"
tip_programming_not_about_computers: "Ilmu Komputer tidak hanya mengenai komputer sama seperti astronomi tidak hanya seputar teropong. - PI:NAME:<NAME>END_PI"
tip_mulan: "Percayalah apa yang kamu bisa, maka kamu bisa. - Mulan"
project_complete: "Proyek Selesai!"
share_this_project: "Bagikan proyek ini dengan teman-teman atau keluarga:"
ready_to_share: "Siap untuk mempublikasikan proyekmu?"
click_publish: "Klik \"Publikasi\" untuk membuatnya muncul di galeri kelas, lalu cek apakah yang teman sekelasmu buat! Kamu dapat kembali lagi dan melanjutkan proyek ini. Segala perubahan akan secara otomatis disimpan dan dibagikan ke teman sekelas."
already_published_prefix: "Perubahan kamu telah dipublikasikan ke galeri kelas"
already_published_suffix: "Tetaplah bereksperimen dan membuat proyek ini menjadi lebih baik, atau apa saja yang kelasmu telah buat! Perubahanmu akan secara otomatis disimpan dan dibagikan dengan seluruh teman sekelasmu."
view_gallery: "Lihat Galeri"
project_published_noty: "Level kamu telah dipublikasikan!"
keep_editing: "Tetap Sunting"
learn_new_concepts: "Pelajari konsep baru"
watch_a_video: "Tonton video di __concept_name__"
concept_unlocked: "Konsep Tidak Terkunci"
use_at_least_one_concept: "Gunakan setidaknya satu konsep:"
command_bank: "Bank Perintah"
learning_goals: "Tujuan belajar"
start: "Mulai"
vega_character: "Karakter Vega"
click_to_continue: "Klik untuk Melanjutkan"
fill_in_solution: "Isi solusi"
# play_as_humans: "Play As Red"
# play_as_ogres: "Play As Blue"
apis:
methods: "Metode"
events: "Event"
handlers: "Penangan"
properties: "Properti"
snippets: "Cuplikan"
spawnable: "Spawnable"
html: "HTML"
math: "Matematika"
array: "Array"
object: "Objek"
string: "String"
function: "Fungsi"
vector: "Vektor"
date: "Tanggal"
jquery: "jQuery"
json: "JSON"
number: "Number"
webjavascript: "JavaScript"
amazon_hoc:
title: "Terus Belajar dengan Amazon!"
congrats: "Selamat, Anda telah menaklukkan Hour of Code yang menantang itu!"
educate_1: "Sekarang, teruslah belajar tentang coding dan komputasi cloud dengan AWS Educate, program menarik dan gratis dari Amazon untuk siswa dan guru. Dengan AWS Educate, Anda dapat memperoleh lencana keren saat mempelajari dasar-dasar cloud dan pemotongan teknologi canggih seperti game, realitas virtual, dan Alexa. "
educate_2: "Pelajari lebih lanjut dan daftar di sini"
future_eng_1: "Anda juga dapat mencoba membangun keterampilan fakta sekolah Anda sendiri untuk Alexa"
future_eng_2: "di sini"
future_eng_3: "(perangkat tidak diperlukan). Aktivitas Alexa ini dipersembahkan oleh"
future_eng_4: "Insinyur Masa Depan Amazon"
future_eng_5: "program yang menciptakan kesempatan belajar dan bekerja bagi semua siswa K-12 di Amerika Serikat yang ingin mengejar ilmu komputer."
live_class:
title: "Terima kasih!"
content: "Luar biasa! Kami baru saja meluncurkan kelas online langsung."
link: "Siap melanjutkan pengkodean Anda?"
code_quest:
great: "Hebat!"
join_paragraph: "Bergabunglah dengan turnamen pengkodean Python AI internasional terbesar untuk segala usia dan berkompetisi untuk menduduki peringkat teratas papan peringkat! Pertarungan global selama sebulan ini dimulai 1 Agustus dan termasuk hadiah senilai $5.000 dan penghargaan penghargaan tempat kami di virtual mengumumkannya pemenang dan kenali keterampilan pengkodean Anda. "
link: "Klik di sini untuk mendaftar dan belajar lebih lanjut"
global_tournament: "Turnamen Global"
register: "PI:NAME:<NAME>END_PIftar"
date: "1 Agustus - 31 Agustus"
play_game_dev_level:
created_by: "Dibuat oleh {{name}}"
created_during_hoc: "Dibuat ketika Hour of Code"
restart: "Mengulang Level"
play: "Mainkan Level"
play_more_codecombat: "Mainkan Lebih CodeCombat"
default_student_instructions: "Klik untuk mengontrol jagoan kamu dan menangkan game kamu!"
goal_survive: "Bertahan hidup."
goal_survive_time: "Bertahan hidup selama __seconds__ detik."
goal_defeat: "Kalahkan semua musuh."
goal_defeat_amount: "Kalahkan __amount__ musuh."
goal_move: "Bergerak ke semua tanda X merah"
goal_collect: "Kumpulkan semua barang-barang"
goal_collect_amount: "Kumpulkan __amount__ barang."
game_menu:
inventory_tab: "Inventaris"
save_load_tab: "Simpan/Muat"
options_tab: "Opsi"
guide_tab: "Panduan"
guide_video_tutorial: "Panduan Video"
guide_tips: "Saran"
multiplayer_tab: "Multipemain"
auth_tab: "Daftar"
inventory_caption: "Pakai jagoanmu"
choose_hero_caption: "Memilih jagoan, bahasa"
options_caption: "Mengkonfigurasi pengaturan"
guide_caption: "Dokumen dan saran"
multiplayer_caption: "Bermain bersama teman-teman!"
auth_caption: "Simpan perkembanganmu"
leaderboard:
view_other_solutions: "Lihat Peringkat Pemain"
scores: "Skor"
top_players: "Permain teratas dalam"
day: "Hari ini"
week: "Minggu ini"
all: "Sepanjang waktu"
latest: "Terakhir"
time: "Waktu menang"
damage_taken: "Kerusakan yang Diterima"
damage_dealt: "Kerusakan yang Diberikan"
difficulty: "Kesulitan"
gold_collected: "Emas yang dikumpulkan"
survival_time: "Bertahan Hidup"
defeated: "Lawan yang Dikalahkan"
code_length: "Baris Kode"
score_display: "__scoreType__: __score__"
inventory:
equipped_item: "Terpakai"
required_purchase_title: "Wajib"
available_item: "Tersedia"
restricted_title: "Terlarang"
should_equip: "(klik ganda untuk memakai)"
equipped: "(terpakai)"
locked: "(terkunci)"
restricted: "(terlarang di level ini)"
equip: "Pakai"
unequip: "Lepas"
warrior_only: "Kesatria Saja"
ranger_only: "Pemanah Saja"
wizard_only: "Penyihir Saja"
buy_gems:
few_gems: "Sedikit permata"
pile_gems: "Tumpukan permata"
chest_gems: "Peti penuh permata"
purchasing: "Membeli..."
declined: "Kartumu ditolak"
retrying: "Terjadi kesalahan di server, mencoba kembali"
prompt_title: "Permata Tidak Cukup"
prompt_body: "Ingin mendapatkan lebih?"
prompt_button: "Masuk Toko"
recovered: "Pembelian permata sebelumnya dipulihkan. Silakan perbaharui halaman."
price: "x{{gems}} / bln"
buy_premium: "Beli Premium"
purchase: "Membeli"
purchased: "Terbeli"
subscribe_for_gems:
prompt_title: "Permata Tidak Cukup!"
prompt_body: "Berlangganan Premium untuk mendapatkan permata dan akses ke lebih banyak level!"
earn_gems:
prompt_title: "Permata Tidak Cukup"
prompt_body: "Tetap bermain untuk mendapatkan lebih!"
subscribe:
best_deal: "Transaksi Terbaik!"
confirmation: "Selamat! Kamu telah berlangganan CodeCombat Premium!"
premium_already_subscribed: "Kamu telah berlangganan Premium"
subscribe_modal_title: "CodeCombat Premium"
comparison_blurb: "Menjadi Penguasa Kode - berlangganan <b>Premium</b> hari ini!"
must_be_logged: "Kamu harus masuk terlebih dahulu. Silakan buat akun atau masuk dari menu di atas"
subscribe_title: "Berlangganan" # Actually used in subscribe buttons, too
unsubscribe: "Berhenti Berlangganan"
confirm_unsubscribe: "Konfirmasi Berhenti Berlangganan"
never_mind: "Tidak masalah, Aku Masih Suka Kamu"
thank_you_months_prefix: "Terima kasih telah mendukung kami hingga saat ini"
thank_you_months_suffix: "bulan."
thank_you: "Terima kasih telah mendukung CodeCombat."
sorry_to_see_you_go: "Kami sedih melihat kamu pergi! Tolong beritahu, apa yang bisa kami lakukan untuk menjadi lebih baik."
unsubscribe_feedback_placeholder: "Oh, apa yang telah kami lakukan?"
stripe_description: "Berlangganan Bulanan"
stripe_yearly_description: "Langganan Tahunan"
buy_now: "Beli Sekarang"
subscription_required_to_play: "Kamu butuh berlangganan untuk memainkan level ini."
unlock_help_videos: "Berlangganan untuk membuka semua panduan video."
personal_sub: "Langganan Pribadi" # Accounts Subscription View below
loading_info: "Memuat informasi langganan..."
managed_by: "Diatur oleh"
will_be_cancelled: "Akan dibatalkan"
currently_free: "Kamu memiliki langganan gratis"
currently_free_until: "Kamu saat ini memiliki langganan hingga"
free_subscription: "Berlangganan gratis"
was_free_until: "Kamu memiliki langganan gratis hingga"
managed_subs: "Mengatur Langganan"
subscribing: "Berlangganan..."
current_recipients: "Penerima Saat Ini"
unsubscribing: "Berhenti Berlangganan"
subscribe_prepaid: "Klik Berlangganan untuk menggunakan kode prabayar"
using_prepaid: "Menggunakan kode prabayar untuk berlangganan bulanan"
feature_level_access: "Akses 300+ level tersedia"
feature_heroes: "Membuka jagoan dan peliharaan ekslusif"
feature_learn: "Belajar membuat permainan dan situs web"
feature_gems: "Terima permata __gems__ per bulan"
month_price: "$__price__" # {change}
first_month_price: "Hanya $__price__ untuk bulan pertamamu!"
lifetime: "Akses Seumur Hidup"
lifetime_price: "$__price__"
year_subscription: "Berlangganan Tahunan"
year_price: "$__price__/year" # {change}
support_part1: "Membutuhkan bantuan pembayaran atau memilih PayPal? Email"
support_part2: "PI:EMAIL:<EMAIL>END_PI"
announcement:
now_available: "Sekarang tersedia untuk pelanggan!"
subscriber: "pelanggan"
cuddly_companions: "Sahabat yang Menggemaskan!" # Pet Announcement Modal
kindling_name: "Kindling Elemental"
kindling_description: "Kindling Elementals hanya ingin membuat Anda tetap hangat di malam hari. Dan di siang hari. Sepanjang waktu, sungguh."
griffin_name: "PI:NAME:<NAME>END_PI"
griffin_description: "Griffin adalah setengah elang, setengah singa, semuanya menggemaskan."
raven_name: "Raven"
raven_description: "Burung gagak sangat ahli dalam mengumpulkan botol berkilau yang penuh dengan kesehatan untuk Anda."
mimic_name: "Mimic"
mimic_description: "Mimik dapat mengambil koin untuk Anda. Pindahkan ke atas koin untuk meningkatkan persediaan emas Anda."
cougar_name: "PI:NAME:<NAME>END_PIgar"
cougar_description: "Para cougar ingin mendapatkan gelar PhD dengan Mendengkur dengan Bahagia Setiap Hari."
fox_name: "PI:NAME:<NAME>END_PI"
fox_description: "Rubah biru sangat pintar dan suka menggali tanah dan salju!"
pugicorn_name: "PI:NAME:<NAME>END_PI"
pugicorn_description: "Pugicorn adalah salah satu makhluk paling langka dan bisa merapal mantra!"
wolf_name: "PI:NAME:<NAME>END_PI"
wolf_description: "Anak anjing serigala unggul dalam berburu, mengumpulkan, dan memainkan permainan petak umpet!"
ball_name: "PI:NAME:<NAME>END_PI"
ball_description: "ball.squeak()"
collect_pets: "Kumpulkan hewan peliharaan untuk pahlawanmu!"
each_pet: "Setiap hewan memiliki kemampuan penolong yang unik!"
upgrade_to_premium: "Menjadi {{subscriber}} untuk melengkapi hewan peliharaan."
play_second_kithmaze: "Mainkan {{the_second_kithmaze}} untuk membuka kunci Anjing Serigala!"
the_second_kithmaze: "Kithmaze Kedua"
keep_playing: "Terus bermain untuk menemukan hewan peliharaan pertama!"
coming_soon: "Segera hadir"
ritic: "PI:NAME:<NAME>END_PI CPI:NAME:<NAME>END_PI" # Ritic Announcement Modal
ritic_description: "Ritic the Cold. Terjebak di PI:NAME:<NAME>END_PI selama berabad-abad, akhirnya bebas dan siap merawat para ogre yang memenjarakannya."
ice_block: "Satu balok es"
ice_description: "Tampaknya ada sesuatu yang terperangkap di dalam ..."
blink_name: "Blink"
blink_description: "Ritika menghilang dan muncul kembali dalam sekejap mata, hanya meninggalkan bayangan."
shadowStep_name: "Shadowstep"
shadowStep_description: "Seorang pembunuh bayaran tahu bagaimana berjalan di antara bayang-bayang."
tornado_name: "Tornado"
tornado_description: "Sebaiknya ada tombol setel ulang saat penutup seseorang meledak."
wallOfDarkness_name: "Wall of Darkness"
wallOfDarkness_description: "Bersembunyi di balik dinding bayangan untuk mencegah tatapan mata yang mengintip."
avatar_selection:
pick_an_avatar: "Pilih avatar yang akan mewakili Anda sebagai pemain"
premium_features:
get_premium: "Dapatkan<br>CodeCombat<br>Premium" # Fit into the banner on the /features page
master_coder: "Menjadi seorang Master Kode dengan berlangganan sekarang!"
paypal_redirect: "Kamu akan dialihkan ke PayPal untuk menyelesaikan proses berlanggangan."
subscribe_now: "Berlangganan Sekarang"
hero_blurb_1: "Dapatkan akses ke __premiumHeroesCount__ jagoan pengisian-super khusus-pelanggan! Manfaatkan kekuatan tak terbendung dari PI:NAME:<NAME>END_PI, keakuratan yang mematikan dari Naria si Daun, atau memanggil \"menggemaskan\" kerangka oleh PI:NAME:<NAME>END_PI."
hero_blurb_2: "Kesatria Premium membuka kemampuan beladiri yang menakjubkan seperti Warcry, Stomp, dan Hurl Enemy. Atau, bermain sebagai Pemanah, menggunakan panah dan tidak terdeteksi, melempar pisau, jebakan! Coba kemampuanmu sebagai Penyihir sejati, dan melepaskan susunan Primodial yang kuat, Ilmu Nujum ataupun Elemen Ajaib!"
hero_caption: "Hero baru yang menarik!"
pet_blurb_1: "Peliharaan tidak hanya sebagai teman yang menggemaskan, tetapi mereka juga menyediakan fungsionalitas dan metode unik. Bayi Grifon dapat membawa unit melalui udara, Anak Serigala bermain tangkap dengan panah musuh, Puma suka mengejar raksasa, dan Mimic menarik koin seperti magnet!"
pet_blurb_2: "Koleksi semua peliharaan untuk mengetahui kemampuan unik mereka!"
pet_caption: "Asuh peliharaanmu untuk menemani jagoanmu!"
game_dev_blurb: "Belajar menulis game dan membangun level baru untuk dibagikan kepada teman-temanmu! Taruh barang yang kamu mau, tulis kode untuk logika unit dan tingkah laku, lalu saksikan apakah temanmu dapat menyelesaikan level itu!"
game_dev_caption: "Desain gamemu sendiri untuk menantang teman-temanmu!"
everything_in_premium: "Semuanya kamu dapatkan di CodeCombat Premium:"
list_gems: "Dapatkan bonus permata untuk membeli perlengkapan, peliharaan, dan jagoan"
list_levels: "Dapatkan akses untuk __premiumLevelsCount__ level lebih banyak"
list_heroes: "Membuka jagoan eksklusif, termasuk kelas Pemanah dan Penyihir"
list_game_dev: "Buat dan bagikan game dengan teman-teman"
list_web_dev: "Bangun situs web dan aplikasi interaktif"
list_items: "Pakai benda Premium seperti peliharaan"
list_support: "Dapatkan bantuan Premium untuk menolongmu men-debug kode yang rumit"
list_clans: "Buatlah klan pribadi untuk mengundang teman-temanmu dan berkompetisi di grup peringkat pemain"
choose_hero:
choose_hero: "Pilih Jagoan Kamu"
programming_language: "Bahasa Pemrograman"
programming_language_description: "Bahasa pemrograman mana yang ingin kamu gunakan?"
default: "Bawaan"
experimental: "Eksperimental"
python_blurb: "Sederhana tapi kuat, cocok untuk pemula dan ahli."
javascript_blurb: "Bahasa untuk web. (Tidak sama dengan Java.)"
coffeescript_blurb: "Sintaksis JavaScript yang lebih bagus"
lua_blurb: "Bahasa untuk Skrip Permainan"
java_blurb: "(Khusus Pelanggan) Android dan perusahaan."
cpp_blurb: "(Khusus Pelanggan) Pengembangan game dan komputasi kinerja tinggi."
status: "Status"
weapons: "Senjata"
weapons_warrior: "Pedang - Jarak Dekat, Tanpa Sihir"
weapons_ranger: "Busur Silang, Senapan - Jarak Jauh, Tanpa Sihir"
weapons_wizard: "Tongkat pendek, Tongkat panjang - Jarak Jauh, Sihir"
attack: "Kerusakan" # Can also translate as "Attack"
health: "Kesehatan"
speed: "Kecepatan"
regeneration: "Regenerasi"
range: "Jarak" # As in "attack or visual range"
blocks: "Tangkisan" # As in "this shield blocks this much damage"
backstab: "Tusukan Belakang" # As in "this dagger does this much backstab damage"
skills: "Kemampuan"
attack_1: "Memberikan"
attack_2: "sejumlah"
attack_3: "kerusakan senjata."
health_1: "Mendapatkan"
health_2: "sejumlah"
health_3: "sekehatan dari baju besi."
speed_1: "Bergerak sejauh"
speed_2: "meter perdetik."
available_for_purchase: "Tersedia untuk Dibeli" # Shows up when you have unlocked, but not purchased, a hero in the hero store
level_to_unlock: "Level untuk dibuka:" # Label for which level you have to beat to unlock a particular hero (click a locked hero in the store to see)
restricted_to_certain_heroes: "Hanya beberapa jagoan yang bisa memainkan level ini."
char_customization_modal:
heading: "Sesuaikan Pahlawan Anda"
body: "PI:NAME:<NAME>END_PIan"
name_label: "PI:NAME:<NAME>END_PI"
hair_label: "Warna Rambut"
skin_label: "Warna Kulit"
skill_docs:
function: "fungsi" # skill types
method: "metode"
snippet: "snippet"
number: "nomor"
array: "larik"
object: "objek"
string: "string"
writable: "dapat ditulis" # Hover over "attack" in Your Skills while playing a level to see most of this
read_only: "hanya-bisa-dibaca"
action: "Tindakan"
spell: "Mantra"
action_name: "nama"
action_cooldown: "Membawa"
action_specific_cooldown: "Tenang"
action_damage: "Kerusakan"
action_range: "Jangkauan"
action_radius: "Radius"
action_duration: "Durasi"
example: "Contoh"
ex: "contoh" # Abbreviation of "example"
current_value: "Nilai Saat Ini"
default_value: "Nilai default"
parameters: "Parameter"
required_parameters: "Parameter Wajib"
optional_parameters: "Parameter Opsional"
returns: "Mengembalikan"
granted_by: "Diberikan oleh"
still_undocumented: "Masih tidak berdokumen, maaf."
save_load:
granularity_saved_games: "Tersimpan"
granularity_change_history: "Riwayat"
options:
general_options: "Opsi Umum" # Check out the Options tab in the Game Menu while playing a level
volume_label: "Suara"
music_label: "Musik"
music_description: "Mengubah musik latar menyala/mati."
editor_config_title: "Konfigurasi Editor"
editor_config_livecompletion_label: "Otomatisasi Komplit"
editor_config_livecompletion_description: "Menunjukkan saran otomatis komplit selagi mengetik"
editor_config_invisibles_label: "Tunjukkan yang Kasat Mata"
editor_config_invisibles_description: "Menunjukkan yang kasat mata seperti spasi ataupun tabulasi."
editor_config_indentguides_label: "Tunjukkan Panduan Indentasi"
editor_config_indentguides_description: "Menunjukkan garis vertikal untuk melihat indentasi lebih baik."
editor_config_behaviors_label: "Bantuan Cerdas"
editor_config_behaviors_description: "Otomatis komplit tanda kurung, kurung kurawal, dan tanda petik."
about:
title: "Tentang CodeCombat - Melibatkan Siswa, Memberdayakan Guru, Kreasi yang Menginspirasi"
meta_description: "Misi kami adalah meningkatkan ilmu komputer melalui pembelajaran berbasis game dan membuat pengkodean dapat diakses oleh setiap pelajar. Kami percaya pemrograman adalah keajaiban dan ingin para pelajar diberdayakan untuk menciptakan berbagai hal dari imajinasi murni."
learn_more: "Pelajari lebih lanjut"
main_title: "Jika kamu ingin belajar memprogram, kamu membutuhkan menulis (banyak) kode."
main_description: "Dalam CodeCombat, tugas kamu adalah memastikan kamu melakukannya dengan senyum diwajahmu."
mission_link: "Misi"
team_link: "Tim"
story_link: "Cerita"
press_link: "Pers"
mission_title: "Misi kami: membuat pemrogramman dapat diakses oleh semua siswa di Bumi."
mission_description_1: "<strong>Pemrograman itu ajaib!</strong>. Kemampuannya untuk membuat sesuatu dari imajinasi. Kami memulai CodeCombat untuk memberikan para pelajar kekuatan ajaib yang berada di ujung jemari dengan menggunakan <strong>kode yang ditulis</strong>."
mission_description_2: "Metode ini membuat siswa belajar lebih cepat. JAUH lebih cepat. Seperti sedang bercakap-cakap, bukan seperti membaca buku petunjuk. Kami ingin membawa percakapan tersebut ke setiap sekolah dan ke <strong>semua siswa</strong>, karena semuanya harus memiliki kesempatan untuk belajar keajaiban pemrograman."
team_title: "Bertemu dengan tim CodeCombat"
team_values: "Kami menghargai dialog terbuka dan sopan, dimana ide terbaiklah yang menang. Keputusan kami didasari dari riset pelanggan dan proses kami berfokus pada penyerahan hasil yang jelas kepada mereka. Semuanya turut serta mulai dari CEO sampai ke kontributor Github, karena kami menghargai perkembangan dan pembelajaran dalam tim kami."
nick_title: "Cofounder, CEO"
# csr_title: "Customer Success Representative"
csm_title: "Manajer Kesuksesan Pelanggan"
scsm_title: "Manajer Sukses Pelanggan Senior"
ae_title: "Akun Eksekutif"
sae_title: "Akun Eksekutif Senior"
sism_title: "Manajer Penjualan Senior"
shan_title: "Kepala Pemasaran, CodeCombat Greater China"
run_title: "Kepala Operasi, CodeCombat Greater China"
lance_title: "Kepala Teknologi, CodeCombat Greater China"
zhiran_title: "Kepala Kurikulum, CodeCombat Greater China"
yuqiang_title: "Kepala Inovasi, CodeCombat Greater China"
swe_title: "Insinyur Perangkat Lunak"
sswe_title: "Insinyur Perangkat Lunak Senior"
css_title: "Pakar Dukungan Pelanggan"
css_qa_title: "Dukungan Pelanggan / Spesialis QA"
maya_title: "Pengembang Kurikulum Senior"
bill_title: "Manajer Umum, CodeCombat Greater China"
pvd_title: "Produk dan Desainer Visual"
spvd_title: "Produk Senior dan Desainer Visual"
daniela_title: "Manajer Pemasaran"
bobby_title: "Perancang Game"
brian_title: "Manajer Desain Game Senior"
stephanie_title: "Pakar Dukungan Pelanggan"
sdr_title: "Perwakilan Pengembangan Penjualan"
retrostyle_title: "Ilustrasi"
retrostyle_blurb: "Permainan RetroStyle"
community_title: "...dan komunitas sumber terbuka kami"
# lgd_title: "Lead Game Designer"
oa_title: "Operations Associate"
ac_title: "Koordinator Administratif"
ea_title: "Asisten Eksekutif"
om_title: "Manajer Operasi"
mo_title: "Manajer, Operasi"
smo_title: "Manajer Senior, Operasi"
# do_title: "Director of Operations"
scd_title: "Pengembang Kurikulum Senior"
lcd_title: "Pimpinan Pengembang Kurikulum"
# de_title: "Director of Education"
vpm_title: "Wakil Presiden, Pemasaran"
# oi_title: "Online Instructor"
# aoim_title: "Associate Online Instructor Manager"
# bdm_title: "Business Development Manager"
community_subtitle: "Lebih dari 500 kontributor telah membantu membangun CodeCombat, dan lebih banyak lagi yang bergabung tiap minggunya!" # {change}
community_description_3: "CodeCombat adalah"
community_description_link_2: "proyek komunitas"
community_description_1: " dengan ratusan jumlah pemain suka rela membuat level, berkontribusi dengan kode kami dan menambahkan fitur, memperbaiki bugs, mengetes, dan juga mengalihbahasakan game ke dalam 50 bahasa sampai saat ini. Karyawan, kontributor dan perolehan situs dari berbagi ide dan usaha bersama, sebagaimana komunitas sumber terbuka umumnya. Situs ini dibuat dari berbagai proyek sumber terbuka, dan kami membuka sumber untuk diberikan kembali kepada komunitas dan menyediakan pemain yang penasaran-dengan-kode proyek yang mudah untuk dieksplorasi dan dijadikan eksperimen. Semua dapat bergabung di komunitas CodeCombat! Cek "
community_description_link: "halaman kontribusi"
community_description_2: "untuk info lebih lanjut."
number_contributors: "Lebih dri 450 kontributor telah meminjamkan dukungan dan waktu untuk proyek ini." # {change}
story_title: "Kisah kami sejauh ini"
story_subtitle: "Dari 2013, CodeCombat telah berkembang dari sekedar kumpulan sketsa sampai ke permainan yang hidup dan berkembang."
story_statistic_1a: "20,000,000+"
story_statistic_1b: "total pemain"
story_statistic_1c: "telah memulai perjalanan pemrograman mereka melalui CodeCombat"
story_statistic_2a: "Kami telah menerjemahkan ke lebih dari 50 bahasa - pemain kami berasal"
story_statistic_2b: "190+ negara"
story_statistic_3a: "Bersama, mereka telah menulis"
story_statistic_3b: "1 miliar baris kode dan terus bertambah"
story_statistic_3c: "di banyak bahasa pemrograman yang berbeda"
story_long_way_1: "Kami melalui perjalanan yang panjang..."
story_sketch_caption: "Sketsa paling pertama milik Nick menggambarkan permainan pemrograman sedang beraksi."
story_long_way_2: "masih banyak yang harus kami lakukan sebelum menyelesaikan pencarian kami, jadi..."
jobs_title: "Mari bekerja bersama kami dan membantu menulis sejarah CodeCombat!"
jobs_subtitle: "Tidak cocok tetapi berminat untuk tetap berhubungan? Lihat daftar \"Buat Sendiri\" kami"
jobs_benefits: "Keuntungan Karyawan"
jobs_benefit_4: "Liburan tanpa batas"
jobs_benefit_5: "Pengembangan profesional dan dukungan melanjutkan pendidikan - buku gratis dan permainan!"
jobs_benefit_6: "Pengobatan (level emas), perawatan gigi, perawatan mata, perjalanan, 401K"
jobs_benefit_7: "Meja duduk-berdiri untuk semua"
jobs_benefit_9: "Jendela latihan opsional 10 tahun"
jobs_benefit_10: "Cuti Kelahiran (Wanita): 12 minggu dibayar, 6 berikutnya @ 55% gaji"
jobs_benefit_11: "Cuti Kelahiran (Pria): 12 minggu dibayar"
jobs_custom_title: "Buat Sendiri"
jobs_custom_description: "Apakah kamu berhasrat dengan CodeCombat tetapi tidka melihat daftar pekerjaan yang sesuai dengan kualifikasimu? Tulis dan tunjukkan kami, bagaimana kamu pikir kamu dapat berkontribusi di tim kami. Kami ingin mendengarnya darimu!"
jobs_custom_contact_1: "Kirim kami catatan di"
jobs_custom_contact_2: "perkenalkan dirimu dan kami mungkin dapat menghubungi di kemudian hari!"
contact_title: "Kontak & Pers"
contact_subtitle: "Butuh informasi lebih lanjut? Hubungi kami di"
screenshots_title: "Tangkapan Layar Game"
screenshots_hint: "(klik untuk melihat ukuran penuh)"
downloads_title: "Unduh Aset & Informasi"
about_codecombat: "Mengenai CodeCombat"
logo: "Logo"
screenshots: "Tangkapan layar"
character_art: "Seni Karakter"
download_all: "Unduh Semua"
previous: "Sebelum"
location_title: "Kamu berada di pusat kota San Fransisco:"
teachers:
licenses_needed: "Lisensi dibutuhkan"
special_offer:
special_offer: "Penawaran Spesial"
project_based_title: "Kursus Berbasis Proyek"
project_based_description: "Proyek Akhir Fitur Kursus Web dan Pengembangan Permainan yang dapat dibagikan"
great_for_clubs_title: "Sangat baik untuk klub dan kelompok belajar"
great_for_clubs_description: "Guru dapat membeli sampai __maxQuantityStarterLicenses__ Lisensi Awal."
low_price_title: "Hanya __starterLicensePrice__ persiswa"
low_price_description: "Lisensi awal akan aktif selama __starterLicenseLengthMonths__ bulan dari pembelian."
three_great_courses: "Tiga kursus terbaik yang termasuk ke dalam Lisensi Awal:"
license_limit_description: "Guru dapat membeli sampai __maxQuantityStarterLicenses__ Lisensi Awal. Kamu telah membeli __quantityAlreadyPurchased__. Jika kamu membutuhkan lebih, hubungi __supportEmail__. Lisensi awal akan valid selama __starterLicenseLengthMonths__ bulan."
student_starter_license: "Lisensi Awal Siswa"
purchase_starter_licenses: "Membeli Lisensi Awal"
purchase_starter_licenses_to_grant: "Membeli Lisensi Awal untuk mendapatkan akses ke __starterLicenseCourseList__"
starter_licenses_can_be_used: "Lisensi Awal dapat digunakan untuk mendaftar ke kursus tambahan segera setelah pembelian."
pay_now: "Bayar Sekarang"
we_accept_all_major_credit_cards: "Kami menerima semua jenis kartu kredit."
cs2_description: "membangun diatas fondasi dari Pengenalan Ilmu Komputer, menuju ke if-statement, functions, event, dan lainnya."
wd1_description: "memperkenalkan dasar dari HTML dan CSS selagi mengajarkan kemampuan yang dibutuhkan siswa untuk membangun halaman web mereka yang pertama."
gd1_description: "menggunakan sintaks yang siswa sudah kenal dengan menunjukkan mereka bagaimana cara membuat dan membagikan level permainan yang dapat dimainkan."
see_an_example_project: "lihat contoh proyek"
get_started_today: "Mulailah sekarang!"
want_all_the_courses: "Ingin semua kursus? Minta informasi ke Lisensi Penuh kami."
compare_license_types: "Bandingkan Tipe Lisensi:"
cs: "Ilmu Komputer"
wd: "Mengembangkan Web"
wd1: "Mengembangkan Web 1"
gd: "Mengembangkan Permainan"
gd1: "Mengembangkan Permainan 1"
maximum_students: "Maksimum # Siswa"
unlimited: "Tak terbatas"
priority_support: "Bantuan prioritas"
yes: "Ya"
price_per_student: "__price__ persiswa"
pricing: "Harga"
free: "Gratis"
purchase: "Beli"
courses_prefix: "Kursus"
courses_suffix: ""
course_prefix: "Kursus"
course_suffix: ""
teachers_quote:
subtitle: "Pelajari lebih lanjut tentang CodeCombat dengan panduan interaktif tentang produk, harga, dan implementasi!"
email_exists: "User telah ada dengan email ini."
phone_number: "Nomor telepon"
phone_number_help: "Dimanakah kami dapat menjangkau kamu ketika hari bekerja?"
primary_role_label: "Peran Utama Kamu"
role_default: "Pilih Peran"
primary_role_default: "Pilih Peran Utama"
purchaser_role_default: "Pilih Peran Pembeli"
tech_coordinator: "Koordinator Teknologi"
advisor: "PI:NAME:<NAME>END_PI/PI:NAME:<NAME>END_PI"
principal: "Kepala Sekolah"
superintendent: "Pengawas"
parent: "Orang Tua"
purchaser_role_label: "Peran Pembeli Kamu"
influence_advocate: "Mempengaruhi/Menganjurkan"
evaluate_recommend: "Evaluasi/Rekomendasi"
approve_funds: "Menerima Dana"
no_purchaser_role: "Tidak ada peran dalam pemilihan pembelian"
district_label: "Wilayah"
district_name: "Nama Wilayah"
district_na: "Masukkan N/A jika tidak ada"
organization_label: "Sekolah"
school_name: "Nama Sekolah"
city: "Kota"
state: "Provinsi / Wilayah"
country: "Negara"
num_students_help: "Berapa banyak siswa yang akan menggunakan CodeCombat"
num_students_default: "Pilih Jumlah"
education_level_label: "Level Edukasi Siswa"
education_level_help: "Pilih sebanyak yang akan mendaftar."
elementary_school: "Sekolah Dasar"
high_school: "Sekolah Menengah Atas"
please_explain: "(Tolong Dijabarkan)"
middle_school: "Sekolah Menengah Pertama"
college_plus: "Mahasiswa atau lebih tinggi"
referrer: "Bagaimana kamu mengetahui mengenai kami?"
referrer_help: "Sebagai contoh: dari guru lain, dari konferensi, dari siswa anda, Code.org, dsb."
referrer_default: "Pilih Salah Satu"
referrer_conference: "Konferensi (misalnya ISTE)"
referrer_hoc: "Code.org/Hour of Code"
referrer_teacher: "Guru"
referrer_admin: "Administrator"
referrer_student: "Siswa"
referrer_pd: "Pelatihan profesional/workshops"
referrer_web: "Google"
referrer_other: "Lainnya"
anything_else: "Kelas yang seperti apa yang kamu perkirakan untuk menggunakan CodeCombat?"
anything_else_helper: ""
thanks_header: "Permintaan Diterima!"
thanks_sub_header: "Terima kasih telah menyatakan ketertarikan dalam CodeCombat untuk sekolahmu."
thanks_p: "Kamu akan menghubungi segera! Jika kamu membutuhkan kontak, kamu bisa menghubungi di:"
back_to_classes: "Kembali ke Kelas"
finish_signup: "Selesai membuat akun gurumu:"
finish_signup_p: "Membuat akun untuk mempersiapkan kelas, menambah siswamu, dan mengawasi perkembangan mereka selagi mereka belajar ilmu komputer."
signup_with: "Masuk dengan:"
connect_with: "Terhubung dengan:"
conversion_warning: "PERHATIAN: Akunmu saat ini adalah <em>Akun Siswa</em>. Setelah kamu mengirim form ini, akunmu akan diubah menjadi akun Guru"
learn_more_modal: "Akun guru di CodeCombat memiliki kemampuan untuk mengawasi perkembangan siswa, menetapkan lisensi, dan mengatur ruang kelas. Akun guru tidak dapat menjadi bagian dari kelas - Jika kamu saat ini mengikuti kelas menggunakan akun ini, maka kamu tidak dapat lagi mengaksesnya setelah kamu mengubahnya menjadi Akun Guru"
create_account: "Membuat Akun Guru"
create_account_subtitle: "Dapatkan akses peralatan hanya untuk guru jika menggunakan CodeCombat di ruang kelas. <strong>Mempersiapkan kelas</strong>, menambah siswamu, dan <strong>mengawasi perkembangan mereka</strong>!"
convert_account_title: "Ubah ke Akun Guru"
not: "Tidak"
full_name_required: "Diperlukan nama depan dan belakang"
versions:
save_version_title: "Simpan Versi Baru"
new_major_version: "Versi Mayor Baru"
submitting_patch: "Mengirim Perbaikan..."
cla_prefix: "Untuk menyimpan perubahan, pertama-tama kamu harus setuju dengan"
cla_url: "CLA"
cla_suffix: "."
cla_agree: "SAYA SETUJU"
owner_approve: "Pemilik akan menerimanya sebelum kamu perubahanmu akan terlihat"
contact:
contact_us: "PI:NAME:<NAME>END_PI"
welcome: "Senang mendengar dari kamu! Gunakanlah form ini untuk mengirim kami email. "
forum_prefix: "Untuk segala sesuatu yang bersifat umum, silakan coba "
forum_page: "forum kami"
forum_suffix: "."
faq_prefix: "Selain itu, ada juga"
faq: "FAQ"
subscribe_prefix: "Jika kamu membutuhkan bantuan untuk mencari tau sebuah level, silakan"
subscribe: "beli langganan CodeCombat"
subscribe_suffix: "dan kamu akan dengan senang membantu kamu dengan kodemu."
subscriber_support: "Karena kamu adalah seorang pelanggan CodeCombat, emailmu akan menerima dukungan prioritas dari kami."
screenshot_included: "Tangkapan layar termasuk."
where_reply: "Dimanakah kamu harus membalas?"
send: "Kirim Umpan Balik"
account_settings:
title: "Pengaturan Akun"
not_logged_in: "Masuk atau buat akun untuk mengganti pengaturanmu."
me_tab: "Saya"
picture_tab: "Gambar"
delete_account_tab: "Hapus Akunmu"
wrong_email: "Email Salah"
wrong_password: "PI:PASSWORD:<PASSWORD>END_PIata Kunci Salah"
delete_this_account: "Hapus akun ini permanen"
reset_progress_tab: "Ulang Semua Perkembangan"
reset_your_progress: "Hapus semua perkembanganmu dan memulai lagi dari awal"
god_mode: "Mode Dewa"
emails_tab: "Email"
admin: "Admin"
manage_subscription: "Klik di sini untuk mengatur langganganmu."
new_password: "PI:PASSWORD:<PASSWORD>END_PI"
new_password_verify: "PI:PASSWORD:<PASSWORD>END_PI"
type_in_email: "Ketik dalam email atau nama penggunamu untuk memastikan penghapusan akun."
type_in_email_progress: "Tulis di emailmu untuk memastikan penghapusan kemajuan kamu."
type_in_password: "Dan juga ketik kata kuncimu"
email_subscriptions: "Langganan Email"
email_subscriptions_none: "Tidak ada Langganan Email."
email_announcements: "Pengumuman"
email_announcements_description: "Dapatkan email untuk berita terakhir dan pengembangan dari CodeCombat"
email_notifications: "Pemberitahuan"
email_notifications_summary: "Atur untuk pengaturan pribadi, email pemberitahuan otomatis terkait dengan aktivitas CodeCombatmu."
email_any_notes: "Semua Pemberitahuan"
email_any_notes_description: "Nonaktifkan untuk berhenti semua aktivitas pemberitahuan email"
email_news: "Berita"
email_recruit_notes: "Lowongan Pekerjaan"
email_recruit_notes_description: "Jika kamu bermain dengan baik, kami akan memberitahumu mengenai lowongan (yang lebih baik) pekerjaan."
contributor_emails: "Email Kontributor Kelas"
contribute_prefix: "Kami mencari orang-orang untuk bergabung dengan tim kami. Cek "
contribute_page: "halaman kontribusi"
contribute_suffix: " untuk mengetahui lebih lanjut."
email_toggle: "Ubah Alih Semuanya"
error_saving: "Gagal Menyimpan"
saved: "Perubahan Disimpan"
password_mismatch: "Kata sandi tidak sama."
password_repeat: "PI:PASSWORD:<PASSWORD>END_PI."
keyboard_shortcuts:
keyboard_shortcuts: "Tombol Pintas Keyboard"
space: "Spasi"
enter: "Enter"
press_enter: "tekan enter"
escape: "Escape"
shift: "Shift"
run_code: "Jalankan kode saat ini."
run_real_time: "Jalankan dalam waktu nyata."
continue_script: "Melanjutkan melewati skrip saat ini."
skip_scripts: "Lewati semua skrip yang dapat dilewati."
toggle_playback: "Beralih mulai/berhenti."
scrub_playback: "Menggeser mundur dan maju melewati waktu."
single_scrub_playback: "Menggeser mundur dan maju melewati waktu dalam sebuah frame."
scrub_execution: "Menggeser melalui eksekusi mantera saat ini"
toggle_debug: "Beralih tampilan debug."
toggle_grid: "Beralih lembaran kotak-kotak."
toggle_pathfinding: "Beralih lembaran mencari jalan."
beautify: "Percantik kodemu dengan menstandarisasi formatnya."
maximize_editor: "Memaksimalkan/meminimalisasi editor kode."
cinematic:
click_anywhere_continue: "klik di mana saja untuk melanjutkan"
community:
main_title: "Komunitas CodeCombat"
introduction: "Cek cara kamu dapat terlibat di bawah ini dan putuskan apa yang terdengar paling menyenangkan. Kami berharap dapat bekerja dengan kamu!"
level_editor_prefix: "Gunakan CodeCombat"
level_editor_suffix: "untuk membuat dan mengubah level. Pengguna dapat membuat level untuk kelas mereka, teman, hackathons, para siswa, dan saudara. Jika membuat sebuah level baru terdengar mengintimidasi, kamu bisa memulainya dengan membuat cabang salah satu dari milik kami!"
thang_editor_prefix: "Kami memanggil unit dalam game 'thangs'. Gunakan"
thang_editor_suffix: "untuk memodifikasi CodeCombat sumber karya seni. Perbolehkan unit untuk melempar proyektil, mengubah arah dari animasi, mengganti hit point unit, atau mengunggah vektor sprite milikmu."
article_editor_prefix: "Melihat ada kesalahan dalam dokumentasi kami? Ingin membuat beberapa instruksi untuk karakter buatanmu? Lihat"
article_editor_suffix: "dan bantu pemain CodeCombat untuk mendapatkan hasil maksimal dari waktu bermain mereka."
find_us: "Temukan kami di situs-situs berikut"
social_github: "Lihat semua kode kami di Github"
social_blog: "Baca blog CodeCombat"
social_discource: "Bergabung dalam diskusi di forum Discourse kami"
social_facebook: "Like CodeCombat di Facebook"
social_twitter: "Follow CodeCombat di Twitter"
social_slack: "Mengobrol bersama kami di channel publik Slack CodeCombat"
contribute_to_the_project: "Berkontribusi pada proyek"
clans:
title: "Bergabung dengan Klan CodeCombat - Belajar Membuat Kode dengan Python, JavaScript, dan HTML"
clan_title: "__clan__ - Bergabung dengan Klan CodeCombat dan Belajar Membuat Kode"
meta_description: "Bergabunglah dengan Klan atau bangun komunitas pembuat kode Anda sendiri. Mainkan level arena multipemain dan tingkatkan pahlawan serta keterampilan pengkodean Anda."
clan: "Klan"
clans: "Klan"
new_name: "Nama baru klan"
new_description: "Deskripsi baru klan"
make_private: "Buat klan menjadi privat"
subs_only: "hanya pelanggan"
create_clan: "Buat klan baru"
private_preview: "Tinjau"
private_clans: "Klan Privat"
public_clans: "Klan Publik"
my_clans: "Klan Saya"
clan_name: "Nama Klan"
name: "Nama"
chieftain: "Kepala Suku"
edit_clan_name: "Ubah Nama Klan"
edit_clan_description: "Ubah Deskripsi Klan"
edit_name: "ubah nama"
edit_description: "ubah deskripsi"
private: "(privat)"
summary: "Rangkuman"
average_level: "Level Rata-rata"
average_achievements: "Prestasi Rata-rata"
delete_clan: "Hapus Klan"
leave_clan: "Tinggalkan Klan"
join_clan: "Gabung Klan"
invite_1: "Undang:"
invite_2: "*Undang pemain untuk klan ini dengan mengirimkan mereka tautan."
members: "PI:NAME:<NAME>END_PI"
progress: "Perkembangan"
not_started_1: "belum mulai"
started_1: "mulai"
complete_1: "selesai"
exp_levels: "Perluas level"
rem_hero: "Melepaskan Hero"
status: "Status"
complete_2: "Lengkapi"
started_2: "Dimulai"
not_started_2: "Belum Dimulai"
view_solution: "Klik untuk melihat solusi."
view_attempt: "Klik untuk melihat percobaan."
latest_achievement: "Prestasi Terakhir"
playtime: "Waktu bermain"
last_played: "Yang terakhir dimainkan"
leagues_explanation: "Bermain dalam liga melawan anggota klan lain di instansi arena multipemain."
track_concepts1: "Mengikuti konsep"
track_concepts2a: "dipelajari oleh setiap siswa"
track_concepts2b: "dipelajari oleh setiap anggota"
track_concepts3a: "Mengikuti level yang sudah selesai untuk setiap siswa"
track_concepts3b: "Mengikuti level yang sudah selesai untuk setiap anggota"
track_concepts4a: "Lihat siswa kamu'"
track_concepts4b: "Lihat anggota kamu'"
track_concepts5: "solusi"
track_concepts6a: "Urutkan siswa berdasarkan nama atau perkembangan"
track_concepts6b: "Urutkan anggota berdasarkan nama atau perkembangan"
track_concepts7: "Membutuhkan undangan"
track_concepts8: "untuk bergabung"
private_require_sub: "Klan privat membutuhkan langganan untuk membuat atau bergabung."
courses:
create_new_class: "Buat Kelas Baru"
hoc_blurb1: "Coba"
hoc_blurb2: "Kode, Mainkan, Bagikan"
hoc_blurb3: "aktivitas! Buat empat game mini yang berbeda untuk mempelajari dasar-dasar pengembangan game, lalu buat sendiri!"
solutions_require_licenses: "Solusi level akan tersedia bagi guru yang memiliki lisensi"
unnamed_class: "Kelas Tanpa Nama"
edit_settings1: "Ubah Pengaturan Kelas"
add_students: "Tambah Siswa"
stats: "Statistik"
student_email_invite_blurb: "Siswa-siswa anda juga bisa menggunakan kode kelas <strong>__classCode__</strong> ketika membuat Akun Siswa, tanpa membutuhkan email."
total_students: "Jumlah siswa:"
average_time: "Rata-rata waktu bermain level:"
total_time: "Total waktu bermain:"
average_levels: "Rata-rata level yang terselesaikan:"
total_levels: "Total level yang terselesaikan:"
students: "Siswa-siswa"
concepts: "Konsep-konsep"
play_time: "Waktu bermain:"
completed: "Terselesaikan:"
enter_emails: "Pisahkan tiap alamat email dengan jeda baris ataupun koma"
send_invites: "Undang Siswa"
number_programming_students: "Jumlah Siswa Programming"
number_total_students: "Jumlah Siswa di Sekolah/Wilayah"
enroll: "Daftar"
enroll_paid: "Daftarkan Siswa di Kursus Berbayar"
get_enrollments: "Dapatkan Lisensi Lebih"
change_language: "Mengganti Bahasa"
keep_using: "Tetap Menggunakan"
switch_to: "Mengganti Menjadi"
greetings: "Hai!"
back_classrooms: "Kembali ke ruang kelasku"
back_classroom: "Kembali ke ruang kelas"
back_courses: "Kembali ke kursusku"
edit_details: "Ubah detail kelas"
purchase_enrollments: "Membeli Lisensi Siswa"
remove_student: "hapus siswa"
assign: "Daftarkan"
to_assign: "daftarkan kursus berbayar."
student: "PI:NAME:<NAME>END_PI"
teacher: "PI:NAME:<NAME>END_PI"
arena: "Arena"
available_levels: "Level yang Tersedia"
started: "dimulai"
complete: "selesai"
practice: "latihan"
required: "wajib"
welcome_to_courses: "Para petualang, selamat datang di Kursus!" # {change}
ready_to_play: "Siap untuk bermain?"
start_new_game: "Memulai Permainan Baru"
play_now_learn_header: "Bermain sekarang untuk belajar"
play_now_learn_1: "sintaks dasar untuk mengontrol karaktermu"
play_now_learn_2: "perulangan untuk memecahkan puzzle yang menganggu"
play_now_learn_3: "strings & variabel-variabel untuk mengatur tindakan-tindakan"
play_now_learn_4: "bagaimana cara mengalahkan raksasa (keahlian hidup yang penting!)"
my_classes: "Kelas Saat Ini"
class_added: "Kelas berhasil ditambahkan!"
view_map: "lihap peta"
view_videos: "lihat video"
view_project_gallery: "lihat proyek teman kelasku"
join_class: "Bergabung Ke Kelas"
join_class_2: "Ikut Kelas"
ask_teacher_for_code: "Tanya ke gurumu jika kamu memiliki kode kelas CodeCombat! Jika iya, masukkan kode di:"
enter_c_code: "<Masukkan Kode Kelas>"
join: "Bergabung"
joining: "Ikuti kelas"
course_complete: "Kursus Selesai"
play_arena: "Arena Bermain"
view_project: "Lihat Proyek"
start: "Mulai"
last_level: "Level terakhir yang dimainkan"
not_you: "Bukan Kamu?"
continue_playing: "Lanjutkan Bermain"
option1_header: "Undang Siswa Melalui Email"
remove_student1: "PI:NAME:<NAME>END_PI"
are_you_sure: "Apakah anda yakin ingin menghapus siswa ini dari kelas ini?"
remove_description1: "Siswa akan kehilangan akses untuk kelas ini dan kelas yang diikuti. Perkembangan dan gameplay TIDAK hilang, dan siswa dapat dimasukkan kembali ke kelas kapanpun"
remove_description2: "Lisensi berbayar yang telah aktif tidak dapat dikembalikan."
license_will_revoke: "Lisensi berbayar siswa ini akan dicabut dan menjadi tersedia untuk diberikan ke siswa lain."
keep_student: "Simpan Siswa"
removing_user: "Menghapus siswa"
subtitle: "Mengulas ikhtisar kursus dan level" # Flat style redesign
select_language: "Pilih bahasa"
select_level: "Pilih level"
play_level: "Mainkan Level"
concepts_covered: "Konsep tercakup"
view_guide_online: "Level Ikhtisar dan Solusi"
# lesson_slides: "Lesson Slides"
grants_lifetime_access: "Berikan akses ke semua Kursus."
enrollment_credits_available: "Lisensi Tersedia:"
language_select: "Pilih bahasa" # ClassroomSettingsModal
language_cannot_change: "Bahasa tidak dapat diganti setelah siswa bergabung ke kelas."
avg_student_exp_label: "Pengalaman Pemrograman Rata-rata Siswa"
avg_student_exp_desc: "Ini akan membantu kita mengerti bagaimana cara menjalankan kursus lebih baik."
avg_student_exp_select: "Pilih opsi terbaik"
avg_student_exp_none: "Belum Berpengalaman - sedikit atau belum berpengalaman"
avg_student_exp_beginner: "Pemula - memiliki beberapa pemaparan atau basis-blok"
avg_student_exp_intermediate: "Menengah - ada pengalaman dengan mengetik kode"
avg_student_exp_advanced: "Lanjutan - pengalaman luas dengan mengetik kode"
avg_student_exp_varied: "Level Variasi Pengalaman"
student_age_range_label: "Jarak Usia Siswa"
student_age_range_younger: "Lebih muda dari 6"
student_age_range_older: "Lebih tua dari 18"
student_age_range_to: "sampai"
estimated_class_dates_label: "Perkiraan Tanggal Kelas"
estimated_class_frequency_label: "Estimasi Frekuensi Kelas"
classes_per_week: "kelas per minggu"
minutes_per_class: "menit per kelas"
create_class: "Buat Kelas"
class_name: "Nama Kelas"
teacher_account_restricted: "Akun kamu adalah akun guru dan tidak dapat mengakses konten siswa."
account_restricted: "Akun siswa diperlukan untuk mengakses halaman ini."
update_account_login_title: "Masuk atau perbaharui akunmu"
update_account_title: "Akunmu membutuhkan perhatian!"
update_account_blurb: "Sebelum kamu dapat mengakses kelasmu, pilihlah bagaimana kamu ingin menggunakan akun ini."
update_account_current_type: "Tipe Akun Saat Ini:"
update_account_account_email: "Akun Email/Username:"
update_account_am_teacher: "Saya adalah seorang guru"
update_account_keep_access: "Pertahankan akses ke kelas yang saya buat"
update_account_teachers_can: "Akun guru dapat:"
update_account_teachers_can1: "Membuat/mengatur/menambah kelas"
update_account_teachers_can2: "Tentukan/daftarkan siswa dalam kursus"
update_account_teachers_can3: "Membuka semua level kursus untuk mencoba"
update_account_teachers_can4: "Akses fitur terbaru hanya untuk guru ketika kita mengeluarkan fitur tersebut"
update_account_teachers_warning: "Perhatian: Kamu akan dihapus dari semua kelas yang kamu telah ikuti sebelumnya dan tidak akan dapat bermain kembali sebagai siswa."
update_account_remain_teacher: "Tetap Sebagai Guru"
update_account_update_teacher: "Perbaharui Sebagai Guru"
update_account_am_student: "Saya adalah seorang siswa"
update_account_remove_access: "Hapus akses ke kelas yang telah saya buat"
update_account_students_can: "Akun siswa dapat:"
update_account_students_can1: "Bergabung ke kelas"
update_account_students_can2: "Bermain melalui kursus sebagai siswa dan merekam proses milikmu"
update_account_students_can3: "Bersaing dengan teman kelas di arena"
update_account_students_can4: "Mengakses fitur baru hanya untuk siswa selagi kita mengeluarkan fitur tersebut"
update_account_students_warning: "Perhatian: Kamu tidak dapat mengatur kelas manapun yang telah kamu buat sebelumnya ataupun membuat kelas baru."
unsubscribe_warning: "Perhatian: Kamu akan berhenti berlangganan dari langganan bulananmu."
update_account_remain_student: "Tetap sebagai Siswa"
update_account_update_student: "Perbaharui sebagai Siswa"
need_a_class_code: "Kamu akan membutuhkan Kode Kelas untuk kelas yang kamu ikuti:"
update_account_not_sure: "Tidak yakin yang mana yang dipilih? Email"
update_account_confirm_update_student: "Apakah kamu yakin ingin memperbaharui akunmu menjadi sebuah pengalaman Siswa?"
update_account_confirm_update_student2: "Kamu akan tidak dapat mengatur kelas manapun yang kamu buat sebelumnya atau membuat kelas baru. Kelas yang terbuat sebelumnya olehmu akan dihapus dari CodeCombat dan tidak dapat dikembalikan."
instructor: "PengPI:NAME:<NAME>END_PI: "
youve_been_invited_1: "Kamu telah diundang untuk bergabung "
youve_been_invited_2: ", dimana kamu akan belajar "
youve_been_invited_3: " dengan teman kelasmu di CodeCombat."
by_joining_1: "Dengan bergabung "
by_joining_2: "akan dapat membantu mengulang kata kunci kamu jika kamu lupa atau menghilangkannya. Kamu juga dapat melakukan verifikasi emailmu sehingga kamu dapat mengulang kata kuncimu sendiri!"
sent_verification: "Kami telah mengirim verifikasi email ke:"
you_can_edit: "Kamu dapat mengganti alamat emailmu di "
account_settings: "Pengaturan Akun"
select_your_hero: "Pilih Jagoan Kamu"
select_your_hero_description: "Kamu dapat selalu mengganti jagoanmu dengan pergi ke halaman Kursus dan memilih \"Ganti Jagoan\""
select_this_hero: "Pilih Jagoan Ini"
current_hero: "Jagoan Saat Ini:"
current_hero_female: "Jagoan Saat Ini:"
web_dev_language_transition: "Semua kelas program dalam HTML / JavaScript untuk kursus ini. Kelas yang telah menggunakan Python akan mulai dengan level pengenalan extra JavaScript untuk mempermudah transisi. Kelas yang telah menggunakan JavaScript akan melewati level pengenalan."
course_membership_required_to_play: "Kamu butuh bergabung dengan sebuah kursus untuk memainkan level ini."
license_required_to_play: "Tanyakan gurumu untuk memberikan lisensi ke kamu supaya kamu dapat melanjutkan bermain CodeCombat!"
update_old_classroom: "Tahun ajaran baru, level baru!"
update_old_classroom_detail: "Untuk memastikan kamu mendapatkan level paling baru, pastikan kamu membuat kelas baru untuk semester ini dengan menekan Buat Kelas Baru di "
teacher_dashboard: "beranda guru"
update_old_classroom_detail_2: "dan berikan siswa-siswa Kelas Kode yang baru muncul"
view_assessments: "Lihat Penilaian"
view_challenges: "lihat level tantangan"
challenge: "Tantangan:"
challenge_level: "Level Tantangan:"
status: "Status:"
assessments: "Penilaian"
challenges: "Tantangan"
level_name: "Nama Level:"
keep_trying: "Terus Mencoba"
start_challenge: "Memulai Tantangan"
locked: "Terkunci"
concepts_used: "Konsep yang Digunakan:"
show_change_log: "Tunjukkan perubahan pada level kursus ini"
hide_change_log: "Sembunyikan perubahan pada level kursus ini"
concept_videos: "Video Konsep"
concept: "Konsep:"
basic_syntax: "Sintaks Dasar"
while_loops: "While Loops"
variables: "Variabel"
basic_syntax_desc: "Sintaks adalah cara kita menulis kode. Sama seperti ejaan dan tata bahasa penting dalam menulis narasi dan esai, sintaksis penting saat menulis kode. Manusia pandai memahami arti sesuatu, meskipun tidak sepenuhnya benar, tetapi komputer tidak sepintar itu, dan mereka membutuhkan Anda untuk menulis dengan sangat tepat. "
while_loops_desc: "Perulangan adalah cara mengulangi tindakan dalam program. Anda dapat menggunakannya sehingga Anda tidak perlu terus menulis kode berulang, dan jika Anda tidak tahu persis berapa kali suatu tindakan perlu terjadi menyelesaikan tugas. "
variables_desc: "Bekerja dengan variabel seperti mengatur berbagai hal dalam kotak sepatu. Anda memberi nama kotak sepatu, seperti \"Perlengkapan Sekolah\", lalu Anda memasukkannya ke dalamnya. Isi sebenarnya dari kotak dapat berubah seiring waktu, tetapi apa pun yang ada di dalamnya akan selalu disebut \"Perlengkapan Sekolah\". Dalam pemrograman, variabel adalah simbol yang digunakan untuk menyimpan data yang akan berubah selama program berlangsung. Variabel dapat menampung berbagai jenis data, termasuk angka dan string. "
locked_videos_desc: "Terus mainkan game untuk membuka kunci video konsep __concept_name__."
unlocked_videos_desc: "Tinjau video konsep __concept_name__."
video_shown_before: "ditampilkan sebelum __level__"
link_google_classroom: "Tautkan Google Kelas"
select_your_classroom: "Pilih Kelas Anda"
no_classrooms_found: "Tidak ditemukan ruang kelas"
create_classroom_manually: "Buat kelas secara manual"
classes: "Kelas"
certificate_btn_print: "Cetak"
certificate_btn_toggle: "Alihkan"
ask_next_course: "Ingin bermain lebih banyak? Minta akses guru Anda ke kursus berikutnya."
set_start_locked_level: "Kunci level dimulai dari"
no_level_limit: "- (tidak ada level yang dikunci)"
# ask_teacher_to_unlock: "Ask Teacher To Unlock"
# ask_teacher_to_unlock_instructions: "To play the next level, ask your teacher to unlock it on their Course Progress screen"
# play_next_level: "Play Next Level"
# play_tournament: "Play Tournament"
# levels_completed: "Levels Completed: __count__"
# ai_league_team_rankings: "AI League Team Rankings"
# view_standings: "View Standings"
# view_winners: "View Winners"
# classroom_announcement: "Classroom Announcement"
project_gallery:
no_projects_published: "Jadilah yang pertama mempublikasi proyek di kursus ini!"
view_project: "Lihat Proyek"
edit_project: "Ubah Project"
teacher:
assigning_course: "Menetapkan kursus"
back_to_top: "Kembali ke Atas"
click_student_code: "Klik di level manapun yang siswa telah mulai atau selesaikan dibawah ini untuk melihat kode yang mereka tulis."
code: "Kode __name__'"
complete_solution: "Solusi Lengkap"
course_not_started: "Siswa belum memulai kursus ini."
hoc_happy_ed_week: "Selamat Minggu Pendidikan Ilmu Komputer!"
hoc_blurb1: "Pelajari tentang yang gratis"
hoc_blurb2: "Kode, Mainkan, Bagikan"
hoc_blurb3: "aktivitas, unduh rencana pelajaran guru baru, dan beri tahu siswa Anda untuk masuk untuk bermain!"
hoc_button_text: "Lihat Aktivitas"
no_code_yet: "Siswa belum menulis kode apapun di level ini."
open_ended_level: "Level Akhir-Terbuka"
partial_solution: "Solusi Sebagian"
capstone_solution: "Solusi Capstone"
removing_course: "Menghapus kursus"
solution_arena_blurb: "Para siswa didorong untuk memecahkan level arena secara kreatif. Solusi yang tersedia di bawah memenuhi persyaratan level arena."
solution_challenge_blurb: "Para siswa didorong untuk memecahkan tantangan level akhir-terbuka secara kreatif. Salah satu solusi kemungkinan ditampilkan di bawah."
solution_project_blurb: "Para siswa didorong untuk membangun proyek kreatif di level ini. Solusi yang tersedia di bawah memenuhi persyaratan level proyek."
students_code_blurb: "Solusi yang benar untuk setiap level tersedia jika perlu. Dalam beberapa kasus, memungkinkan jika siswa memecahkan level dengan kode yang berbeda. Solusi tidak ditampilkan untuk level di mana siswa belum memulainya."
course_solution: "Solusi Kursus"
level_overview_solutions: "Ikhtisar Level dan Solusi"
no_student_assigned: "Tidak ada siswa yang ditetapkan di kursus ini."
paren_new: "(baru)"
student_code: "Kode Siswa __name__"
teacher_dashboard: "Beranda Guru" # Navbar
my_classes: "Kelasku"
courses: "Panduan Kursus"
enrollments: "Lisensi Siswa"
resources: "Sumber Daya"
help: "Bantuan"
language: "Bahasa"
edit_class_settings: "ubah setingan kelas"
access_restricted: "Wajib Perbaharui Akun"
teacher_account_required: "akun guru dibutuhkan untuk mengakses konten ini."
create_teacher_account: "Buat Akun Guru"
what_is_a_teacher_account: "Apakah Akun Guru?"
teacher_account_explanation: "Akun Guru CodeCombat memungkinkan kamu mmempersiapkan ruang kelas, memonitor perkembangan siswa selagi mereka mengerjakan kursus, mengatur lisensi dan mengakses sumber daya untuk membantu membangun kurikulummu."
current_classes: "Kelas Saat Ini"
archived_classes: "Kelas yang Diarsipkan"
# shared_classes: "Shared Classes"
archived_classes_blurb: "Kelas dapat diarsip untuk referensi kedepan. Membuka arsip kelas untuk melihatnya di daftar Kelas Saat Ini."
view_class: "lihat kelas"
# view_ai_league_team: "View AI League team"
archive_class: "arsip kelas"
unarchive_class: "buka arsip kelas"
unarchive_this_class: "Buka arsip kelas ini"
no_students_yet: "Kelas ini belum memiliki siswa."
no_students_yet_view_class: "Lihat kelas untuk menambahkan siswa."
try_refreshing: "(Kamu mungkin harus membuka ulang page ini)"
create_new_class: "Buat Kelas Baru"
class_overview: "Ikhtisar Kelas" # View Class page
avg_playtime: "Rata-rata waktu bermain level"
total_playtime: "Total waktu bermain"
avg_completed: "Rata-rata level yang terselesaikan"
total_completed: "Total level yang terselesaikan"
created: "Dibuat"
concepts_covered: "Pencakupan konsep"
earliest_incomplete: "Level awal yang belum selesai"
latest_complete: "Level akhir yang terselesaikan"
enroll_student: "PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI"
apply_license: "Gunakan Lisensi"
revoke_license: "Cabut Lisensi"
revoke_licenses: "Cabut Semua Lisensi"
course_progress: "Perkembangan Kursus"
not_applicable: "Tidak Tersedia"
edit: "ubah"
edit_2: "Ubah"
remove: "hapus"
latest_completed: "Terakhir terselesaikan:"
sort_by: "Urutkan berdasar"
progress: "Perkembangan"
concepts_used: "Konsep digunakan oleh Siswa:"
concept_checked: "Konsep diperiksa:"
completed: "Selesai"
practice: "Latihan"
started: "Mulai"
no_progress: "Belum ada perkembangan"
not_required: "Tidak wajib"
view_student_code: "Klik untuk melihat kode siswa"
select_course: "Pilih kursus untuk melihat"
progress_color_key: "Warna kunci perkembangan:"
level_in_progress: "Perkembangan di Level"
level_not_started: "Level Belum Dimulai"
project_or_arena: "Proyek atau Arena"
students_not_assigned: "Siswa yang belum ditetapkan {{courseName}}"
course_overview: "Ikhtisar Kursus"
copy_class_code: "Salin Kode Kelas"
class_code_blurb: "Para Siswa dapat bergabung di kelas kamu menggunakan Kode Kelas. Tidak membutuhkan alamat email ketika membuat akun siswa dengan Kode Kelas ini."
copy_class_url: "Salin URL Kelas"
class_join_url_blurb: "Kamu juga dapat mengirim URL Kelas unik ini ke halaman web bersama."
add_students_manually: "Undang Siswa dengan Email"
bulk_assign: "Pilih kursus"
assigned_msg_1: "{{numberAssigned}} siswa di ditetapkan {{courseName}}."
assigned_msg_2: "{{numberEnrolled}} lisensi dipakai."
assigned_msg_3: "Kamu sekarang memiliki {{remainingSpots}} sisa lisensi yang tersedia."
assign_course: "Daftarkan Kursus"
removed_course_msg: "{{numberRemoved}} siswa telah dihapus dari {{courseName}}."
remove_course: "Hapus Kursus"
not_assigned_msg_1: "Tidak dapat menambahkan pengguna ke contoh kursus sampai mereka ditambahkan ke prabayar yang mencakup kursus ini"
not_assigned_modal_title: "Kursus belum ditetapkan"
not_assigned_modal_starter_body_1: "Kursus ini membutuhkan Lisensi Awal. Kamu tidak memiliki cukup Lisensi Awal yang tersedia untuk menetapkan kursus ini ke semua __selected__ siswa terpilih."
not_assigned_modal_starter_body_2: "Beli Lisensi Awal untuk berikan akses ke kursus ini"
not_assigned_modal_full_body_1: "Kursus ini membutuhkan Lisensi Penuh. Kamu tidak memiliki cukup Lisensi Penuh yang tersedia untuk menetapkan kursus ke semua __selected__ siswa terpilih."
not_assigned_modal_full_body_2: "Kamu hanya memiliki __numFullLicensesAvailable__ Lisensi Penuh yang tersedia (__numStudentsWithoutFullLicenses__ siswa saat ini tidak memiliki Lisensi Penuh yang aktif)."
not_assigned_modal_full_body_3: "Silakan memilih siswa yang lebih sedikit, atau jangkau ke __supportEmail__ untuk bantuan."
assigned: "Tetapkan"
enroll_selected_students: "PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI"
no_students_selected: "Tidak ada siswa yang terpilih."
show_students_from: "Tampilkan siswa dari" # Enroll students modal
apply_licenses_to_the_following_students: "Gunakan Lisensi untuk Siswa Berikut"
select_license_type: "Pilih Jenis Lisensi untuk Diterapkan"
students_have_licenses: "Siswa berikut telah memiliki lisensi:"
all_students: "Semua Siswa"
apply_licenses: "Pakai Lisensi"
not_enough_enrollments: "Lisensi yang tersedia tidak cukup."
enrollments_blurb: "Para siswa diwajibkan untuk memiliki lisensi untuk mengakses konton manapun setelah kursus pertama."
how_to_apply_licenses: "Bagaimana cara Menggunakan Lisensi"
export_student_progress: "Ekspor Perkembangan Siswa (CSV)"
send_email_to: "Kirim Pemulihan Kata Kunci ke Email:"
email_sent: "Email terkirim"
send_recovery_email: "Kirim pemulihan email"
enter_new_password_below: "Masukkan kata kunci baru di bawah:"
change_password: "PI:PASSWORD:<PASSWORD>END_PI"
changed: "Terganti"
available_credits: "Lisensi Tersedia"
pending_credits: "Lisensi Tertunda"
empty_credits: "Lisensi Habis"
license_remaining: "lisensi yang tersisa"
licenses_remaining: "lisensi yang tersisa"
student_enrollment_history: "Riwayat Pendaftaran Siswa"
enrollment_explanation_1: "The"
enrollment_explanation_2: "Riwayat Pendaftaran Siswa"
enrollment_explanation_3: "menampilkan jumlah total siswa unik yang terdaftar di semua guru dan ruang kelas yang ditambahkan ke dasbor Anda. Ini termasuk siswa di ruang kelas yang diarsipkan dan yang tidak diarsipkan dengan tanggal pembuatan kelas antara tanggal 1- Juli 30 setiap tahun sekolah masing-masing. "
enrollment_explanation_4: "Ingat"
enrollment_explanation_5: "kelas dapat diarsipkan dan lisensi dapat digunakan kembali sepanjang tahun ajaran, jadi tampilan ini memungkinkan administrator untuk memahami berapa banyak siswa yang benar-benar berpartisipasi dalam program secara keseluruhan."
one_license_used: "1 dari __totalLicenses__ lisensi telah digunakan"
num_licenses_used: "__numLicensesUsed__ dari __totalLicenses__ lisensi telah digunakan"
starter_licenses: "lisensi awal"
start_date: "tanggal mulai:"
end_date: "tanggal berakhir:"
get_enrollments_blurb: " Kami membantu anda membangun solusi yang memenuhi kebutuhan kelas, sekolah, ataupun wilayah kamu."
# see_also_our: "See also our"
# for_more_funding_resources: "for how to leverage CARES Act funding sources like ESSER and GEER."
how_to_apply_licenses_blurb_1: "Ketika guru menetapkan kursus untuk siswa untuk pertamakali, kami secara otomatis menggunakan lisensi. Gunakan penetapan-masal tarik-turun di ruang kelasmu untuk menetapkan kursus untuk siswa yang terpilih:"
how_to_apply_licenses_blurb_2: "Dapatkan saya menggunakan lisensi tanpa menetapkan ke sebuah kursus?"
how_to_apply_licenses_blurb_3: "Ya - pergi ke label Status Lisensi di ruang kelasmu dan klik \"Pakai Lisensi\" ke siswa manapun yang tidak memiliki lisensi aktif."
request_sent: "Permintaan Dikirim!"
assessments: "Penilaian"
license_status: "Status Lisensi"
status_expired: "Kadaluarsa pada {{date}}"
status_not_enrolled: "Belum Terdaftar"
status_enrolled: "Kadaluarsa pada {{date}}"
select_all: "Pilih Semua"
project: "Proyek"
project_gallery: "Galeri Proyek"
view_project: "Lihat Proyek"
unpublished: "(belum terpublikasi)"
view_arena_ladder: "Lihat Tangga Arena"
resource_hub: "Pusat Sumber Daya"
pacing_guides: "Panduang Berulang Ruang-Kelas-di-Dalam-Kotak"
pacing_guides_desc: "Belajar bagaimana menggabungkan semua sumber daya CodeCombat untuk merancang tahun sekolahmu!"
pacing_guides_elem: "Panduang Berulang Sekolah Dasar"
pacing_guides_middle: "Panduan Berulang Sekolah Menengah Pertama"
pacing_guides_high: "Panduang Berulang Sekolah Menengah Atas"
getting_started: "Memulai"
educator_faq: "FAQ Pengajar"
educator_faq_desc: "Pertanyaan yang paling sering diajukan mengenai menggunakan CodeCombat di kelas atau di sekolahmu."
teacher_getting_started: "Panduan Guru untuk Memulai"
teacher_getting_started_desc: "Baru di CodeCombat? Unduh Panduan Guru untuk Memulai ini untuk mempersiapkan akunmu, membuat kelas pertamamu, dan mengundang siswa untuk kursus pertama."
student_getting_started: "Panduan Memulai Cepat Siswa"
student_getting_started_desc: "Kamu dapat membagikan panduan ini kepada siswamu sebelum memulai CodeCombat supaya mereka dapat membiasakan diri mereka dengan editor kode. Panduan ini dapat digunakan baik untuk kelas Python dan JavaScript."
standardized_curricula: "Kurikulum Standar"
ap_cs_principles: "Kepala Sekolah Ilmu Komputer AP"
ap_cs_principles_desc: "Kepala Sekolah Ilmu Komputer AP memberikan siswa pengenalan luas mengenai kekuatan, pengaruh, dan kemungkinan dalam Ilmu Komputer. Kursus menekankan pemikiran komputasional dan pemecahan masalah sambil mengajar dasar pemrograman."
cs1: "Pengenalan Ilmu Komputer"
cs2: "Ilmu Komputer 2"
cs3: "Ilmu Komputer 3"
cs4: "Ilmu Komputer 4"
cs5: "Ilmu Komputer 5"
cs1_syntax_python: "Kursus 1 Panduan Sintaks Python"
cs1_syntax_python_desc: "Contekan dengan referensi sintaks Python yang umum dimana siswa akan belajar di Pengenalan Ilmu Komputer."
cs1_syntax_javascript: "Kursus 1 Panduan Sintaks JavaScript"
cs1_syntax_javascript_desc: "Contekan dengan referensi sintaks JavaScript yang umum dimana siswa akan belajar di Pengenalan Ilmu Komputer."
coming_soon: "Panduan tambahan segera akan datang!"
engineering_cycle_worksheet: "Lembar Kerja Siklus Teknis"
engineering_cycle_worksheet_desc: "Gunakan lembar kerja ini untuk mengajar para siswa dasar dari siklus teknis: menilai, mendesain, mengimplementasi, dan mendebug. Lihat lembar kerja yang selesai sebagai panduan."
engineering_cycle_worksheet_link: "Lihat contoh"
progress_journal: "Jurnal Perkembangan"
progress_journal_desc: "Mendorong siswa untuk mengikuti terus perkembangan mereka via jurnal perkembangan."
cs1_curriculum: "Pengenalan Ilmu Komputer - Panduan Kurikulum"
cs1_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 1."
arenas_curriculum: "Level Arena - Panduan Guru"
arenas_curriculum_desc: "Instruksi untuk menjalankan Wakka Maul, Cross Bones, dan Power Peak multiplayer arena dengan kelasmu."
assessments_curriculum: "Tingkat Penilaian - Panduan Guru"
assessments_curriculum_desc: "Pelajari cara menggunakan Level Tantangan dan level Tantangan Kombo untuk menilai hasil belajar siswa."
cs2_curriculum: "Ilmu Komputer 2 - Panduan Kurikulum"
cs2_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 2"
cs3_curriculum: "Ilmu Komputer 3 - Panduan Kurikulum"
cs3_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 3"
cs4_curriculum: "Ilmu Komputer 4 - Panduan Kurikulum"
cs4_curriculum_desc: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk Kursus 4"
cs5_curriculum_js: "Ilmu Komputer 5 - Panduan Kurikulum (JavaScript)"
cs5_curriculum_desc_js: "Cakupan dan urutan, rencana belajar, aktivitas dan lainnya untuk kelas Kursus 5 menggunakan JavaScript."
cs5_curriculum_py: "Ilmu Komputer 5 - Panduan Kurikulum (Python)"
cs5_curriculum_desc_py: "Cakupan dan urutan, rencana pelajaran, aktivitas, dan lainnya untuk kelas Kursus 5 menggunakan Python."
cs1_pairprogramming: "Aktivitas Pemrograman Berpasangan"
cs1_pairprogramming_desc: "Mengenalkan siswa untuk berlatih pemrograman berpasangan yang mampu membantu mereka menjadi pendengar dan pembicara yang lebih baik."
gd1: "Pengembangan Permainan 1"
gd1_guide: "Pengembangan Permainan 1 - Panduan Proyek"
gd1_guide_desc: "Gunakan panduan ini untuk siswa anda selagi mereka membuat proyek permainan pertama yang bisa dibagikan dalam 5 hari"
gd1_rubric: "Pengembangan Permainan 1 - Rubrik Proyek"
gd1_rubric_desc: "Gunakan rubrik ini untuk menilai proyek siswa di akhir Pengembangan Permainan 1."
gd2: "Pengembangan Permainan 2"
gd2_curriculum: "Pengembangan Permainan 2 - Panduan Kurikulum"
gd2_curriculum_desc: "Rencana belajar untuk Pengembangan Permainan 2."
gd3: "Pengembangan Permainan 3"
gd3_curriculum: "Pengembangan Permainan 3 - Panduan Kurikulum"
gd3_curriculum_desc: "Rencana belajar untuk Pengembangan Permainan 3."
wd1: "Pengembangan Web 1"
wd1_curriculum: "Pengembangan Web 1 - Panduan Kurikulum"
wd1_curriculum_desc: "Lingkup dan urutan, rencana pelajaran, aktivitas, dan lainnya untuk Pengembangan Web 1."
wd1_headlines: "Aktivitas Pokok Bahasan dan Header"
wd1_headlines_example: "Lihat contoh solusi"
wd1_headlines_desc: "Mengapa paragraf dan tag header sangat penting? Gunakan aktivitas ini untuk menunjukkan header yang terpilih dengan baik membuat halaman web lebih mudah dibaca. Ada banyak solusi tepat untuk ini!"
wd1_html_syntax: "Panduan Sintaks HTML"
wd1_html_syntax_desc: "Referensi satu halaman untuk bentuk HTML yang para siswa pelajari dalam Pengembangan Web 1."
wd1_css_syntax: "Panduan Sintaks CSS"
wd1_css_syntax_desc: "Referensi satu halaman untuk CSS dan bentuk sintaks yang para siswa pelajari dalam Pengembangan Web 1."
wd2: "Pengembangan Web 2"
wd2_jquery_syntax: "Panduan Sintaks Fungsi jQuery"
wd2_jquery_syntax_desc: "Referensi satu halaman untuk fungsi jQuery yang para siswa pelajari di Pengembangan Web 2."
wd2_quizlet_worksheet: "Lembar Kerja Perencanaan Quiz"
wd2_quizlet_worksheet_instructions: "Lihat instruksi dan contoh"
wd2_quizlet_worksheet_desc: "Sebelum siswa anda membangun proyek quiz kepribadian mereka di akhir Pengembangan Web 2, mereka harus merencanakan pertanyaan quiz mereka, hasil dan respon menggunakan lembar kerja ini. Guru akan mendistribusikan instruksi dan contoh rujukan kepada siswa."
student_overview: "Ikhtisar"
student_details: "Detail Siswa"
student_name: "PI:NAME:<NAME>END_PI"
no_name: "Tidak ada nama."
no_username: "Tidak ada username."
no_email: "Siswa tidak menulis alamat email."
student_profile: "Profil Siswa"
playtime_detail: "Detail Waktu Bermain"
student_completed: "Siswa yang Selesai"
student_in_progress: "Siswa yang Mengerjakan"
class_average: "Rata-rata Kelas"
not_assigned: "belum ditetapkan ke kursus berikut"
playtime_axis: "Waktu Bermain dalam Detik"
levels_axis: "Level dalam"
student_state: "Bagaimana"
student_state_2: "melakukannya?"
student_good: "melakukannya dengan baik"
student_good_detail: "Siswa ini mampu mengikuti kecepatan waktu penyelesaian level rata-rata kelas."
student_warn: "mungkin membutuhkan bantuan"
student_warn_detail: "Waktu penyelesaian level rata-rata siswanya menunjukkan bahwa mereka mungkin memerlukan bantuan dengan konsep baru yang telah diperkenalkan dalam kursus ini."
student_great: "sangat bagus"
student_great_detail: "Siswa ini mungkin merupakan kandidat yang baik untuk membantu siswa lain mengerjakan kursus ini, berdasarkan waktu penyelesaian level rata-rata."
full_license: "Lisensi Penuh"
starter_license: "Lisensi Awal"
customized_license: "Lisensi Khusus"
trial: "Percobaan"
hoc_welcome: "Selamat Pekan Pendidikan Ilmu Komputer"
hoc_title: "Hour of Code Games - Aktivitas Gratis untuk Mempelajari Bahasa Coding yang Sebenarnya"
hoc_meta_description: "Buat game Anda sendiri atau buat kode untuk keluar dari penjara bawah tanah! CodeCombat memiliki empat aktivitas Hour of Code yang berbeda dan lebih dari 60 level untuk mempelajari kode, bermain, dan menciptakan sesuatu."
hoc_intro: "Ada tiga jalan untuk supaya kelasmu dapat berpartisipasi dalam Hour of Code dengan CodeCombat"
hoc_self_led: "Permainan Mandiri"
hoc_self_led_desc: "Siswa dapat bermain sampai dua jam pengajaran Kode CodeCombat secara mandiri"
hoc_game_dev: "Pengembangan Permainan"
hoc_and: "dan"
hoc_programming: "Pemrograman JavaScript/Python"
hoc_teacher_led: "Pelajaran yang dipimpin oleh Guru"
hoc_teacher_led_desc1: "Unduh"
hoc_teacher_led_link: "Rencana pembelajaran Pengenalan Ilmu Komputer" # {change}
hoc_teacher_led_desc2: "Untuk mengenalan para siswa untuk konsep pemrograman menggunakan aktivitas luring"
hoc_group: "Permainan Kelompok"
hoc_group_desc_1: "Guru dapat menggunakan pelajaran sebagai penghubung dengan kursus Pengenalam Ilmu Komputer kami untuk merekam perkembangan siswa. Lihat"
hoc_group_link: "Panduan Memulai"
hoc_group_desc_2: "untuk lebih detail"
hoc_additional_desc1: "Untuk tambahan sumber daya dan aktivitas CodeCombat, lihat"
hoc_additional_desc2: "Pertanyaan"
hoc_additional_contact: "Hubungi"
# regenerate_class_code_tooltip: "Generate a new Class Code"
# regenerate_class_code_confirm: "Are you sure you want to generate a new Class Code?"
revoke_confirm: "Apakah kamu ingin mencabut Lisensi Penuh dari {{student_name}}? Lisensi tersebut akan tersedia untuk dipasang ke siswa lainnya."
revoke_all_confirm: "Apakah anda ingin mencabut Lisensi Penuh dari semua siswa di kelas ini?"
revoking: "Mencabut..."
unused_licenses: "Kamu memiliki lisensi yang tidak digunakan yang memungkinkan anda untuk menetapkan siswa pada kursus berbayar ketika mereka siap untuk belajar lebih!"
remember_new_courses: "Ingatlah untuk menetapkan kursus baru!"
more_info: "Info Lanjut"
how_to_assign_courses: "Bagaimana cara Menetapkan Kursus"
select_students: "Pilih Siswa"
select_instructions: "Klik pada kotak centang sebelah siswa yang ingin anda pasang di kursus."
choose_course: "Pilih Kursus"
choose_instructions: "Pilih kursus dari menu tarik bawah yang kamu ingin tetapkan, lalu klik “Tetapkan Ke Siswa yang Dipilih”."
push_projects: "Kami merekomendasikan mengikuti Pengembangan Web 1 atau Pengembangan Permainan 1 setelah siswa menyelesaikan Pengenalan Ilmu Komputer! Lihat {{resource_hub}} untuk lebih lanjut mengenai kursus tersebut."
teacher_quest: "Pencarian Guru untuk Sukses"
quests_complete: "Pencarian Selesai"
teacher_quest_create_classroom: "Buat Ruang Kelas"
teacher_quest_add_students: "Tambahkan Siswa"
teacher_quest_teach_methods: "Bantu siswa anda belajar bagaimana cara `memanggil method`."
teacher_quest_teach_methods_step1: "Dapatkan minimal 75% dari satu kelas untuk melewati level pertama, Dungeons of Kithgard"
teacher_quest_teach_methods_step2: "Cetak [Panduan Memulai Cepat Siswa](http://files.codecombat.com/docs/resources/StudentQuickStartGuide.pdf) di Pusat Sumber Daya."
teacher_quest_teach_strings: "Jangan melupakan siswa Anda, ajari mereka `string`."
teacher_quest_teach_strings_step1: "Dapatkan minimal 75% dari satu kelas melalui True Names."
teacher_quest_teach_strings_step2: "Gunakan Pemilih Level Guru di halaman [Panduan Kursus](/teachers/courses) untuk melihat True Names."
teacher_quest_teach_loops: "Jaga siswa anda dalam perulangan lingkaran mengenai `perulangan`"
teacher_quest_teach_loops_step1: "Dapatkan minimal 75% dari satu kelas melalui Fire Dancing."
teacher_quest_teach_loops_step2: "Gunakan Loops Activity di [Panduan Kurikulum IlKom1](/teachers/resources/cs1) untuk memperkuat konsep ini."
teacher_quest_teach_variables: "Ubahlah dengan `pengubah`"
teacher_quest_teach_variables_step1: "Dapatkan minimal 75% dari satu kelas melalui Known Enemy."
teacher_quest_teach_variables_step2: "Dorong kolaborasi dengan [Aktivitas Pemrograman Berpasangan](/teachers/resources/pair-programming)."
teacher_quest_kithgard_gates_100: "Kabur dari Kithgard Gates dengan kelasmu."
teacher_quest_kithgard_gates_100_step1: "Dapatkan minimal 75% dari satu kelas melalui Kithgard Gates."
teacher_quest_kithgard_gates_100_step2: "Pandu siswa anda untuk memikirkan masalah-masalah sukar dengan menggunakan [Lembar Kerja Siklus Teknis](http://files.codecombat.com/docs/resources/EngineeringCycleWorksheet.pdf)."
teacher_quest_wakka_maul_100: "Bersiap-siap untuk bertarung di Wakka Maul."
teacher_quest_wakka_maul_100_step1: "Dapatkan minimal 75% dari satu kelas melalui Wakka Maul."
teacher_quest_wakka_maul_100_step2: "Lihat [Panduan Arena](/teachers/resources/arenas) di [Pusat Sumber Daya](/teachers/resources) untuk tip-tip tentang cara menjalankan hari arena yang sukses."
teacher_quest_reach_gamedev: "Jelajahi dunia baru!"
teacher_quest_reach_gamedev_step1: "[Dapatkan lisensi](/teachers/licenses) supaya siswa anda dapat menjelajahi dunia baru, seperti Pengembangan Permainan dan Pengembangan Web!"
teacher_quest_done: "Ingin siswa anda belajar kode lebh lagi? Hubungi [spesialis sekolah](mailto:PI:EMAIL:<EMAIL>END_PI) kami hari ini!"
teacher_quest_keep_going: "Teruskan! Inilah yang dapat anda lakukan berikutnya:"
teacher_quest_more: "Lihat semua pencarian"
teacher_quest_less: "Lihat lebih sedikit pencarian"
refresh_to_update: "(muat ulang halaman untuk melihat pembaharuan)"
view_project_gallery: "Lihat Galeri Proyek"
office_hours: "Webinars Guru"
office_hours_detail: "Belajar bagaimana cara mengikuti perkembangan siswa anda selagi mereka membuat permainan dan memulai perjalanan koding mereka! Datang dan hadiri"
office_hours_link: "webinar guru"
office_hours_detail_2: "sesi."
success: "Sukses"
in_progress: "Dalam Pengembangan"
not_started: "Belum Mulai"
mid_course: "Pertengahan Kursus"
end_course: "Akhir Kursus"
none: "Belum terdeteksi"
explain_open_ended: "Catatan: Siswa didorong untuk memecahkan level ini dengan kreatif - salah satu kemungkinan solusi tersedia dibawah."
level_label: "Level:"
time_played_label: "Waktu Bermain:"
back_to_resource_hub: "Kembali ke Pusat Sumber Daya"
back_to_course_guides: "Kembali ke Panduan Kursus"
print_guide: "Cetak panduan ini"
combo: "Kombo"
combo_explanation: "Siswa melewati tantangan level Combo dengan menggunakan salah satu konsep yang terdaftar. Tinjau kode siswa dengan mengklik titik perkembangan."
concept: "Konsep"
sync_google_classroom: "Sinkronkan Google Kelas"
try_ozaria_footer: "Coba game petualangan baru kami, Ozaria!"
try_ozaria_free: "Coba Ozaria gratis"
ozaria_intro: "Memperkenalkan Program Ilmu Komputer Baru Kami"
# share_class: "share class"
# permission: "Permission"
# not_write_permission: "You don't have write permission to the class"
# not_read_permission: "You don't have read permission to the class"
teacher_ozaria_encouragement_modal:
title: "Membangun Keterampilan Ilmu Komputer untuk Menyelamatkan Ozaria"
sub_title: "Anda diundang untuk mencoba game petualangan baru dari CodeCombat"
cancel: "Kembali ke CodeCombat"
accept: "Coba Unit Pertama Gratis"
bullet1: "Mempererat hubungan siswa untuk belajar melalui kisah epik dan alur game yang imersif"
bullet2: "Ajarkan dasar-dasar Ilmu Komputer, Python atau JavaScript, dan keterampilan abad ke-21"
bullet3: "Buka kreativitas melalui proyek batu penjuru"
bullet4: "Mendukung petunjuk melalui sumber daya kurikulum khusus"
you_can_return: "Anda selalu dapat kembali ke CodeCombat"
educator_signup_ozaria_encouragement:
recommended_for: "Direkomendasikan untuk:"
independent_learners: "Pembelajar mandiri"
homeschoolers: "homeschooler"
educators_continue_coco: "Pengajar yang ingin terus menggunakan CodeCombat di kelasnya"
continue_coco: "Lanjutkan dengan CodeCombat"
ozaria_cta:
title1: "Standar Kurikulum Inti yang Disejajarkan"
description1: "Kurikulum berbasis cerita yang imersif yang memenuhi semua standar CSTA kelas 6 - 8"
title2: "Rencana Pelajaran Turnkey"
description2: "Presentasi dan lembar kerja mendalam bagi guru untuk membimbing siswa melalui tujuan pembelajaran."
title3: "Dasbor Baru untuk Admin & Guru"
description3: "Semua wawasan yang dapat ditindaklanjuti yang dibutuhkan pengajar dalam sekejap, seperti kemajuan siswa dan pemahaman konsep."
share_licenses:
share_licenses: "Bagikan Lisensi"
shared_by: "DPI:NAME:<NAME>END_PI:"
add_teacher_label: "Masukan email guru yang tepat:"
add_teacher_button: "Tambahkan Guru"
subheader: "Anda dapat membuat lisensi anda tersedia bagi guru lain di organisasi anda. Setiap lisensi akan hanya digunakan oleh satu siswa dalam satu waktu."
teacher_not_found: "Guru tidak ditemukan. Harap pastikan guru ini telah membuat Akun Guru."
teacher_not_valid: "Ini bukan Akun Guru yang valid. Hanya akun guru yang bisa membagikan lisensi."
already_shared: "Anda telah membagikan lisensi dengan guru tersebut."
have_not_shared: "Anda belum berbagi lisensi ini dengan guru Anda."
teachers_using_these: "Guru yang dapat mengakses lisensi ini:"
footer: "Ketika guru mencabut lisensi dari siswa, lisensi akan dikembalikan ke kumpulan lisensi untuk digunakan oleh guru lainnya di dalam grup."
you: "(Kamu)"
one_license_used: "(1 lisensi digunakan)"
licenses_used: "(__licensesUsed__ lisensi digunakan)"
more_info: "Info lanjut"
sharing:
game: "Permainan"
webpage: "Halaman Web"
your_students_preview: "Siswa anda akan mengeklik di sini untuk melihat proyek yang mereka selesaikan. Tidak tersedia dalam pratinjau guru."
unavailable: "Berbagi tautan tidak tersedia dalam pratinjau guru."
share_game: "Bagikan Permainan Ini"
share_web: "Bagikan Halaman Web Ini"
victory_share_prefix: "Bagikan tautan ini untuk mengundang teman dan keluarga kamu untuk"
victory_share_prefix_short: "Undang orang untuk"
victory_share_game: "bermain level permainanmu"
victory_share_web: "melihat halaman web kamu"
victory_share_suffix: "."
victory_course_share_prefix: "Tautan ini memungkinkan teman & keluarga kamu"
victory_course_share_game: "bermain permainan"
victory_course_share_web: "melihat halaman web"
victory_course_share_suffix: "yang kamu buat."
copy_url: "Salin URL"
share_with_teacher_email: "Kirimkan ke gurumu"
# share_ladder_link: "Share Multiplayer Link"
# ladder_link_title: "Share Your Multiplayer Match Link"
# ladder_link_blurb: "Share your AI battle link so your friends and family can play versus your code:"
game_dev:
creator: "Pembuat"
web_dev:
image_gallery_title: "Galeri Gambar"
select_an_image: "Pilih gambar yang mau kamu gunakan"
scroll_down_for_more_images: "(Gulirkan kebawah untuk melihat image lebih banyak)"
copy_the_url: "Salin URL di bawah"
copy_the_url_description: "Berguna jika kamu ingin mengganti gambar saat ini."
copy_the_img_tag: "Salin tag <img>"
copy_the_img_tag_description: "Berguna jika anda ingin memasukkan gambar yang baru."
copy_url: "Salin URL"
copy_img: "Salin <img>"
how_to_copy_paste: "Bagaimana cara Salin/Tempel"
copy: "Salin"
paste: "Tempel"
back_to_editing: "Kembali ke Sunting"
classes:
archmage_title: "Penyihir Tinggi"
archmage_title_description: "(Koder)"
archmage_summary: "Jika kamu seorang pengembang yang tertarik dalam membuat kode permainan edukasi, jadilah Penyihir Tinggi untuk membantu kami membangun CodeCombat!"
artisan_title: "Pengerajin"
artisan_title_description: "(Pembangun Level)"
artisan_summary: "Bangun dan bagikan level untuk anda dan teman anda untuk dimainkan. Menjadi seorang Pengerajin untuk belajar seni mengajar orang lain untuk memprogram."
adventurer_title: "PI:NAME:<NAME>END_PI"
adventurer_title_description: "(Penguji Level Permainan)"
adventurer_summary: "Dapatkan level terbaru kami (bahkan untuk konten pelanggan) lebih awal secara gratis seminggu dan bantu kami mengatasi bug sebelum rilis ke publik."
scribe_title: "PI:NAME:<NAME>END_PI"
scribe_title_description: "(Editor Artikel)"
scribe_summary: "Kode yang bagus membutuhkan dokumentasi yang baik. Tulis, ubah, dan perbaiki dokument yang dibaca oleh jutaan pemain di seluruh dunia."
diplomat_title: "Diplomat"
diplomat_title_description: "(Alih Bahasa)"
diplomat_summary: "CodeCombat di lokalkan dalam 45+ bahasa oleh Diplomat kami. Bantu kami dan berkontribusilah dalam alih bahasa."
ambassador_title: "Duta Besar"
ambassador_title_description: "(Pendukung)"
ambassador_summary: "Pandu pengguna forum kami dan berikan arahan bagi mereka yang memiliki pertanyaan. Duta Besar kami mewakili CodeCombat kepada dunia."
teacher_title: "PI:NAME:<NAME>END_PI"
editor:
main_title: "Editor CodeCombat"
article_title: "Editor Artikel"
thang_title: "Editor Thang"
level_title: "Editor Level"
course_title: "Editor Kursus"
achievement_title: "Editor Prestasi"
poll_title: "Editor Jajak Pendapat"
back: "Kembali"
revert: "Kembalikan"
revert_models: "Kembalikan Model"
pick_a_terrain: "Pilih Medan"
dungeon: "Ruang Bawah Tanah"
indoor: "Dalam ruangan"
desert: "Gurun"
grassy: "Rumput"
mountain: "Gunung"
glacier: "Gletser"
small: "Kecil"
large: "Besar"
fork_title: "Fork Versi Baru"
fork_creating: "Membuat Fork ..."
generate_terrain: "Buat Medan"
more: "Lainnya"
wiki: "Wiki"
live_chat: "Obrolan Langsung"
thang_main: "Utama"
thang_spritesheets: "Spritesheets"
thang_colors: "Warna"
level_some_options: "Beberapa Opsi?"
level_tab_thangs: "Thang"
level_tab_scripts: "Script"
level_tab_components: "Komponen"
level_tab_systems: "Sistem"
level_tab_docs: "Dokumentasi"
level_tab_thangs_title: "Thang Saat Ini"
level_tab_thangs_all: "Semua"
level_tab_thangs_conditions: "Kondisi Awal"
level_tab_thangs_add: "Tambahkan Thangs"
level_tab_thangs_search: "Telusuri"
add_components: "Tambahkan Komponen"
component_configs: "Konfigurasi Komponen"
config_thang: "Klik dua kali untuk mengkonfigurasi thang"
delete: "Hapus"
duplicate: "Duplikat"
stop_duplicate: "Hentikan Duplikat"
rotate: "Putar"
level_component_tab_title: "Komponen Saat Ini"
level_component_btn_new: "Buat Komponen Baru"
level_systems_tab_title: "Sistem Saat Ini"
level_systems_btn_new: "Buat Sistem Baru"
level_systems_btn_add: "Tambahkan Sistem"
level_components_title: "Kembali ke Semua Hal"
level_components_type: "Tipe"
level_component_edit_title: "Edit Komponen"
level_component_config_schema: "Skema Konfigurasi"
level_system_edit_title: "Edit Sistem"
create_system_title: "Buat Sistem Baru"
new_component_title: "Buat Komponen Baru"
new_component_field_system: "Sistem"
new_article_title: "Buat Artikel Baru"
new_thang_title: "Buat Jenis Thang Baru"
new_level_title: "Buat Tingkat Baru"
new_article_title_login: "Masuk untuk Membuat Artikel Baru"
new_thang_title_login: "Masuk untuk Membuat Jenis Thang Baru"
new_level_title_login: "Masuk untuk Membuat Tingkat Baru"
new_achievement_title: "Ciptakan Prestasi Baru"
new_achievement_title_login: "Masuk untuk Menciptakan Prestasi Baru"
new_poll_title: "Buat Jajak Pendapat Baru"
new_poll_title_login: "Masuk untuk Membuat JPI:NAME:<NAME>END_PI"
article_search_title: "Telusuri Artikel Di Sini"
thang_search_title: "Telusuri Jenis Thang Di Sini"
level_search_title: "Telusuri Tingkat Di Sini"
achievement_search_title: "Pencapaian Penelusuran"
poll_search_title: "Telusuri Jajak Pendapat"
read_only_warning2: "Catatan: Anda tidak dapat menyimpan hasil edit apa pun di sini, karena Anda belum masuk."
no_achievements: "Belum ada pencapaian yang ditambahkan untuk level ini."
achievement_query_misc: "Pencapaian utama dari bermacam-macam"
achievement_query_goals: "Pencapaian utama dari target level"
level_completion: "Penyelesaian Level"
pop_i18n: "Isi I18N"
tasks: "Tugas"
clear_storage: "Hapus perubahan lokal Anda"
add_system_title: "Tambahkan Sistem ke Tingkat"
done_adding: "Selesai Menambahkan"
article:
edit_btn_preview: "Pratijau"
edit_article_title: "Ubah Artikel"
polls:
priority: "Prioritas"
contribute:
page_title: "Berkontribusi"
intro_blurb: "CodeCombat adalah bagian dari komunitas open source! Ratusan pemain yang berdedikasi telah membantu kami membangun game seperti sekarang ini. Bergabunglah dengan kami dan tulis bab berikutnya dalam misi CodeCombat untuk mengajari dunia kode!"
alert_account_message_intro: "Halo!"
alert_account_message: "Untuk berlangganan email kelas, Anda harus masuk terlebih dahulu."
archmage_introduction: "Salah satu bagian terbaik tentang membuat game adalah mereka mensintesis banyak hal yang berbeda. Grafik, suara, jaringan waktu nyata, jaringan sosial, dan tentu saja banyak aspek pemrograman yang lebih umum, dari pengelolaan basis data tingkat rendah , dan administrasi server untuk desain yang dihadapi pengguna dan pembuatan antarmuka. Ada banyak hal yang harus dilakukan, dan jika Anda seorang programmer berpengalaman dengan keinginan untuk benar-benar menyelami seluk beluk CodeCombat, kelas ini mungkin cocok untuk Anda. Kami akan senang untuk mendapatkan bantuan Anda dalam membuat game pemrograman terbaik. "
class_attributes: "Atribut Kelas"
archmage_attribute_1_pref: "Pengetahuan dalam"
archmage_attribute_1_suf: ", atau keinginan untuk belajar. Sebagian besar kode kami dalam bahasa ini. Jika Anda penggemar Ruby atau Python, Anda akan merasa seperti di rumah sendiri. Ini JavaScript, tetapi dengan sintaks yang lebih baik."
archmage_attribute_2: "Beberapa pengalaman dalam pemrograman dan inisiatif pribadi. Kami akan membantu Anda berorientasi, tetapi kami tidak dapat menghabiskan banyak waktu untuk melatih Anda."
how_to_join: "PI:NAME:<NAME>END_PI"
join_desc_1: "Siapa pun dapat membantu! Lihat saja di "
join_desc_2: "untuk memulai, dan centang kotak di bawah ini untuk menandai diri Anda sebagai Archmage pemberani dan mendapatkan berita terbaru melalui email. Ingin mengobrol tentang apa yang harus dilakukan atau bagaimana cara untuk terlibat lebih dalam?"
join_desc_3: ", atau temukan kami di"
join_desc_4: "dan kita akan pergi dari sana!"
join_url_email: "Email kami"
join_url_slack: "saluran Slack publik"
archmage_subscribe_desc: "Dapatkan email tentang pengumuman dan peluang pengkodean baru."
artisan_introduction_pref: "Kita harus membangun level tambahan! Orang-orang berteriak-teriak meminta lebih banyak konten, dan kami hanya dapat membuat sendiri begitu banyak. Saat ini workstation Anda berada di level satu; editor level kami hampir tidak dapat digunakan bahkan oleh pembuatnya, jadi waspadalah. Jika Anda memiliki visi kampanye yang mencakup beberapa putaran hingga "
artisan_introduction_suf: ", maka kelas ini mungkin cocok untuk Anda."
artisan_attribute_1: "Pengalaman apa pun dalam membuat konten seperti ini akan menyenangkan, seperti menggunakan editor level Blizzard. Tapi tidak wajib!"
artisan_attribute_2: "Ingin sekali melakukan banyak pengujian dan pengulangan. Untuk membuat level yang baik, Anda perlu membawanya ke orang lain dan melihat mereka memainkannya, dan bersiaplah untuk menemukan banyak hal untuk diperbaiki."
artisan_attribute_3: "Untuk saat ini, ketahanan setara dengan seorang Petualang. Editor Tingkat kami sangat awal dan membuat frustasi untuk digunakan. Anda telah diperingatkan!"
artisan_join_desc: "Gunakan Editor Tingkat dalam langkah-langkah ini, memberi atau menerima:"
artisan_join_step1: "Baca dokumentasinya."
artisan_join_step2: "Buat level baru dan jelajahi level yang ada."
artisan_join_step3: "Temukan kami di saluran Slack publik kami untuk mendapatkan bantuan."
artisan_join_step4: "Posting level Anda di forum untuk mendapatkan masukan."
artisan_subscribe_desc: "Dapatkan email tentang pengumuman dan pembaruan editor level."
adventurer_introduction: "Mari perjelas tentang peran Anda: Anda adalah tanknya. Anda akan menerima kerusakan parah. Kami membutuhkan orang untuk mencoba level baru dan membantu mengidentifikasi cara membuat segalanya lebih baik. Rasa sakitnya akan luar biasa; membuat game yang bagus adalah proses yang panjang dan tidak ada yang melakukannya dengan benar pada kali pertama. Jika Anda bisa bertahan dan memiliki skor konstitusi yang tinggi, maka kelas ini mungkin cocok untuk Anda. "
adventurer_attribute_1: "Haus untuk belajar. Anda ingin belajar cara membuat kode dan kami ingin mengajari Anda cara membuat kode. Anda mungkin akan melakukan sebagian besar pengajaran dalam kasus ini."
adventurer_attribute_2: "Karismatik. Bersikaplah lembut tetapi jelaskan tentang apa yang perlu ditingkatkan, dan tawarkan saran tentang cara meningkatkan."
adventurer_join_pref: "Kumpulkan (atau rekrut!) seorang Artisan dan bekerja dengan mereka, atau centang kotak di bawah ini untuk menerima email ketika ada level baru untuk diuji. Kami juga akan memposting tentang level untuk ditinjau di jaringan kami seperti "
adventurer_forum_url: "forum kami"
adventurer_join_suf: "jadi jika Anda lebih suka diberi tahu dengan cara itu, daftar di sana!"
adventurer_subscribe_desc: "Dapatkan email saat ada level baru untuk diuji."
scribe_introduction_pref: "CodeCombat tidak hanya berupa sekumpulan level. Ini juga akan menyertakan sumber daya untuk pengetahuan, wiki konsep pemrograman yang dapat digunakan oleh level. Dengan cara itu, setiap Artisan tidak harus menjelaskan secara detail apa a operator perbandingan adalah, mereka dapat dengan mudah menautkan level mereka ke Artikel yang menjelaskan mereka yang sudah ditulis untuk pendidikan pemain. Sesuatu di sepanjang baris apa "
scribe_introduction_url_mozilla: "Jaringan Pengembang Mozilla"
scribe_introduction_suf: "telah dibangun. Jika ide Anda tentang kesenangan adalah mengartikulasikan konsep pemrograman dalam bentuk Penurunan Harga, maka kelas ini mungkin cocok untuk Anda."
scribe_attribute_1: "Keterampilan dalam kata-kata adalah semua yang Anda butuhkan. Tidak hanya tata bahasa dan ejaan, tetapi juga mampu menyampaikan ide yang rumit kepada orang lain."
contact_us_url: "Hubungi Kami"
scribe_join_description: "ceritakan sedikit tentang diri Anda, pengalaman Anda dengan pemrograman, dan hal-hal apa yang ingin Anda tulis. Kami akan mulai dari sana!"
scribe_subscribe_desc: "Dapatkan email tentang pengumuman penulisan artikel."
diplomat_introduction_pref: "Jadi, jika ada satu hal yang kami pelajari dari"
diplomat_introduction_url: "komunitas sumber terbuka"
diplomat_introduction_suf: "karena ada minat yang cukup besar terhadap CodeCombat di negara lain! Kami sedang membangun korps penerjemah yang ingin mengubah satu rangkaian kata menjadi rangkaian kata lain agar CodeCombat dapat diakses di seluruh dunia sebanyak mungkin. Jika Anda suka melihat sekilas konten yang akan datang dan menyampaikan level ini ke sesama warga negara secepatnya, maka kelas ini mungkin cocok untuk Anda. "
diplomat_attribute_1: "Kefasihan dalam bahasa Inggris dan bahasa tujuan menerjemahkan. Saat menyampaikan ide yang rumit, penting untuk memiliki pemahaman yang kuat tentang keduanya!"
diplomat_i18n_page_prefix: "Anda dapat mulai menerjemahkan level kami dengan membuka"
diplomat_i18n_page: "halaman terjemahan"
diplomat_i18n_page_suffix: ", atau antarmuka dan situs web kami di GitHub."
diplomat_join_pref_github: "Temukan file lokal bahasa Anda"
diplomat_github_url: "di GitHub"
diplomat_join_suf_github: ", edit secara online, dan kirim pull request. Juga, centang kotak di bawah ini untuk mengikuti perkembangan internasionalisasi baru!"
diplomat_subscribe_desc: "Dapatkan email tentang perkembangan i18n dan level untuk diterjemahkan."
ambassador_introduction: "Ini adalah komunitas yang kami bangun, dan Anda adalah koneksinya. Kami memiliki forum, email, dan jaringan sosial dengan banyak orang untuk diajak bicara dan membantu mengenal game dan belajar darinya. Jika Anda ingin membantu orang-orang untuk terlibat dan bersenang-senang, serta merasakan denyut nadi CodeCombat dan kemana tujuan kita, maka kelas ini mungkin cocok untuk Anda. "
ambassador_attribute_1: "Keterampilan komunikasi. Mampu mengidentifikasi masalah yang dialami pemain dan membantu mereka menyelesaikannya. Selain itu, beri tahu kami semua tentang apa yang dikatakan pemain, apa yang mereka sukai dan tidak sukai, dan inginkan lebih banyak!"
ambassador_join_desc: "ceritakan sedikit tentang diri Anda, apa yang telah Anda lakukan, dan apa yang ingin Anda lakukan. Kami akan mulai dari sana!"
ambassador_join_step1: "Baca dokumentasinya."
ambassador_join_step2: "Temukan kami di saluran Slack publik kami."
ambassador_join_step3: "Bantu orang lain dalam kategori Duta."
ambassador_subscribe_desc: "Dapatkan email tentang pembaruan dukungan dan perkembangan multipemain."
teacher_subscribe_desc: "Dapatkan email tentang pembaruan dan pengumuman untuk guru."
changes_auto_save: "Perubahan disimpan secara otomatis saat Anda mengaktifkan kotak centang."
diligent_scribes: "Penulis Rajin Kami:"
powerful_archmages: "Archmages Kuat Kami:"
creative_artisans: "Pengrajin Kreatif Kami:"
brave_adventurers: "Petualang Berani Kami:"
translating_diplomats: "Diplomat Penerjemah Kami:"
helpful_ambassadors: "Duta Kami yang Suka Menolong:"
ladder:
title: "Arena Multipemain"
arena_title: "__arena__ | Arena Multipemain"
my_matches: "Pertandingan Saya"
simulate: "Simulasikan"
simulation_explanation: "Dengan mensimulasikan game, Anda bisa mendapatkan peringkat game Anda lebih cepat!"
simulation_explanation_leagues: "Anda terutama akan membantu mensimulasikan game untuk pemain sekutu di klan dan kursus Anda."
simulate_games: "Simulasikan Game!"
games_simulated_by: "Game yang Anda simulasi:"
games_simulated_for: "Game yang disimulasikan untuk Anda:"
games_in_queue: "Game saat ini dalam antrean:"
games_simulated: "Game yang disimulasikan"
games_played: "Game dimainkan"
ratio: "Rasio"
leaderboard: "Papan Peringkat"
battle_as: "Bertempur sebagai"
summary_your: "Milik Anda"
summary_matches: "Cocok -"
summary_wins: "Menang"
summary_losses: "Kekalahan"
rank_no_code: "Tidak Ada Kode Baru untuk Diperingkat"
rank_my_game: "Rangking Game Saya!"
rank_submitting: "Mengirim ..."
rank_submitted: "Dikirim untuk Pemeringkatan"
rank_failed: "Gagal Ranking"
rank_being_ranked: "Game Menjadi Peringkat"
rank_last_submitted: "Kirim"
help_simulate: "Membantu mensimulasikan game?"
code_being_simulated: "Kode baru Anda sedang disimulasikan oleh pemain lain untuk peringkat. Ini akan menyegarkan saat pertandingan baru masuk."
no_ranked_matches_pre: "Tidak ada peringkat yang cocok untuk"
no_ranked_matches_post: " tim! Bermain melawan beberapa pesaing lalu kembali ke sini untuk mendapatkan peringkat game Anda."
choose_opponent: "PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI"
select_your_language: "Pilih bahasa Anda!"
tutorial_play: "Mainkan Tutorial"
tutorial_recommended: "Direkomendasikan jika Anda belum pernah bermain sebelumnya"
tutorial_skip: "Lewati Tutorial"
tutorial_not_sure: "Tidak yakin apa yang terjadi?"
tutorial_play_first: "Mainkan Tutorial dulu."
simple_ai: "CPU Sederhana"
warmup: "Pemanasan"
friends_playing: "Teman Bermain"
log_in_for_friends: "Masuk untuk bermain dengan teman Anda!"
social_connect_blurb: "Terhubung dan bermain melawan teman-temanmu!"
invite_friends_to_battle: "Undang temanmu untuk bergabung denganmu dalam pertempuran!"
fight: "Bertarung!" # {change}
watch_victory: "Perhatikan kemenanganmu"
defeat_the: "Kalahkan"
watch_battle: "Tonton pertempurannya"
# tournament_starts: "Tournament starts __timeElapsed__"
tournament_started: ", dimulai"
tournament_ends: "Turnamen berakhir"
tournament_ended: "Turnamen berakhir"
# tournament_results_published: ", results published"
tournament_rules: "Aturan Turnamen"
tournament_blurb_criss_cross: "Menangkan tawaran, membangun jalur, mengecoh lawan, raih permata, dan tingkatkan karier Anda di turnamen Criss-Cross kami! Lihat detailnya"
tournament_blurb_zero_sum: "Bebaskan kreativitas coding Anda dalam taktik mengumpulkan emas dan bertempur dalam pertandingan cermin alpen antara penyihir merah dan penyihir biru. Turnamen dimulai pada hari Jumat, 27 Maret dan akan berlangsung hingga Senin, 6 April pukul 17.00 PDT. Bersainglah untuk bersenang-senang dan mulia! Lihat detailnya "
tournament_blurb_ace_of_coders: "Bertarunglah di gletser beku dalam pertandingan cermin bergaya dominasi ini! Turnamen dimulai pada hari Rabu, 16 September dan akan berlangsung hingga Rabu, 14 Oktober pukul 17.00 PDT. Lihat detailnya"
tournament_blurb_blog: "di blog kami"
rules: "Aturan"
winners: "Pemenang"
league: "Liga"
red_ai: "CPU Merah" # "Red AI Wins", at end of multiplayer match playback
blue_ai: "CPU Biru"
wins: "Menang" # At end of multiplayer match playback
# losses: "Losses"
# win_num: "Wins"
# loss_num: "Losses"
# win_rate: "Win %"
humans: "MerPI:NAME:<NAME>END_PI" # Ladder page display team name
ogres: "Biru"
tournament_end_desc: "Turnamen selesai, terima kasih sudah bermain"
age: "Usia"
# age_bracket: "Age Bracket"
bracket_0_11: "0-11"
bracket_11_14: "11-14"
bracket_14_18: "14-18"
# bracket_11_18: "11-18"
bracket_open: "Buka"
user:
user_title: "__name__ - PI:NAME:<NAME>END_PIode dengan CodeCombat"
stats: "Statistik"
singleplayer_title: "Level Pemain Tunggal"
multiplayer_title: "Level Multi Pemain"
achievements_title: "Prestasi"
last_played: "Terakhir Dimainkan"
status: "Status"
status_completed: "Selesai"
status_unfinished: "Belum Selesai"
no_singleplayer: "Belum ada permainan Pemain Tunggal yang dimainkan."
no_multiplayer: "Belum ada permainan Multi Pemain yang dimainkan"
no_achievements: "Belum ada Prestasi yang dicapai."
favorite_prefix: "Bahasa favorit adalah "
favorite_postfix: "."
not_member_of_clans: "Belum menjadi anggota klan manapun."
certificate_view: "lihat sertifikat"
certificate_click_to_view: "klik untuk melihat sertifikat"
certificate_course_incomplete: "kursus belum selesai"
certificate_of_completion: "Sertifikat Penyelesaian"
certificate_endorsed_by: "Didukung oleh"
certificate_stats: "Statistik Kursus"
certificate_lines_of: "baris ke"
certificate_levels_completed: "level selesai"
certificate_for: "Untuk"
certificate_number: "Nomor"
achievements:
last_earned: "Terakhir diperoleh"
amount_achieved: "Jumlah"
achievement: "Prestasi"
current_xp_prefix: ""
current_xp_postfix: " secara keseluruhan"
new_xp_prefix: ""
new_xp_postfix: " diperoleh"
left_xp_prefix: ""
left_xp_infix: " sampai tingkat "
left_xp_postfix: ""
account:
title: "Akun"
settings_title: "Pengaturan Akun"
unsubscribe_title: "Berhenti berlangganan"
payments_title: "Pembayaran"
subscription_title: "Berlangganan"
invoices_title: "Faktur"
prepaids_title: "Prabayar"
payments: "Pembayaran"
prepaid_codes: "Kode Prabayar"
purchased: "Dibeli"
subscribe_for_gems: "Berlangganan untuk permata"
subscription: "Berlangganan"
invoices: "Tagihan"
service_apple: "Apple"
service_web: "Web"
paid_on: "Dibayar Pada"
service: "Servis"
price: "Harga"
gems: "Permata"
active: "Aktif"
subscribed: "Berlangganan"
unsubscribed: "Berhenti Berlangganan"
active_until: "Aktif Sampai"
cost: "Biaya"
next_payment: "Pembayaran Berikutnya"
card: "Kartu"
status_unsubscribed_active: "Anda tidak berlangganan dan tidak akan ditagih, tetapi akun anda masih aktif sampai saat ini."
status_unsubscribed: "Dapatkan akses level baru, jagoan, barang, dan bonus permata dengan berlangganan CodeCombat!"
not_yet_verified: "Belum diverifikasi."
resend_email: "Kirim ulang email"
email_sent: "Email terkirim! Cek kotak masuk anda."
verifying_email: "Melakukan verifikasi alamat email anda..."
successfully_verified: "Anda berhasil memverifikasi alamat email anda!"
verify_error: "Terjadi kesalahan ketika melakukan verifikasi email anda :("
unsubscribe_from_marketing: "Berhenti berlangganan __email__ dari semua marketing email CodeCombat?"
unsubscribe_button: "Ya, berhenti berlangganan"
unsubscribe_failed: "Gagal"
unsubscribe_success: "Sukses"
# manage_billing: "Manage Billing"
account_invoices:
amount: "Jumlah dalam US dollar"
declined: "Kartu anda ditolak"
invalid_amount: "Masukkan jumlah dalam US Dollar"
not_logged_in: "Masuk atau buat akun untuk mengakses tagihan."
pay: "Bayar Tagihan"
purchasing: "Membeli..."
retrying: "Terjadi kesalahan di server, mencoba kembali."
success: "Berhasil dibayar. Terima Kasih!"
account_prepaid:
purchase_code: "Beli Kode Langganan"
purchase_code1: "Kode Langganan dapat ditukarkan untuk menambah waktu langganan premium ke satu atau lebih akun untuk CodeCombat versi Rumah."
purchase_code2: "Setiap akun CodeCombat hanya dapat menukarkan Kode Langganan tertentu sekali."
purchase_code3: "Bulan Kode Langganan akan ditambahkan ke akhir langganan yang ada di akun."
purchase_code4: "Kode Langganan adalah untuk akun yang memainkan CodeCombat versi Home, kode ini tidak dapat digunakan sebagai pengganti Lisensi Pelajar untuk versi Kelas."
purchase_code5: "Untuk informasi lebih lanjut tentang Lisensi Pelajar, hubungi"
users: "Pengguna"
months: "Bulan"
purchase_total: "Total"
purchase_button: "Kirim Pembelian"
your_codes: "Kode Anda"
redeem_codes: "Tukarkan Kode Langganan"
prepaid_code: "Kode Prabayar"
lookup_code: "Cari kode prabayar"
apply_account: "Terapkan ke akun Anda"
copy_link: "Anda dapat menyalin tautan kode dan mengirimkannya ke seseorang."
quantity: "Kuantitas"
redeemed: "Ditebus"
no_codes: "Belum ada kode!"
you_can1: "Anda bisa"
you_can2: "beli kode prabayar"
you_can3: "yang dapat diterapkan ke akun Anda sendiri atau diberikan kepada orang lain."
impact:
hero_heading: "Membangun Program Ilmu Komputer Kelas Dunia"
hero_subheading: "Kami Membantu Memberdayakan Pendidik dan Menginspirasi Siswa di Seluruh Negeri"
featured_partner_story: "Kisah Mitra Unggulan"
partner_heading: "Berhasil Mengajar Coding di Sekolah Judul I"
partner_school: "Bobby Duke Middle School"
featured_teacher: "PI:NAME:<NAME>END_PI"
teacher_title: "Guru Teknologi Coachella, CA"
implementation: "Implementasi"
grades_taught: "NilPI:NAME:<NAME>END_PI"
length_use: "Panjang Penggunaan"
length_use_time: "3 tahun"
students_enrolled: "Siswa yang Mendaftar Tahun Ini"
students_enrolled_number: "130"
courses_covered: "Kursus yang Dicakup"
course1: "Ilmu Komputer 1"
course2: "Ilmu Komputer 2"
course3: "Ilmu Komputer 3"
course4: "Ilmu Komputer 4"
course5: "Pengembangan Game 1"
fav_features: "Fitur Favorit"
responsive_support: "Dukungan Responsif"
immediate_engagement: "Keterlibatan Segera"
paragraph1: "PI:NAME:<NAME>END_PI Duke Middle School terletak di antara pegunungan California Selatan di Lembah Coachella di barat dan timur dan Laut Salton 33 mil selatan, dan membanggakan populasi siswa 697 siswa dalam populasi seluruh distrik Coachella Valley Unified sebanyak 18.861 siswa . "
paragraph2: "Para siswa Sekolah Menengah PI:NAME:<NAME>END_PI mencerminkan tantangan sosial ekonomi yang dihadapi penduduk dan siswa Coachella Valley di dalam distrik tersebut. Dengan lebih dari 95% populasi siswa Sekolah Menengah Bobby Duke memenuhi syarat untuk makan gratis dan dengan harga lebih murah dan lebih dari 40% diklasifikasikan sebagai pembelajar bahasa Inggris, pentingnya mengajarkan keterampilan abad ke-21 adalah prioritas utama guru Teknologi Sekolah Menengah BPI:NAME:<NAME>END_PI Duke, PI:NAME:<NAME>END_PI. "
paragraph3: "Baily tahu bahwa mengajari siswanya pengkodean adalah jalan utama menuju peluang dalam lanskap pekerjaan yang semakin memprioritaskan dan membutuhkan keterampilan komputasi. Jadi, dia memutuskan untuk mengambil tantangan yang menarik dalam membuat dan mengajar satu-satunya kelas pengkodean di sekolah dan menemukan solusi yang terjangkau, responsif terhadap umpan balik, dan menarik bagi siswa dari semua kemampuan dan latar belakang belajar. "
teacher_quote: "Ketika saya mendapatkan CodeCombat [dan] mulai meminta siswa saya menggunakannya, bola lampu menyala. Hanya siang dan malam dari setiap program lain yang kami gunakan. Mereka bahkan tidak menutup."
quote_attribution: "PI:NAME:<NAME>END_PI, Guru Teknologi"
read_full_story: "Baca Kisah Lengkap"
more_stories: "Lebih Banyak Kisah Mitra"
partners_heading_1: "Mendukung Banyak Jalur CS dalam Satu Kelas"
partners_school_1: "Preston High School"
partners_heading_2: "Unggul dalam Ujian AP"
partners_school_2: "River Ridge High School"
partners_heading_3: "Mengajar Ilmu Komputer Tanpa Pengalaman Sebelumnya"
partners_school_3: "Riverdale High School"
download_study: "Unduh Studi Riset"
teacher_spotlight: "Sorotan Guru & Siswa"
teacher_name_1: "PI:NAME:<NAME>END_PI"
teacher_title_1: "Instruktur Rehabilitasi"
teacher_location_1: "Morehead, Kentucky"
spotlight_1: "Melalui belas kasih dan semangatnya untuk membantu mereka yang membutuhkan kesempatan kedua, PI:NAME:<NAME>END_PI membantu mengubah kehidupan siswa yang membutuhkan teladan positif. Tanpa pengalaman ilmu komputer sebelumnya, PI:NAME:<NAME>END_PI memimpin siswanya meraih kesuksesan coding dalam kompetisi coding regional . "
teacher_name_2: "PI:NAME:<NAME>END_PI"
teacher_title_2: "Maysville Community & Technical College"
teacher_location_2: "Lexington, Kentucky"
spotlight_2: "Kaila adalah seorang siswa yang tidak pernah mengira dia akan menulis baris kode, apalagi mendaftar di perguruan tinggi dengan jalan menuju masa depan yang cerah."
teacher_name_3: "PI:NAME:<NAME>END_PI"
teacher_title_3: "Pustakawan Guru"
teacher_school_3: "Ruby Bridges Elementary"
teacher_location_3: "Alameda, CA"
spotlight_3: "PI:NAME:<NAME>END_PI mempromosikan suasana yang setara di kelasnya di mana setiap orang dapat menemukan kesuksesan dengan caranya sendiri. Kesalahan dan perjuangan disambut karena semua orang belajar dari tantangan, bahkan dari guru."
continue_reading_blog: "Lanjutkan Membaca di Blog ..."
loading_error:
could_not_load: "Kesalahan memuat dari server. Coba segarkan halaman."
connection_failure: "Koneksi Gagal"
connection_failure_desc: "Sepertinya kamu tidak terhubung dengan internet! Periksa jaringan kamu dan muat ulang halaman ini."
login_required: "PI:NAME:<NAME>END_PI"
login_required_desc: "Anda harus masuk untuk mengakses halaman ini."
unauthorized: "Anda harus masuk. Apakah anda menonaktifkan cookies?"
forbidden: "Terlarang"
forbidden_desc: "Oh tidak, tidak ada yang kami bisa tunjukkan kepadamu di sini! Pastikan kamu masuk menggunakan akun yang benar, atau kunjungi salah satu tautan dibawah untuk kembali ke pemrograman!"
user_not_found: "Pengguna tidak ditemukan"
not_found: "Tidak Ditemukan"
not_found_desc: "Hm, tidak ada apa-apa di sini. Kunjungi salah satu tautan berikut untuk kembali ke pemrograman!"
not_allowed: "Metode tidak diijinkan."
timeout: "Waktu Server Habis"
conflict: "Konflik sumber daya."
bad_input: "Masukan salah."
server_error: "Kesalahan server."
unknown: "Kesalahan tidak diketahui"
error: "KESALAHAN"
general_desc: "Ada yang salah, dan mungkin itu salah kami. Coba tunggu sebentar lalu muat ulang halaman, atau kunjungi salah satu tautan dibawah untuk kembali ke pemrograman!"
too_many_login_failures: "Terlalu banyak upaya login yang gagal. Silakan coba lagi nanti."
resources:
level: "Level"
patch: "Perbaikan"
patches: "Perbaikan"
system: "Sistem"
systems: "Sistem"
component: "Komponen"
components: "Komponen"
hero: "Jagoan"
campaigns: "Kampanye"
concepts:
advanced_css_rules: "Aturan CSS Lanjutan"
advanced_css_selectors: "Advanced CSS Selectors"
advanced_html_attributes: "Atribut HTML Lanjutan"
advanced_html_tags: "Tag HTML Lanjutan"
algorithm_average: "Rata-Rata Algoritme"
algorithm_find_minmax: "Algoritma Temukan Min / Maks"
algorithm_search_binary: "Biner Penelusuran Algoritme"
algorithm_search_graph: "Grafik Penelusuran Algoritme"
algorithm_sort: "Urutan Algoritme"
algorithm_sum: "Jumlah Algoritme"
arguments: "Argumen"
arithmetic: "Aritmatika"
array_2d: "Larik 2D"
array_index: "Pengindeksan Array"
array_iterating: "Iterasi Terhadap Array"
array_literals: "Array Literals"
array_searching: "Pencarian Array"
array_sorting: "Penyortiran Array"
arrays: "Array"
basic_css_rules: "Aturan CSS dasar"
basic_css_selectors: "Pemilih CSS dasar"
basic_html_attributes: "Atribut HTML Dasar"
basic_html_tags: "Tag HTML Dasar"
basic_syntax: "Sintaks Dasar"
binary: "Biner"
boolean_and: "Boolean Dan"
boolean_inequality: "Pertidaksamaan Boolean"
boolean_equality: "Persamaan Boolean"
boolean_greater_less: "Boolean Lebih Besar / Kurang"
boolean_logic_shortcircuit: "Boolean Logika Shortcircuit"
boolean_not: "Boolean Not"
boolean_operator_precedence: "Prioritas Operator Boolean"
boolean_or: "Boolean Atau"
boolean_with_xycoordinates: "Perbandingan Koordinat"
bootstrap: "Bootstrap"
break_statements: "Pernyataan Hentian"
classes: "Kelas"
continue_statements: "Pernyataan Lanjutan"
dom_events: "Event DOM"
dynamic_styling: "Penataan Gaya Dinamis"
events: "Event"
event_concurrency: "Konkurensi Event"
event_data: "Data Event"
event_handlers: "Penangan Event"
event_spawn: "Bibit Event"
for_loops: "For Loop"
for_loops_nested: "For Loops Bersarang"
for_loops_range: "Untuk Rentang Pengulangan"
functions: "Fungsi"
functions_parameters: "Parameter"
functions_multiple_parameters: "Beberapa Parameter"
game_ai: "Game AI"
game_goals: "Tujuan Game"
game_spawn: "Game Spawn"
graphics: "Grafik"
graphs: "Grafik"
heaps: "Heap"
if_condition: "Pernyataan Bersyarat If"
if_else_if: " Pernyataan Jika / Jika Lain"
if_else_statements: "Pernyataan If / Else"
if_statements: "Jika Pernyataan"
if_statements_nested: "Pernyataan Jika Bersarang"
indexing: "Indeks Array"
input_handling_flags: "Penanganan Input - Bendera"
input_handling_keyboard: "Penanganan Input - Keyboard"
input_handling_mouse: "Penanganan Input - Mouse"
intermediate_css_rules: "Aturan CSS Menengah"
intermediate_css_selectors: "Pemilih CSS Menengah"
intermediate_html_attributes: "Atribut HTML Menengah"
intermediate_html_tags: "Tag HTML Menengah"
jquery: "jQuery"
jquery_animations: "Animasi jQuery"
jquery_filtering: "Pemfilteran Elemen jQuery"
jquery_selectors: "jQuery Selector"
length: "Panjang Array"
math_coordinates: "Matematika Koordinat"
math_geometry: "Geometri"
math_operations: "Operasi Perpustakaan Matematika"
math_proportions: "Proporsi Matematika"
math_trigonometry: "Trigonometri"
object_literals: "Objek literal"
parameters: "Parameter"
programs: "Program"
properties: "Properti"
property_access: "Mengakses Properti"
property_assignment: "Menetapkan Properti"
property_coordinate: "Properti Koordinat"
queues: "Struktur Data - Antrian"
reading_docs: "Membaca Dokumen"
recursion: "Rekursi"
return_statements: "Pernyataan Pengembalian"
stacks: "Struktur Data - Tumpukan"
strings: "String"
strings_concatenation: "Penggabungan String"
strings_substrings: "Substring"
trees: "Struktur Data - Pohon"
variables: "Variabel"
vectors: "Vektor"
while_condition_loops: "While Loops dengan Persyaratan"
while_loops_simple: "While Loops"
while_loops_nested: "Nested While Loops"
xy_coordinates: "Pasangan Koordinat"
advanced_strings: "String Lanjutan" # Rest of concepts are deprecated
algorithms: "Algoritme"
boolean_logic: "Boolean Logic"
basic_html: "HTML Dasar"
basic_css: "CSS Dasar"
basic_web_scripting: "Pembuatan Skrip Web Dasar"
intermediate_html: "HTML Menengah"
intermediate_css: "CSS Menengah"
intermediate_web_scripting: "Pembuatan Skrip Web Menengah"
advanced_html: "HTML Lanjutan"
advanced_css: "CSS Lanjutan"
advanced_web_scripting: "Pembuatan Skrip Web Tingkat Lanjut"
input_handling: "Penanganan Input"
while_loops: "While Loops"
place_game_objects: "Tempatkan objek game"
construct_mazes: "Bangun labirin"
create_playable_game: "Buat proyek game yang dapat dimainkan dan dapat dibagikan"
alter_existing_web_pages: "Ubah halaman web yang ada"
create_sharable_web_page: "Buat halaman web yang bisa dibagikan"
basic_input_handling: "Penanganan Input Dasar"
basic_game_ai: "AI Game Dasar"
basic_javascript: "JavaScript Dasar"
basic_event_handling: "Penanganan Event Dasar"
create_sharable_interactive_web_page: "Buat halaman web interaktif yang dapat dibagikan"
anonymous_teacher:
notify_teacher: "PI:NAME:<NAME>END_PI"
create_teacher_account: "Buat akun guru gratis"
enter_student_name: "Nama anda:"
enter_teacher_email: "Email guru anda:"
teacher_email_placeholder: "PI:EMAIL:<EMAIL>END_PI"
student_name_placeholder: "ketik nama anda di sini"
teachers_section: "Guru:"
students_section: "Siswa:"
teacher_notified: "Kami telah memberi tahu guru kamu bahwa kamu ingin memainkan lebih CodeCombat di kelasmu!"
delta:
added: "Ditambahkan"
modified: "Berubah"
not_modified: "Tidak Berubah"
deleted: "Dihapus"
moved_index: "Indeks Pindah"
text_diff: "Perbedaan Teks"
merge_conflict_with: "GABUNG PERBEDAAN DENGAN"
no_changes: "Tidak Ada Perubahan"
legal:
page_title: "Hukum"
opensource_introduction: "CodeCombat adalah bagian dari komunitas open source."
opensource_description_prefix: "Lihat"
github_url: "GitHub kami"
opensource_description_center: "dan bantu jika Anda suka! CodeCombat dibangun di atas lusinan proyek open source, dan kami menyukainya. Lihat"
archmage_wiki_url: "wiki Archmage kami"
opensource_description_suffix: "untuk daftar perangkat lunak yang memungkinkan permainan ini."
practices_title: "Praktik Terbaik yang Menghormati"
practices_description: "Ini adalah janji kami untuk Anda, pemain, dalam bahasa yang tidak terlalu legal."
privacy_title: "Privasi"
privacy_description: "Kami tidak akan menjual informasi pribadi Anda."
security_title: "Keamanan"
security_description: "Kami berusaha keras untuk menjaga keamanan informasi pribadi Anda. Sebagai proyek sumber terbuka, situs kami terbuka secara bebas bagi siapa saja untuk meninjau dan meningkatkan sistem keamanan kami."
email_title: "Email"
email_description_prefix: "Kami tidak akan membanjiri Anda dengan spam. Melalui"
email_settings_url: "setelan email Anda"
email_description_suffix: "atau melalui tautan di email yang kami kirim, Anda dapat mengubah preferensi dan berhenti berlangganan dengan mudah kapan saja."
cost_title: "Biaya"
cost_description: "CodeCombat gratis dimainkan untuk semua level intinya, dengan langganan $ {{price}} USD / bln untuk akses ke cabang level ekstra dan {{gems}} permata bonus per bulan. Anda dapat membatalkan dengan klik, dan kami menawarkan jaminan uang kembali 100%. " # {change}
copyrights_title: "Hak Cipta dan Lisensi"
contributor_title: "Perjanjian Lisensi Kontributor"
contributor_description_prefix: "Semua kontribusi, baik di situs dan di repositori GitHub kami, tunduk pada"
cla_url: "CLA"
contributor_description_suffix: "yang harus Anda setujui sebelum berkontribusi."
code_title: "Kode Sisi Klien - MIT"
client_code_description_prefix: "Semua kode sisi klien untuk codecombat.com di repositori GitHub publik dan dalam database codecombat.com, dilisensikan di bawah"
mit_license_url: "lisensi MIT"
code_description_suffix: "Ini termasuk semua kode dalam Sistem dan Komponen yang disediakan oleh CodeCombat untuk tujuan membuat level."
art_title: "Seni / Musik - Creative Commons"
art_description_prefix: "Semua konten umum tersedia di bawah"
cc_license_url: "Lisensi Internasional Creative Commons Attribution 4.0"
art_description_suffix: "Konten umum adalah segala sesuatu yang secara umum disediakan oleh CodeCombat untuk tujuan membuat Level. Ini termasuk:"
art_music: "Musik"
art_sound: "Suara"
art_artwork: "Karya Seni"
art_sprites: "Sprite"
art_other: "Semua karya kreatif non-kode lainnya yang tersedia saat membuat Level."
art_access: "Saat ini tidak ada sistem universal dan mudah untuk mengambil aset ini. Secara umum, ambil dari URL seperti yang digunakan oleh situs, hubungi kami untuk bantuan, atau bantu kami dalam memperluas situs untuk membuat aset ini lebih mudah diakses . "
art_paragraph_1: "Untuk atribusi, harap beri nama dan tautkan ke codecombat.com di dekat tempat sumber digunakan atau jika sesuai untuk medianya. Misalnya:"
use_list_1: "Jika digunakan dalam film atau game lain, sertakan codecombat.com dalam kreditnya."
use_list_2: "Jika digunakan di situs web, sertakan tautan di dekat penggunaan, misalnya di bawah gambar, atau di laman atribusi umum tempat Anda juga dapat menyebutkan karya Creative Commons lainnya dan perangkat lunak sumber terbuka yang digunakan di situs itu. sudah dengan jelas mereferensikan CodeCombat, seperti entri blog yang menyebutkan CodeCombat, tidak memerlukan atribusi terpisah. "
art_paragraph_2: "Jika konten yang digunakan bukan dibuat oleh CodeCombat melainkan oleh pengguna codecombat.com, atributkan konten tersebut sebagai gantinya, dan ikuti petunjuk atribusi yang diberikan dalam deskripsi sumber daya tersebut jika ada."
rights_title: "Hak Dilindungi"
rights_desc: "Semua hak dilindungi undang-undang untuk Level itu sendiri. Ini termasuk"
rights_scripts: "Skrip"
rights_unit: "Konfigurasi unit"
rights_writings: "Tulisan"
rights_media: "Media (suara, musik) dan konten kreatif lainnya yang dibuat khusus untuk Tingkat itu dan tidak tersedia secara umum saat membuat Tingkat."
rights_clarification: "Untuk memperjelas, apa pun yang tersedia di Editor Tingkat untuk tujuan membuat tingkat berada di bawah CC, sedangkan konten yang dibuat dengan Editor Tingkat atau diunggah selama pembuatan Tingkat tidak."
nutshell_title: "Sekilas"
nutshell_description: "Sumber daya apa pun yang kami sediakan di Editor Tingkat bebas digunakan sesuka Anda untuk membuat Tingkat. Namun kami berhak membatasi distribusi Tingkat itu sendiri (yang dibuat di codecombat.com) sehingga dapat dikenai biaya untuk."
nutshell_see_also: "Lihat juga:"
canonical: "Versi bahasa Inggris dari dokumen ini adalah versi definitif dan kanonik. Jika ada perbedaan antara terjemahan, dokumen bahasa Inggris diutamakan."
third_party_title: "Layanan Pihak Ketiga"
third_party_description: "CodeCombat menggunakan layanan pihak ketiga berikut (antara lain):"
cookies_message: "CodeCombat menggunakan beberapa cookie penting dan non-esensial."
cookies_deny: "Tolak cookie yang tidak penting"
cookies_allow: "Izinkan cookie"
calendar:
year: "Tahun"
day: "Hari"
month: "Bulan"
january: "Januari"
february: "Februari"
march: "Maret"
april: "April"
may: "Mei"
june: "Juni"
july: "Juli"
august: "Agustus"
september: "September"
october: "Oktober"
november: "November"
december: "Desember"
code_play_create_account_modal:
title: "Kamu berhasil!" # This section is only needed in US, UK, Mexico, India, and Germany
body: "Anda sekarang dalam perjalanan untuk menjadi master coder. Daftar untuk menerima <strong> 100 Permata </strong> ekstra & Anda juga akan dimasuki untuk kesempatan <strong> memenangkan $2.500 & Hadiah Lenovo lainnya </strong>. "
sign_up: "Daftar & pertahankan coding ▶"
victory_sign_up_poke: "Buat akun gratis untuk menyimpan kode Anda & masuki kesempatan untuk memenangkan hadiah!"
victory_sign_up: "Daftar & ikuti <strong> win $2.500 </strong>"
server_error:
email_taken: "Email telah diambil"
username_taken: "Username telah diambil"
easy_password: "PI:PASSWORD:<PASSWORD>END_PI"
reused_password: "PI:PASSWORD:<PASSWORD>END_PI"
esper:
line_no: "Baris $1:"
uncaught: "Tidak tertangkap $1" # $1 will be an error type, eg "Uncaught SyntaxError"
reference_error: "Kesalahan Referensi: "
argument_error: "Kesalahan Argumen: "
type_error: "Kesalahan Tipe: "
syntax_error: "Kesalahan Sintaks: "
error: "Kesalahan: "
x_not_a_function: "$1 bukan fungsi"
x_not_defined: "$1 tidak ditentukan"
spelling_issues: "Waspadai masalah ejaan: apakah yang Anda maksud adalah `$1`, bukan `$2`?"
capitalization_issues: "Perhatikan kapitalisasi: `$1` seharusnya `$2`."
py_empty_block: "Kosongkan $1. Letakkan 4 spasi di depan pernyataan di dalam pernyataan $2."
fx_missing_paren: "Jika Anda ingin memanggil `$1` sebagai fungsi, Anda memerlukan `()`'s "
unmatched_token: "Tidak cocok `$1`. Setiap pembukaan `$2` membutuhkan penutup `$3` untuk mencocokkannya. "
unterminated_string: "String tidak diakhiri. Tambahkan `\"` yang cocok di akhir string Anda. "
missing_semicolon: "Titik koma tidak ada."
missing_quotes: "Kutipan tidak ada. Coba `$1` "
argument_type: "Argumen `$1` `$2` seharusnya memiliki jenis `$3`, tetapi mendapatkan `$4`: `$5`. "
argument_type2: "Argumen `$1` `$2` seharusnya memiliki jenis `$3`, tetapi mendapatkan `$4`."
target_a_unit: "Targetkan sebuah unit."
attack_capitalization: "Serang $1, bukan $2. (Huruf kapital penting.)"
empty_while: "Statement while kosong. Letakkan 4 spasi di depan pernyataan di dalam pernyataan while."
line_of_site: "Argumen `$1` `$2` bermasalah. Apakah masih ada musuh dalam garis pandang Anda?"
need_a_after_while: "Membutuhkan `$1` setelah `$2`."
too_much_indentation: "Terlalu banyak indentasi di awal baris ini."
missing_hero: "Kata kunci `$1` tidak ada; seharusnya `$2`."
takes_no_arguments: "`$1` tidak membutuhkan argumen. "
no_one_named: "Tidak ada yang bernama \"$1\" untuk ditargetkan."
separated_by_comma: "Pemanggilan fungsi paramaters harus dipisahkan oleh `,`s"
protected_property: "Tidak dapat membaca properti yang dilindungi: $1"
need_parens_to_call: "Jika Anda ingin memanggil `$1` sebagai fungsi, Anda memerlukan `()`'s "
expected_an_identifier: "Mengharapkan pengenal dan malah melihat '$1'."
unexpected_identifier: "Pengenal tak terduga"
unexpected_end_of: "Akhir masukan tak terduga"
unnecessary_semicolon: "Titik koma tidak perlu."
unexpected_token_expected: "Token tidak terduga: diharapkan $1 tetapi menemukan $2 saat mengurai $3"
unexpected_token: "Token tak terduga $1"
unexpected_token2: "Token tidak terduga"
unexpected_number: "Angka tidak terduga"
unexpected: "'$1' tak terduga."
escape_pressed_code: "Escape ditekan; kode dibatalkan."
target_an_enemy: "Targetkan musuh dengan nama, seperti `$1`, bukan string `$2`."
target_an_enemy_2: "Targetkan musuh dengan nama, seperti $1."
cannot_read_property: "Tidak dapat membaca properti '$1' dari undefined"
attempted_to_assign: "Mencoba menugaskan ke properti hanya-baca."
unexpected_early_end: "Akhir program yang tidak terduga."
you_need_a_string: "Anda memerlukan string untuk membuat; salah satu dari $1"
unable_to_get_property: "Tidak bisa mendapatkan properti '$1' dari referensi tidak terdefinisi atau null" # TODO: Do we translate undefined/null?
code_never_finished_its: "Kode tidak pernah selesai. Bisa sangat lambat atau memiliki putaran tak terbatas."
unclosed_string: "String tidak tertutup"
unmatched: "Tidak ada yang cocok '$1'."
error_you_said_achoo: "Anda mengatakan: $1, tetapi sandinya adalah: $2. (Huruf kapital penting.)"
indentation_error_unindent_does: "Kesalahan Indentasi: unindent tidak cocok dengan tingkat indentasi luar mana pun"
indentation_error: "Kesalahan indentasi."
need_a_on_the: "Perlu `:` di akhir baris setelah `$1`. "
attempt_to_call_undefined: "coba panggil '$1' (nilai nihil)"
unterminated: "Tidak diakhiri `$1` "
target_an_enemy_variable: "Targetkan variabel $1, bukan string $2. (Coba gunakan $3.)"
error_use_the_variable: "Gunakan nama variabel seperti `$1` sebagai ganti string seperti `$2`"
indentation_unindent_does_not: "Indentasi tidak indentasi tidak cocok dengan tingkat indentasi luar mana pun"
unclosed_paren_in_function_arguments: "$1 tidak ditutup dalam argumen fungsi."
unexpected_end_of_input: "Akhir input tak terduga"
there_is_no_enemy: "Tidak ada `$1`. Gunakan `$2` dulu." # Hints start here
try_herofindnearestenemy: "Coba `$1`"
there_is_no_function: "Tidak ada fungsi `$1`, tetapi `$2` memiliki metode `$3`. "
attacks_argument_enemy_has: "Argumen `$1` `$2` bermasalah."
is_there_an_enemy: "Apakah masih ada musuh dalam garis pandang Anda?"
target_is_null_is: "Targetnya $1. Apakah selalu ada target untuk diserang? (Gunakan $2?)"
hero_has_no_method: "`$1` tidak memiliki metode `$2`."
there_is_a_problem: "Ada masalah dengan kode Anda."
did_you_mean: "Apakah maksud Anda $1? Anda tidak memiliki item yang dilengkapi dengan keterampilan itu."
missing_a_quotation_mark: "Tanda petik tidak ada."
missing_var_use_var: "Tidak ada `$1`. Gunakan `$2` untuk membuat variabel baru."
you_do_not_have: "Anda tidak memiliki item yang dilengkapi dengan keahlian $1."
put_each_command_on: "Tempatkan setiap perintah pada baris terpisah"
are_you_missing_a: "Apakah Anda kehilangan '$1' setelah '$2'?"
your_parentheses_must_match: "Tanda kurung Anda harus cocok."
apcsp:
title: "AP Computer Science Principals | College Board Endorsed"
meta_description: "Hanya kurikulum CodeCombat yang komprehensif dan program pengembangan profesional yang Anda butuhkan untuk menawarkan kursus ilmu komputer terbaru College Board kepada siswa Anda."
syllabus: "Silabus Prinsip AP CS"
syllabus_description: "Gunakan sumber daya ini untuk merencanakan kurikulum CodeCombat untuk kelas AP Computer Science Principles Anda."
computational_thinking_practices: "Praktik Berpikir Komputasi"
learning_objectives: "Tujuan Pembelajaran"
curricular_requirements: "Persyaratan Kurikuler"
unit_1: "Unit 1: Teknologi Kreatif"
unit_1_activity_1: "Aktivitas Unit 1: Tinjauan Kegunaan Teknologi"
unit_2: "Unit 2: Pemikiran Komputasi"
unit_2_activity_1: "Aktivitas Unit 2: Urutan Biner"
unit_2_activity_2: "Kegiatan Unit 2: Menghitung Proyek Pelajaran"
unit_3: "Unit 3: Algoritme"
unit_3_activity_1: "Aktivitas Unit 3: Algoritma - Panduan Penumpang"
unit_3_activity_2: "Kegiatan Unit 3: Simulasi - Predator & Mangsa"
unit_3_activity_3: "Aktivitas Unit 3: Algoritma - Desain dan Pemrograman Pasangan"
unit_4: "Unit 4: Pemrograman"
unit_4_activity_1: "Aktivitas Unit 4: Abstraksi"
unit_4_activity_2: "Aktivitas Unit 4: Menelusuri & Menyortir"
unit_4_activity_3: "Aktivitas Unit 4: Refactoring"
unit_5: "Unit 5: Internet"
unit_5_activity_1: "Aktivitas Unit 5: Cara Kerja Internet"
unit_5_activity_2: "Aktivitas Unit 5: Simulator Internet"
unit_5_activity_3: "Aktivitas Unit 5: Simulasi Ruang Obrolan"
unit_5_activity_4: "Aktivitas Unit 5: Keamanan Siber"
unit_6: "Unit 6: Data"
unit_6_activity_1: "Kegiatan Unit 6: Pengantar Data"
unit_6_activity_2: "Aktivitas Unit 6: Big Data"
unit_6_activity_3: "Aktivitas Unit 6: Kompresi Lossy & Lossless"
unit_7: "Unit 7: Dampak Pribadi & Global"
unit_7_activity_1: "Aktivitas Unit 7: Dampak Pribadi & Global"
unit_7_activity_2: "Aktivitas Unit 7: Sumber Daya Crowdsourcing"
unit_8: "Unit 8: Tugas Kinerja"
unit_8_description: "Persiapkan siswa untuk Membuat Tugas dengan membuat game mereka sendiri dan mempraktikkan konsep utama."
unit_8_activity_1: "Membuat Latihan Tugas 1: Pengembangan Game 1"
unit_8_activity_2: "Membuat Latihan Tugas 2: Pengembangan Game 2"
unit_8_activity_3: "Buat Latihan Tugas 3: Pengembangan Game 3"
unit_9: "Unit 9: Ulasan AP"
unit_10: "Unit 10: Pasca-AP"
unit_10_activity_1: "Aktivitas Unit 10: Kuis Web"
parents_landing_2:
splash_title: "Temukan keajaiban coding di rumah."
learn_with_instructor: "Belajar dengan Instruktur"
live_classes: "Kelas Daring Langsung"
live_classes_offered: "CodeCombat sekarang menawarkan kelas ilmu komputer online langsung untuk siswa yang belajar di rumah. Cocok untuk siswa yang bekerja paling baik dalam pengaturan 1: 1 atau kelompok kecil di mana hasil belajar disesuaikan dengan kebutuhan mereka."
live_class_details_1: "Kelompok kecil atau pelajaran pribadi"
live_class_details_2: "Pengodean JavaScript dan Python, ditambah konsep inti Ilmu Komputer"
live_class_details_3: "Diajarkan oleh instruktur pengkodean ahli"
live_class_details_4: "Masukan pribadi dan instan"
live_class_details_5: "Kurikulum dipercaya oleh lebih dari 80.000 pendidik"
try_free_class: "Coba kelas 60 menit gratis"
pricing_plans: "Paket Harga"
choose_plan: "Pilih Paket"
per_student: "per siswa"
sibling_discount: "Diskon Saudara 15%!"
small_group_classes: "Kelas Pengkodean Grup Kecil"
small_group_classes_detail: "4 Sesi Grup / Bulan."
small_group_classes_price: "$159/bln"
small_group_classes_detail_1: "Rasio siswa dan instruktur 4:1"
small_group_classes_detail_2: "Kelas 60 menit"
small_group_classes_detail_3: "Buat proyek dan berikan masukan kepada siswa lain"
small_group_classes_detail_4: "Berbagi layar untuk mendapatkan umpan balik langsung tentang pengkodean dan debugging"
private_classes: "Kelas Pengodean Pribadi"
four_sessions_per_month: "4 Sesi Pribadi / Bulan"
eight_sessions_per_month: "8 Sesi Pribadi / Bulan"
four_private_classes_price: "$219 / bln"
eight_private_classes_price: "$399 / bln"
private_classes_detail: "4 atau 8 Sesi Pribadi / Bulan."
private_classes_price: "$219/bln atau $399/bln"
private_classes_detail_1: "Rasio siswa dan instruktur 1: 1"
private_classes_detail_2: "kelas 60 menit"
private_classes_detail_3: "Jadwal fleksibel yang disesuaikan dengan kebutuhan Anda"
private_classes_detail_4: "Rencana pelajaran dan masukan langsung yang disesuaikan dengan gaya belajar, kecepatan, dan tingkat kemampuan siswa"
best_seller: "Penjualan terbaik"
best_value: "Nilai terbaik"
codecombat_premium: "CodeCombat Premium"
learn_at_own_pace: "Belajar dengan Kecepatan Anda Sendiri"
monthly_sub: "Langganan Bulanan"
buy_now: "Beli sekarang"
per_month: "/bulan"
lifetime_access: "Akses Seumur Hidup"
premium_details_title: "Bagus untuk pelajar mandiri yang berkembang dengan otonomi penuh."
premium_details_1: "Akses ke pahlawan, hewan peliharaan, dan keterampilan khusus pelanggan"
premium_details_2: "Dapatkan permata bonus untuk membeli perlengkapan, hewan peliharaan, dan lebih banyak pahlawan"
premium_details_3: "Buka pemahaman yang lebih dalam tentang konsep inti dan keterampilan seperti pengembangan web dan game"
premium_details_4: "Dukungan premium untuk pelanggan"
premium_details_5: "Buat klan pribadi untuk mengundang teman dan bersaing di papan peringkat grup"
premium_need_help: "Butuh bantuan atau lebih suka Paypal? Email <a href=\"mailto:PI:EMAIL:<EMAIL>END_PI\"> PI:EMAIL:<EMAIL>END_PI </a>"
not_sure_kid: "Tidak yakin apakah CodeCombat tepat untuk anak Anda? Tanya mereka!"
share_trailer: "Bagikan cuplikan game kami dengan anak Anda dan minta mereka membuat akun untuk memulai."
why_kids_love: "Mengapa Anak-Anak Suka CodeCombat"
learn_through_play: "Belajar Melalui Permainan"
learn_through_play_detail: "Siswa mengembangkan keterampilan pengkodean mereka, dan juga menggunakan keterampilan pemecahan masalah untuk maju melalui level dan memperkuat pahlawan mereka."
skills_they_can_share: "Keterampilan yang Dapat Mereka Bagikan"
skills_they_can_share_details: "Siswa membangun keterampilan dunia nyata dan membuat proyek, seperti game dan halaman web, yang dapat mereka bagikan dengan teman dan keluarga."
help_when_needed: "Bantuan Saat Mereka Membutuhkannya"
help_when_needed_detail: "Dengan menggunakan data, setiap level telah dibangun untuk menantang, tetapi tidak pernah mengecewakan. Siswa didukung dengan petunjuk saat mereka mengalami kebuntuan."
book_first_class: "Pesan kelas pertama Anda"
why_parents_love: "Mengapa Orang Tua Suka CodeCombat"
most_engaging: "Cara paling menarik untuk mempelajari kode yang diketik"
most_engaging_detail: "Anak Anda akan memiliki semua yang mereka butuhkan di ujung jari mereka untuk memprogram algoritme dalam Python atau JavaScript, membuat situs web, dan bahkan merancang game mereka sendiri, sambil mempelajari materi yang selaras dengan standar kurikulum nasional."
critical_skills: "Membangun keterampilan penting untuk abad ke-21"
critical_skills_detail: "Anak Anda akan belajar cara menavigasi dan menjadi warga negara di dunia digital. CodeCombat adalah solusi yang meningkatkan pemikiran kritis, kreativitas, dan ketahanan anak Anda, memberdayakan mereka dengan keterampilan yang mereka butuhkan untuk industri apa pun."
parent_support: "Didukung oleh orang tua seperti Anda"
parent_support_detail: "Di CodeCombat, kami adalah orang tua. Kami pembuat kode. Kami adalah pendidik. Namun yang terpenting, kami adalah orang-orang yang percaya dalam memberi anak-anak kami kesempatan terbaik untuk sukses dalam apa pun yang mereka putuskan untuk lakukan . "
everything_they_need: "Semua yang mereka butuhkan untuk mulai mengetik kode sendiri"
beginner_concepts: "Konsep Pemula"
beginner_concepts_1: "Sintaks dasar"
beginner_concepts_2: "While loop"
beginner_concepts_3: "Argumen"
beginner_concepts_4: "String"
beginner_concepts_5: "Variable"
beginner_concepts_6: "Algoritme"
intermediate_concepts: "Konsep Menengah"
intermediate_concepts_1: "Pernyataan Jika"
intermediate_concepts_2: "Perbandingan Boolean"
intermediate_concepts_3: "Kondisional bertingkat"
intermediate_concepts_4: "Fungsi"
intermediate_concepts_5: "Penanganan input dasar"
intermediate_concepts_6: "Kecerdasan buatan permainan dasar"
advanced_concepts: "Konsep Lanjutan"
advanced_concepts_1: "Penanganan Event"
advanced_concepts_2: "Bersyarat saat loop"
advanced_concepts_3: "Objek literals"
advanced_concepts_4: "Parameter"
advanced_concepts_5: "Vektor"
advanced_concepts_6: "Operasi perpustakaan matematika"
advanced_concepts_7: "Rekursi"
get_started: "Memulai"
quotes_title: "Apa yang orang tua dan anak-anak katakan tentang CodeCombat"
quote_1: "\"Ini adalah pengkodean tingkat berikutnya untuk anak-anak dan sangat menyenangkan. Saya akan belajar satu atau dua hal dari ini juga. \""
quote_2: "\"Saya suka mempelajari keterampilan baru yang belum pernah saya lakukan sebelumnya. Saya suka ketika saya berjuang, saya bisa menemukan tujuan. Saya juga senang Anda dapat melihat kode tersebut berfungsi dengan benar. \""
quote_3: "\"PI:NAME:<NAME>END_PI’s Python akan segera hadir. Dia menggunakan CodeCombat untuk membuat gim videonya sendiri. Dia menantang saya untuk memainkan permainannya, lalu tertawa ketika saya kalah. \""
quote_4: "\"Ini adalah salah satu hal favorit saya untuk dilakukan. Setiap pagi saya bangun dan bermain CodeCombat. Jika saya harus memberi CodeCombat peringkat dari 1 sampai 10, saya akan memberikannya 10!\""
parent: "Orang Tua"
student: "PI:NAME:<NAME>END_PI"
grade: "Tingkat"
subscribe_error_user_type: "Sepertinya Anda sudah mendaftar untuk sebuah akun. Jika Anda tertarik dengan CodeCombat Premium, silakan hubungi kami di PI:EMAIL:<EMAIL>END_PI."
subscribe_error_already_subscribed: "Anda sudah mendaftar untuk akun Premium."
start_free_trial_today: "Mulai uji coba gratis hari ini"
live_classes_title: "Kelas pengkodean langsung dari CodeCombat!"
live_class_booked_thank_you: "Kelas langsung Anda telah dipesan, terima kasih!"
book_your_class: "Pesan Kelas Anda"
call_to_book: "Telepon sekarang untuk memesan"
modal_timetap_confirmation:
congratulations: "Selamat!"
paragraph_1: "Petualangan coding siswa Anda menanti."
paragraph_2: "Kami telah memesan anak Anda untuk kelas online dan kami sangat senang bertemu dengan mereka!"
paragraph_3: "Sebentar lagi Anda akan menerima undangan email dengan detail jadwal kelas serta nama instruktur kelas dan informasi kontak Anda."
paragraph_4: "Jika karena alasan apa pun Anda perlu mengubah pilihan kelas, menjadwalkan ulang, atau hanya ingin berbicara dengan spesialis layanan pelanggan, cukup hubungi menggunakan informasi kontak yang disediakan dalam undangan email Anda."
paragraph_5: "Terima kasih telah memilih CodeCombat dan semoga sukses dalam perjalanan ilmu komputer Anda!"
back_to_coco: "Kembali ke CodeCombat"
hoc_2018:
banner: "Selamat Datang di Hour of Code!"
page_heading: "Siswa Anda akan belajar membuat kode dengan membuat game mereka sendiri!"
# page_heading_ai_league: "Your students will learn to code their own multiplayer AI!"
step_1: "Langkah 1: Tonton Video Ikhtisar"
step_2: "Langkah 2: Coba Sendiri"
step_3: "Langkah 3: Unduh Rencana Pelajaran"
try_activity: "Coba Aktivitas"
download_pdf: "Unduh PDF"
teacher_signup_heading: "Ubah Jam Kode menjadi Tahun Kode"
teacher_signup_blurb: "Semua yang Anda butuhkan untuk mengajarkan ilmu komputer, tidak perlu pengalaman sebelumnya."
teacher_signup_input_blurb: "Dapatkan kursus pertama gratis:"
teacher_signup_input_placeholder: "Alamat email guru"
teacher_signup_input_button: "Dapatkan CS1 Gratis"
activities_header: "Jam Lebih Banyak Aktivitas Kode"
activity_label_1: "Kabur dari Dungeon!"
activity_label_2: "Pemula: Buat Game!"
activity_label_3: "Lanjutan: Buat Game Arkade!"
# activity_label_hoc_2018: "Intermediate GD: Code, Play, Create"
# activity_label_ai_league: "Beginner CS: Road to the AI League"
activity_button_1: "Lihat Pelajaran"
about: "Tentang CodeCombat"
about_copy: "Program ilmu komputer berbasis permainan dan selaras dengan standar yang mengajarkan Python dan JavaScript yang nyata dan diketik."
point1: "✓ Kerangka Dibuat"
point2: "✓ Dibedakan"
point3: "✓ Penilaian"
point4: "✓ Kursus berbasis proyek"
point5: "✓ Pelacakan siswa"
point6: "✓ Rencana pelajaran lengkap"
title: "HOUR OF CODE"
acronym: "HOC"
hoc_2018_interstitial:
welcome: "Selamat datang di CodeCombat's Hour of Code!"
educator: "PI:NAME:<NAME>END_PIidPI:NAME:<NAME>END_PI"
show_resources: "Tunjukkan sumber daya guru!"
student: "PI:NAME:<NAME>END_PI"
ready_to_code: "Saya siap membuat kode!"
hoc_2018_completion:
congratulations: "Selamat, Anda telah menyelesaikan tantangan Code, Play, Share!"
send: "Kirim game Hour of Code Anda ke teman dan keluarga!"
copy: "Salin URL"
get_certificate: "Dapatkan sertifikat kelulusan untuk merayakan bersama kelas Anda!"
get_cert_btn: "Dapatkan Sertifikat"
first_name: "PI:NAME:<NAME>END_PI"
last_initial: "PI:NAME:<NAME>END_PI"
teacher_email: "Alamat email guru"
school_administrator:
title: "Dasbor Administrator Sekolah"
my_teachers: "Guru Saya"
last_login: "Login Terakhir"
licenses_used: "lisensi yang digunakan"
total_students: "total students"
active_students: "siswa aktif"
projects_created: "proyek dibuat"
other: "Lainnya"
notice: "Administrator sekolah berikut memiliki akses hanya lihat ke data kelas Anda:"
add_additional_teacher: "Perlu menambah pengajar tambahan? Hubungi Manajer Akun CodeCombat Anda atau kirim email ke PI:EMAIL:<EMAIL>END_PI."
license_stat_description: "Lisensi akun yang tersedia untuk jumlah lisensi yang tersedia untuk guru, termasuk Lisensi Bersama."
students_stat_description: "Total akun siswa untuk semua siswa di semua ruang kelas, terlepas dari apakah mereka memiliki lisensi yang diterapkan."
active_students_stat_description: "Siswa aktif menghitung jumlah siswa yang login ke CodeCombat dalam 60 hari terakhir."
project_stat_description: "Proyek yang dibuat menghitung jumlah total proyek pengembangan Game dan Web yang telah dibuat."
no_teachers: "Anda tidak mengadminkan guru."
totals_calculated: "Bagaimana cara menghitung total ini?"
totals_explanation_1: "Bagaimana cara menghitung total ini?"
totals_explanation_2: "Lisensi yang digunakan"
totals_explanation_3: "Menghitung total lisensi yang diterapkan ke siswa dari total lisensi yang tersedia."
totals_explanation_4: "Jumlah siswa"
totals_explanation_5: "Menghitung jumlah siswa guru di semua kelas aktif mereka. Untuk melihat total siswa yang terdaftar di kelas aktif dan yang diarsipkan, buka halaman Lisensi Siswa"
totals_explanation_6: "Siswa aktif"
totals_explanation_7: "Menghitung terakhir semua siswa yang aktif dalam 60 hari."
totals_explanation_8: "Proyek dibuat"
totals_explanation_9: "Menghitung total game dan halaman web yang dibuat."
date_thru_date: "__startDateRange__ thru __endDateRange__"
interactives:
phenomenal_job: "Pekerjaan Fenomenal!"
try_again: "Ups, coba lagi!"
select_statement_left: "Ups, pilih pernyataan dari kiri sebelum menekan \"Kirim.\""
fill_boxes: "Ups, pastikan untuk mengisi semua kotak sebelum menekan \"Kirim.\""
browser_recommendation:
title: "CodeCombat bekerja paling baik di Chrome!"
pitch_body: "Untuk pengalaman CodeCombat terbaik, sebaiknya gunakan Chrome versi terbaru. Unduh versi terbaru chrome dengan mengeklik tombol di bawah!"
download: "Unduh Chrome"
ignore: "Abaikan"
admin:
license_type_full: "Kursus Lengkap"
license_type_customize: "Sesuaikan Kursus"
# outcomes:
# outcomes_report: "Outcomes Report"
# customize_report: "Customize Report"
# done_customizing: "Done Customizing"
# start_date: "Start date"
# end_date: "End date"
# school_admin: "School Administrator"
# school_network: "School Network"
# school_subnetwork: "School Subnetwork"
# classroom: "Classroom"
# view_outcomes_report: "View Outcomes Report"
# key_concepts: "Key Concepts"
# code_languages: "Code Languages"
# using_codecombat: "Using CodeCombat's personalized learning engine..."
# wrote: "wrote..."
# across_an_estimated: "across an estimated..."
# in: "in..."
# include: "Include "
# archived: "Archived"
# max: "Max "
# multiple: "s"
# computer_program: "computer program"
# computer_programs: "computer programs"
# line_of_code: "line of code"
# lines_of_code: "lines of code"
# coding_hours: "coding hours"
# expressed_creativity: "and expressed creativity by building"
# report_content_1: "standalone game and web "
# project: "project"
# projects: "projects"
# progress_stats: "Progress stats based on sampling __sampleSize__ of __populationSize__ students."
# standards_coverage: "Standards Coverage"
# coverage_p1: "The full CodeCombat curriculum covers major programming standards in several widely-adopted frameworks, including those of the International Society for Technology in Education (ISTE), the Computer Science Teacher Association (CSTA), and the K-12 Computer Science Framework."
# coverage_p2: "At CodeCombat, we believe that students will be most prepared for both real-world computing jobs and further study of computer science by using real, typed code in full programming languages, so instead of using block-based visual programming languages for beginners, we teach Python and JavaScript – the same languages used widely today by companies ranging from Google to the New York Times."
# questions: "Have questions or want more information? We'd be happy to help."
# reach_out_manager: "Reach out to your Account Manager __name__ at "
# stats_include: "stats include __number__ other __name__"
league:
student_register_1: "Menjadi Juara AI berikutnya!"
student_register_2: "Daftar, buat tim Anda sendiri, atau gabung dengan tim lain untuk mulai berkompetisi."
student_register_3: "Berikan informasi di bawah ini agar memenuhi syarat untuk mendapatkan hadiah."
teacher_register_1: "Daftar untuk mengakses halaman profil liga kelas Anda dan mulai kelas Anda."
general_news: "Dapatkan email tentang berita terbaru dan pembaruan tentang Liga AI dan turnamen kami."
team: "tim"
how_it_works1: "Gabung dengan __team__"
seasonal_arena_tooltip: "Bertarung melawan rekan satu tim dan orang lain saat Anda menggunakan keterampilan pemrograman terbaik untuk mendapatkan poin dan peringkat papan peringkat Liga AI sebelum menghadapi arena Kejuaraan di akhir musim."
summary: "CodeCombat AI League secara unik merupakan simulator pertarungan AI yang kompetitif dan mesin game untuk mempelajari kode Python dan JavaScript yang sebenarnya."
join_now: "Gabung Sekarang"
tagline: "CodeCombat AI League menggabungkan kurikulum yang disesuaikan dengan standar berbasis proyek kami, game coding berbasis petualangan yang menarik, dan turnamen global pengkodean AI tahunan kami ke dalam kompetisi akademik terorganisir yang tidak seperti yang lain."
ladder_subheader: "Gunakan keahlian coding dan strategi pertempuran Anda untuk naik peringkat!"
earn_codepoints: "Dapatkan PoinKode dengan menyelesaikan level"
codepoints: "PoinKode"
free_1: "Akses arena multipemain kompetitif, papan peringkat, dan kejuaraan pengkodean global"
free_2: "Dapatkan poin dengan menyelesaikan level latihan dan berkompetisi dalam pertandingan head-to-head"
free_3: "Bergabunglah dengan tim coding kompetitif dengan teman, keluarga, atau teman sekelas"
free_4: "Tunjukkan keahlian coding Anda dan bawa pulang hadiah menarik"
compete_season: "Uji semua keterampilan yang telah Anda pelajari! Bersainglah melawan siswa dan pemain dari seluruh dunia dalam puncak musim yang menarik ini."
season_subheading1: "Untuk arena Season dan Championship, setiap pemain memprogram tim “AI Heroes” mereka dengan kode yang ditulis dalam Python, JavaScript, C ++, Lua, atau CoffeeScript."
season_subheading2: "Kode mereka menginformasikan strategi yang akan dijalankan Pahlawan AI mereka dalam pertarungan head-to-head melawan pesaing lain."
team_derbezt: "Pelajari coding dan menangkan hadiah yang disponsori oleh aktor superstar Meksiko, komedian, dan pembuat film PI:NAME:<NAME>END_PI."
invite_link: "Undang pemain ke tim ini dengan mengirimkan link ini:"
public_link: "Bagikan papan peringkat tim ini dengan tautan publiknya:"
end_to_end: "Tidak seperti platform esports lain yang melayani sekolah, kami memiliki struktur dari atas ke bawah, yang berarti kami tidak terikat dengan pengembang game mana pun atau memiliki masalah dengan perizinan. Itu juga berarti kami dapat membuat modifikasi khusus dalam game untuk sekolah Anda atau organisasi. "
path_success: "Platform game cocok dengan kurikulum Ilmu Komputer biasa, sehingga saat siswa bermain melalui level game, mereka menyelesaikan tugas kursus. Siswa belajar coding dan ilmu komputer sambil bermain, kemudian menggunakan keterampilan ini dalam pertempuran arena saat mereka berlatih dan bermain di platform yang sama. "
unlimited_potential: "Struktur turnamen kami dapat disesuaikan dengan lingkungan atau kasus penggunaan apa pun. Siswa dapat berpartisipasi pada waktu yang ditentukan selama pembelajaran reguler, bermain di rumah secara tidak sinkron, atau berpartisipasi sesuai jadwal mereka sendiri."
edit_team: "PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI"
start_team: "PI:NAME:<NAME>END_PI"
leave_team: "Keluar dari PI:NAME:<NAME>END_PI"
join_team: "PI:NAME:<NAME>END_PI"
# view_team: "View Team"
# join_team_name: "Join Team __name__"
features: "Fitur"
built_in: "Infrastruktur Kompetitif yang Terpasang"
built_in_subheader: "Platform kami menampung setiap elemen dari proses kompetitif, dari papan peringkat hingga platform game, aset, dan penghargaan turnamen."
custom_dev: "Pengembangan Kustom"
custom_dev_subheader: "Elemen kustomisasi untuk sekolah atau organisasi Anda telah disertakan, ditambah opsi seperti halaman arahan bermerek dan karakter dalam game."
comprehensive_curr: "Kurikulum Komprehensif"
comprehensive_curr_subheader: "CodeCombat adalah solusi Ilmu Komputer yang selaras dengan standar yang membantu pengajar mengajarkan pengkodean nyata dalam JavaScript dan Python, apa pun pengalaman mereka."
roster_management: "Alat Manajemen Daftar"
roster_management_subheader: "Lacak kinerja siswa dalam kurikulum dan dalam game, dan tambahkan atau hapus siswa dengan mudah."
share_flyer: "Bagikan selebaran Liga AI kami dengan pendidik, administrator, orang tua, pelatih esports, atau orang lain yang mungkin tertarik."
download_flyer: "Unduh Flyer"
championship_summary: "Arena kejuaraan __championshipArena__ sekarang dibuka! Bertarunglah di bulan __championshipMonth__ untuk memenangkan hadiah di __championshipArena__ __championshipType__."
play_arena_full: "Mainkan __arenaName__ __arenaType__"
play_arena_short: "Mainkan __arenaName__"
# view_arena_winners: "View __arenaName__ __arenaType__ winners"
arena_type_championship: "Arena Kejuaraan"
arena_type_regular: "Arena Multiplayer (Banyak Pemain)"
blazing_battle: "Pertempuran Berkobar"
infinite_inferno: "Api Tak Berujung"
mages_might: "Penyihir Perkasa"
sorcerers: "Penyihir"
giants_gate: "Gerbang Raksasa"
colossus: "Colossus"
# iron_and_ice: "Iron and Ice"
# tundra_tower: "Tundra Tower"
# magma_mountain: "Magma Mountain"
# lava_lake: "Lava Lake"
# desert_duel: "Desert Duel"
# sandstorm: "Sandstorm"
cup: "Piala"
blitz: "Menggempur"
clash: "Bentrokan"
# season3_announcement_1: "Time to put your coding skills to the test in our season 3 final arena. The Colossus Clash is live and offers a new challenge and a new leaderboard to climb."
# season3_announcement_2: "Need more practice? Stick with the Giant's Gate Arena to refine your skills. You have until December 14th to play both arenas. Note: arena balance adjustments may occur until December 6th."
# season3_announcement_3: "Great prizes available for top performers in the Colossus Clash:"
# season2_announcement_1: "Time to put your coding skills to the test in our season 2 final arena. The Sorcerers Blitz is live and offers a new challenge and a new leaderboard to climb."
# season2_announcement_2: "Need more practice? Stick with the Mage's Might Arena to refine your skills. You have until August 31st to play both arenas. Note: arena balance adjustments may occur until August 23rd."
# season2_announcement_3: "Great prizes available for top performers in the Sorcerers Blitz:"
season1_prize_1: "Beasiswa $1,000"
season1_prize_2: "RESPAWN Kursi Permainan" # {change}
season1_prize_3: "Avatar CodeCombat Khusus"
season1_prize_4: "Dan banyak lagi!"
# season1_prize_hyperx: "HyperX Premium Peripherals"
# codecombat_ai_league: "CodeCombat AI League"
# register: "Register"
# not_registered: "Not Registered"
# register_for_ai_league: "Register for AI League"
# world: "World"
# quickstart_video: "Quickstart Video"
# arena_rankings: "Arena Rankings"
# arena_rankings_blurb: "Global AI League arena rankings"
# arena_rankings_title: "Global leaderboard rank for all players in this team across AI League arenas in the open age bracket."
# competing: "Competing:" # Competing: 3 students
# count_student: "student" # 1 student
# count_students: "students" # 2 students
# top_student: "Top:" # Top: PI:NAME:<NAME>END_PI
# top_percent: "top" # - top 3%)
# top_of: "of" # (#8 of 35). Perhaps just use "/" if this doesn't translate naturally.
# arena_victories: "Arena Victories"
# arena_victories_blurb: "Global AI League arena recent wins"
# arena_victories_title: "Win count is based on the last 1000 matches played asynchronously by each player in each of their AI League arenas."
# count_wins: "wins" # 100+ wins or 974 wins
# codepoints_blurb: "1 CodePoint = 1 line of code written"
# codepoints_title: "One CodePoint is earned for every non-whitespace line of code needed to beat the level. Each level is worth the same amount of CodePoints according to its standard solution, regardless of whether the student wrote more or fewer lines of code."
# count_total: "Total:" # Total: 300 CodePoints, or Total: 300 wins
# join_teams_header: "Join Teams & Get Cool Stuff!"
# join_team_hyperx_title: "Join Team HyperX, Get 10% Off"
# join_team_hyperx_blurb: "30 team members will be chosen at random for a free gaming mousepad!"
# join_team_derbezt_title: "Join Team DerBezt, Get Exclusive Hero"
# join_team_derbezt_blurb: "Unlock the Armando Hoyos hero from Mexican superstar Eugenio Derbez!"
# join_team_ned_title: "Join Team Ned, Unlock Ned's Hero"
# join_team_ned_blurb: "Get the exclusive spatula-wielding hero from YouTube star, Try Guy Ned Fulmer!"
tournament:
mini_tournaments: "Turname Mini"
usable_ladders: "Semua Tangga yang Dapat Digunakan"
make_tournament: "Buat turnamen mini"
go_tournaments: "Pergi ke turnamen mini"
class_tournaments: "Kelas turnamen mini"
no_tournaments_owner: "Tidak ada turnamen sekarang, buatlah turnamen"
no_tournaments: "Tidak ada turnamen sekarang"
edit_tournament: "Edit Turnamen"
create_tournament: "Buat Turnamen"
# upcoming: "Upcoming"
# starting: "Starting"
# ended: "Ended"
# view_results: "View Results"
# estimate_days: "In __time__ Days"
# payments:
# student_licenses: "Student Licenses"
# computer_science: "Computer Science"
# web_development: "Web Development"
# game_development: "Game Development"
# per_student: "Per Student"
# just: "Just"
# teachers_upto: "Teacher can purchase upto"
# great_courses: "Great Courses included for"
# studentLicense_successful: "Congratulations! Your licenses will be ready to use in a min. Click on the Getting Started Guide in the Resource Hub to learn how to apply them to your students."
# onlineClasses_successful: "Congratulations! Your payment was successful. Our team will reach out to you with the next steps."
# homeSubscriptions_successful: "Congratulations! Your payment was successful. Your premium access will be available in few minutes."
# failed: "Your payment failed, please try again"
# session_week_1: "1 session/week"
# session_week_2: "2 sessions/week"
# month_1: "Monthly"
# month_3: "Quarterly"
# month_6: "Half-yearly"
# year_1: "Yearly"
# most_popular: "Most Popular"
# best_value: "Best Value"
# purchase_licenses: "Purchase Licenses easily to get full access to CodeCombat and Ozaria"
# homeschooling: "Homeschooling Licenses"
# recurring_month_1: "Recurring billing every month"
# recurring_month_3: "Recurring billing every 3 months"
# recurring_month_6: "Recurring billing every 6 months"
# recurring_year_1: "Recurring billing every year"
# form_validation_errors:
# required: "Field is required"
# invalidEmail: "Invalid email"
# invalidPhone: "Invalid phone number"
# emailExists: "Email already exists"
# numberGreaterThanZero: "Should be a number greater than 0"
# teacher_dashboard:
# read: "View Only"
# write: "Full Access"
# read_blurb: "View Only permits the added teacher to view your class and student progress without the ability to make changes to your class."
# write_blurb: "Full Access grants the added teacher the ability to make modifications to your class (add/remove students, assign chapters, modify licensure)"
# shared_with_none: "This class is not currently shared with any other teachers."
# share_info: "To give other teachers access to the class, add their emails below."
# class_owner: "Class Owner"
# share: "Share"
|
[
{
"context": "sert.deepEqual user, id: 123, email: 'baz', key: 'bix'\n done()\n\n describe 'getUser()', ->\n ",
"end": 450,
"score": 0.9670791625976562,
"start": 447,
"tag": "KEY",
"value": "bix"
},
{
"context": "sert.deepEqual user, id: 123, email: 'baz', key: 'bix'\n done()\n\n it 'should get non existing ",
"end": 737,
"score": 0.7813096046447754,
"start": 734,
"tag": "KEY",
"value": "bix"
}
] | test/unit/user-spec.coffee | Starefossen/slackly | 1 | assert = require 'assert'
redis = require '../../src/db/redis'
user = require '../../src/lib/user'
beforeEach (done) ->
redis.flushall done
describe 'User', ->
describe 'setUser()', ->
it 'should set new user', (done) ->
user.set 'foo', 123, 'baz', 'bix', (e) ->
assert.ifError e
redis.hgetall 'user:foo', (e, user) ->
assert.ifError e
assert.deepEqual user, id: 123, email: 'baz', key: 'bix'
done()
describe 'getUser()', ->
beforeEach (done) ->
user.set 'foo', 123, 'baz', 'bix', done
it 'should get existing user', (done) ->
user.get 'foo', (e, user) ->
assert.ifError e
assert.deepEqual user, id: 123, email: 'baz', key: 'bix'
done()
it 'should get non existing user', (done) ->
user.get 'bar', (e, user) ->
assert.ifError e
assert.equal user, null
done()
it 'should get empty user', (done) ->
user.get undefined, (e, user) ->
assert.ifError e
assert.equal user, null
done()
| 121069 | assert = require 'assert'
redis = require '../../src/db/redis'
user = require '../../src/lib/user'
beforeEach (done) ->
redis.flushall done
describe 'User', ->
describe 'setUser()', ->
it 'should set new user', (done) ->
user.set 'foo', 123, 'baz', 'bix', (e) ->
assert.ifError e
redis.hgetall 'user:foo', (e, user) ->
assert.ifError e
assert.deepEqual user, id: 123, email: 'baz', key: '<KEY>'
done()
describe 'getUser()', ->
beforeEach (done) ->
user.set 'foo', 123, 'baz', 'bix', done
it 'should get existing user', (done) ->
user.get 'foo', (e, user) ->
assert.ifError e
assert.deepEqual user, id: 123, email: 'baz', key: '<KEY>'
done()
it 'should get non existing user', (done) ->
user.get 'bar', (e, user) ->
assert.ifError e
assert.equal user, null
done()
it 'should get empty user', (done) ->
user.get undefined, (e, user) ->
assert.ifError e
assert.equal user, null
done()
| true | assert = require 'assert'
redis = require '../../src/db/redis'
user = require '../../src/lib/user'
beforeEach (done) ->
redis.flushall done
describe 'User', ->
describe 'setUser()', ->
it 'should set new user', (done) ->
user.set 'foo', 123, 'baz', 'bix', (e) ->
assert.ifError e
redis.hgetall 'user:foo', (e, user) ->
assert.ifError e
assert.deepEqual user, id: 123, email: 'baz', key: 'PI:KEY:<KEY>END_PI'
done()
describe 'getUser()', ->
beforeEach (done) ->
user.set 'foo', 123, 'baz', 'bix', done
it 'should get existing user', (done) ->
user.get 'foo', (e, user) ->
assert.ifError e
assert.deepEqual user, id: 123, email: 'baz', key: 'PI:KEY:<KEY>END_PI'
done()
it 'should get non existing user', (done) ->
user.get 'bar', (e, user) ->
assert.ifError e
assert.equal user, null
done()
it 'should get empty user', (done) ->
user.get undefined, (e, user) ->
assert.ifError e
assert.equal user, null
done()
|
[
{
"context": "rrals/r1a2n3d4m5s6t7\",\n \"display_name\": \"John P. User\",\n \"uid\": 12345678,\n \"country\":",
"end": 256,
"score": 0.9997934699058533,
"start": 244,
"tag": "NAME",
"value": "John P. User"
},
{
"context": "l\": 680031877871\n },\n \"email\": \"johnpuser@company.com\" # Added to reflect real responses.\n }\n ",
"end": 502,
"score": 0.9999239444732666,
"start": 481,
"tag": "EMAIL",
"value": "johnpuser@company.com"
},
{
"context": "name'\n expect(@accountInfo.name).to.equal 'John P. User'\n\n it 'parses email correctly', ->\n e",
"end": 755,
"score": 0.9996707439422607,
"start": 743,
"tag": "NAME",
"value": "John P. User"
},
{
"context": "ail'\n expect(@accountInfo.email).to.equal 'johnpuser@company.com'\n\n it 'parses countryCode correctly', ->\n ",
"end": 916,
"score": 0.9999225735664368,
"start": 895,
"tag": "EMAIL",
"value": "johnpuser@company.com"
},
{
"context": "ferrals/NTM1OTg4MTA5\",\n \"display_name\": \"Victor Costan\",\n \"uid\": 87654321, # Anonymized.\n ",
"end": 2801,
"score": 0.9997118711471558,
"start": 2788,
"tag": "NAME",
"value": "Victor Costan"
},
{
"context": "mal\": 4684642723\n },\n \"email\": \"spam@gmail.com\" # Anonymized.\n }\n @accountInfo = ",
"end": 3126,
"score": 0.9999232292175293,
"start": 3112,
"tag": "EMAIL",
"value": "spam@gmail.com"
}
] | test/src/fast/account_info_test.coffee | expo/dropbox-js | 64 | describe 'Dropbox.AccountInfo', ->
describe '.parse', ->
describe 'on the API example', ->
beforeEach ->
userData = {
"referral_link": "https://www.dropbox.com/referrals/r1a2n3d4m5s6t7",
"display_name": "John P. User",
"uid": 12345678,
"country": "US",
"quota_info": {
"shared": 253738410565,
"quota": 107374182400000,
"normal": 680031877871
},
"email": "johnpuser@company.com" # Added to reflect real responses.
}
@accountInfo = Dropbox.AccountInfo.parse userData
it 'parses name correctly', ->
expect(@accountInfo).to.have.property 'name'
expect(@accountInfo.name).to.equal 'John P. User'
it 'parses email correctly', ->
expect(@accountInfo).to.have.property 'email'
expect(@accountInfo.email).to.equal 'johnpuser@company.com'
it 'parses countryCode correctly', ->
expect(@accountInfo).to.have.property 'countryCode'
expect(@accountInfo.countryCode).to.equal 'US'
it 'parses uid correctly', ->
expect(@accountInfo).to.have.property 'uid'
expect(@accountInfo.uid).to.equal '12345678'
it 'parses referralUrl correctly', ->
expect(@accountInfo).to.have.property 'referralUrl'
expect(@accountInfo.referralUrl).to.
equal 'https://www.dropbox.com/referrals/r1a2n3d4m5s6t7'
it 'parses quota correctly', ->
expect(@accountInfo).to.have.property 'quota'
expect(@accountInfo.quota).to.equal 107374182400000
it 'parses usedQuota correctly', ->
expect(@accountInfo).to.have.property 'usedQuota'
expect(@accountInfo.usedQuota).to.equal 933770288436
it 'parses privateBytes correctly', ->
expect(@accountInfo).to.have.property 'privateBytes'
expect(@accountInfo.privateBytes).to.equal 680031877871
it 'parses sharedBytes correctly', ->
expect(@accountInfo).to.have.property 'usedQuota'
expect(@accountInfo.sharedBytes).to.equal 253738410565
it 'parses publicAppUrl correctly', ->
expect(@accountInfo.publicAppUrl).to.equal null
it 'round-trips through json / parse correctly', ->
newInfo = Dropbox.AccountInfo.parse @accountInfo.json()
expect(newInfo).to.deep.equal @accountInfo
it 'passes null through', ->
expect(Dropbox.AccountInfo.parse(null)).to.equal null
it 'passes undefined through', ->
expect(Dropbox.AccountInfo.parse(undefined)).to.equal undefined
describe 'on real data from a "public app folder" application', ->
beforeEach ->
userData = {
"referral_link": "https://www.dropbox.com/referrals/NTM1OTg4MTA5",
"display_name": "Victor Costan",
"uid": 87654321, # Anonymized.
"public_app_url": "https://dl-web.dropbox.com/spa/90vw6zlu4268jh4/",
"country": "US",
"quota_info": {
"shared": 6074393565,
"quota": 73201090560,
"normal": 4684642723
},
"email": "spam@gmail.com" # Anonymized.
}
@accountInfo = Dropbox.AccountInfo.parse userData
it 'parses publicAppUrl correctly', ->
expect(@accountInfo.publicAppUrl).to.
equal 'https://dl-web.dropbox.com/spa/90vw6zlu4268jh4'
it 'round-trips through json / parse correctly', ->
newInfo = Dropbox.AccountInfo.parse @accountInfo.json()
expect(newInfo).to.deep.equal @accountInfo
| 203642 | describe 'Dropbox.AccountInfo', ->
describe '.parse', ->
describe 'on the API example', ->
beforeEach ->
userData = {
"referral_link": "https://www.dropbox.com/referrals/r1a2n3d4m5s6t7",
"display_name": "<NAME>",
"uid": 12345678,
"country": "US",
"quota_info": {
"shared": 253738410565,
"quota": 107374182400000,
"normal": 680031877871
},
"email": "<EMAIL>" # Added to reflect real responses.
}
@accountInfo = Dropbox.AccountInfo.parse userData
it 'parses name correctly', ->
expect(@accountInfo).to.have.property 'name'
expect(@accountInfo.name).to.equal '<NAME>'
it 'parses email correctly', ->
expect(@accountInfo).to.have.property 'email'
expect(@accountInfo.email).to.equal '<EMAIL>'
it 'parses countryCode correctly', ->
expect(@accountInfo).to.have.property 'countryCode'
expect(@accountInfo.countryCode).to.equal 'US'
it 'parses uid correctly', ->
expect(@accountInfo).to.have.property 'uid'
expect(@accountInfo.uid).to.equal '12345678'
it 'parses referralUrl correctly', ->
expect(@accountInfo).to.have.property 'referralUrl'
expect(@accountInfo.referralUrl).to.
equal 'https://www.dropbox.com/referrals/r1a2n3d4m5s6t7'
it 'parses quota correctly', ->
expect(@accountInfo).to.have.property 'quota'
expect(@accountInfo.quota).to.equal 107374182400000
it 'parses usedQuota correctly', ->
expect(@accountInfo).to.have.property 'usedQuota'
expect(@accountInfo.usedQuota).to.equal 933770288436
it 'parses privateBytes correctly', ->
expect(@accountInfo).to.have.property 'privateBytes'
expect(@accountInfo.privateBytes).to.equal 680031877871
it 'parses sharedBytes correctly', ->
expect(@accountInfo).to.have.property 'usedQuota'
expect(@accountInfo.sharedBytes).to.equal 253738410565
it 'parses publicAppUrl correctly', ->
expect(@accountInfo.publicAppUrl).to.equal null
it 'round-trips through json / parse correctly', ->
newInfo = Dropbox.AccountInfo.parse @accountInfo.json()
expect(newInfo).to.deep.equal @accountInfo
it 'passes null through', ->
expect(Dropbox.AccountInfo.parse(null)).to.equal null
it 'passes undefined through', ->
expect(Dropbox.AccountInfo.parse(undefined)).to.equal undefined
describe 'on real data from a "public app folder" application', ->
beforeEach ->
userData = {
"referral_link": "https://www.dropbox.com/referrals/NTM1OTg4MTA5",
"display_name": "<NAME>",
"uid": 87654321, # Anonymized.
"public_app_url": "https://dl-web.dropbox.com/spa/90vw6zlu4268jh4/",
"country": "US",
"quota_info": {
"shared": 6074393565,
"quota": 73201090560,
"normal": 4684642723
},
"email": "<EMAIL>" # Anonymized.
}
@accountInfo = Dropbox.AccountInfo.parse userData
it 'parses publicAppUrl correctly', ->
expect(@accountInfo.publicAppUrl).to.
equal 'https://dl-web.dropbox.com/spa/90vw6zlu4268jh4'
it 'round-trips through json / parse correctly', ->
newInfo = Dropbox.AccountInfo.parse @accountInfo.json()
expect(newInfo).to.deep.equal @accountInfo
| true | describe 'Dropbox.AccountInfo', ->
describe '.parse', ->
describe 'on the API example', ->
beforeEach ->
userData = {
"referral_link": "https://www.dropbox.com/referrals/r1a2n3d4m5s6t7",
"display_name": "PI:NAME:<NAME>END_PI",
"uid": 12345678,
"country": "US",
"quota_info": {
"shared": 253738410565,
"quota": 107374182400000,
"normal": 680031877871
},
"email": "PI:EMAIL:<EMAIL>END_PI" # Added to reflect real responses.
}
@accountInfo = Dropbox.AccountInfo.parse userData
it 'parses name correctly', ->
expect(@accountInfo).to.have.property 'name'
expect(@accountInfo.name).to.equal 'PI:NAME:<NAME>END_PI'
it 'parses email correctly', ->
expect(@accountInfo).to.have.property 'email'
expect(@accountInfo.email).to.equal 'PI:EMAIL:<EMAIL>END_PI'
it 'parses countryCode correctly', ->
expect(@accountInfo).to.have.property 'countryCode'
expect(@accountInfo.countryCode).to.equal 'US'
it 'parses uid correctly', ->
expect(@accountInfo).to.have.property 'uid'
expect(@accountInfo.uid).to.equal '12345678'
it 'parses referralUrl correctly', ->
expect(@accountInfo).to.have.property 'referralUrl'
expect(@accountInfo.referralUrl).to.
equal 'https://www.dropbox.com/referrals/r1a2n3d4m5s6t7'
it 'parses quota correctly', ->
expect(@accountInfo).to.have.property 'quota'
expect(@accountInfo.quota).to.equal 107374182400000
it 'parses usedQuota correctly', ->
expect(@accountInfo).to.have.property 'usedQuota'
expect(@accountInfo.usedQuota).to.equal 933770288436
it 'parses privateBytes correctly', ->
expect(@accountInfo).to.have.property 'privateBytes'
expect(@accountInfo.privateBytes).to.equal 680031877871
it 'parses sharedBytes correctly', ->
expect(@accountInfo).to.have.property 'usedQuota'
expect(@accountInfo.sharedBytes).to.equal 253738410565
it 'parses publicAppUrl correctly', ->
expect(@accountInfo.publicAppUrl).to.equal null
it 'round-trips through json / parse correctly', ->
newInfo = Dropbox.AccountInfo.parse @accountInfo.json()
expect(newInfo).to.deep.equal @accountInfo
it 'passes null through', ->
expect(Dropbox.AccountInfo.parse(null)).to.equal null
it 'passes undefined through', ->
expect(Dropbox.AccountInfo.parse(undefined)).to.equal undefined
describe 'on real data from a "public app folder" application', ->
beforeEach ->
userData = {
"referral_link": "https://www.dropbox.com/referrals/NTM1OTg4MTA5",
"display_name": "PI:NAME:<NAME>END_PI",
"uid": 87654321, # Anonymized.
"public_app_url": "https://dl-web.dropbox.com/spa/90vw6zlu4268jh4/",
"country": "US",
"quota_info": {
"shared": 6074393565,
"quota": 73201090560,
"normal": 4684642723
},
"email": "PI:EMAIL:<EMAIL>END_PI" # Anonymized.
}
@accountInfo = Dropbox.AccountInfo.parse userData
it 'parses publicAppUrl correctly', ->
expect(@accountInfo.publicAppUrl).to.
equal 'https://dl-web.dropbox.com/spa/90vw6zlu4268jh4'
it 'round-trips through json / parse correctly', ->
newInfo = Dropbox.AccountInfo.parse @accountInfo.json()
expect(newInfo).to.deep.equal @accountInfo
|
[
{
"context": "options: admin_username: 'root', admin_password: 'secret', ssl: enabled: false\n nodes: 'node1': ip:",
"end": 1507,
"score": 0.9994995594024658,
"start": 1501,
"tag": "PASSWORD",
"value": "secret"
},
{
"context": "ssl: enabled: false\n nodes: 'node1': ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster",
"end": 1561,
"score": 0.6201131343841553,
"start": 1560,
"tag": "IP_ADDRESS",
"value": "1"
},
{
"context": " enabled: false\n nodes: 'node1': ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster_te",
"end": 1564,
"score": 0.6981721520423889,
"start": 1564,
"tag": "IP_ADDRESS",
"value": ""
},
{
"context": "abled: false\n nodes: 'node1': ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster_test'",
"end": 1567,
"score": 0.7111341953277588,
"start": 1567,
"tag": "IP_ADDRESS",
"value": ""
},
{
"context": "r: 'cluster_test'\n nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,\"./../../",
"end": 1657,
"score": 0.9997180700302124,
"start": 1651,
"tag": "USERNAME",
"value": "nikita"
},
{
"context": " isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username\n ",
"end": 2468,
"score": 0.9830756783485413,
"start": 2464,
"tag": "USERNAME",
"value": "root"
},
{
"context": "options: admin_username: 'root', admin_password: 'secret', ssl: (enabled: false), repl_master: (admin_pass",
"end": 4386,
"score": 0.9995790123939514,
"start": 4380,
"tag": "PASSWORD",
"value": "secret"
},
{
"context": " (enabled: false), repl_master: (admin_password: 'secret', password: 'secret')\n nodes: 'node1': (ip",
"end": 4449,
"score": 0.9995405673980713,
"start": 4443,
"tag": "PASSWORD",
"value": "secret"
},
{
"context": "epl_master: (admin_password: 'secret', password: 'secret')\n nodes: 'node1': (ip: '11.10.10.11', tag",
"end": 4469,
"score": 0.9995707273483276,
"start": 4463,
"tag": "PASSWORD",
"value": "secret"
},
{
"context": ": 'cluster_test')\n nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,\"./../../",
"end": 4678,
"score": 0.9996398687362671,
"start": 4672,
"tag": "USERNAME",
"value": "nikita"
},
{
"context": " isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username\n ",
"end": 5489,
"score": 0.9974066615104675,
"start": 5485,
"tag": "USERNAME",
"value": "root"
},
{
"context": " options:\n admin_username: 'root'\n admin_password: 'secret'\n ",
"end": 10162,
"score": 0.9699381589889526,
"start": 10158,
"tag": "USERNAME",
"value": "root"
},
{
"context": "n_username: 'root'\n admin_password: 'secret'\n ssl:\n enabled: true",
"end": 10201,
"score": 0.9994863271713257,
"start": 10195,
"tag": "PASSWORD",
"value": "secret"
},
{
"context": "r: 'cluster_test'\n nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,'/../../e",
"end": 10546,
"score": 0.9996508359909058,
"start": 10540,
"tag": "USERNAME",
"value": "nikita"
},
{
"context": " isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username\n ",
"end": 11356,
"score": 0.9949081540107727,
"start": 11352,
"tag": "USERNAME",
"value": "root"
},
{
"context": "es: 'node2'\n options: admin_username: 'root', admin_password: 'secret'\n nodes: 'node2'",
"end": 11795,
"score": 0.9885832071304321,
"start": 11791,
"tag": "USERNAME",
"value": "root"
},
{
"context": "options: admin_username: 'root', admin_password: 'secret'\n nodes: 'node2': ip: '11.10.10.12', tags:",
"end": 11821,
"score": 0.9995198249816895,
"start": 11815,
"tag": "PASSWORD",
"value": "secret"
},
{
"context": "r: 'cluster_test'\n nikita: ssh: username: 'nikita', private_key_path: path.join(__dirname,\"./../../",
"end": 11950,
"score": 0.9996568560600281,
"start": 11944,
"tag": "USERNAME",
"value": "nikita"
},
{
"context": " isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username\n ",
"end": 12762,
"score": 0.993848979473114,
"start": 12758,
"tag": "USERNAME",
"value": "root"
}
] | packages/mariadb/test/server/functional_tests.coffee | ryba-io/ryba | 24 | path = require 'path'
nikita = require 'nikita'
build_env_script = path.join(__dirname, './../../env/build_env.coffee')
generate_script_path = path.join(__dirname, './../server/cert/generate')
each = require 'each'
store = require 'masson/lib/config/store'
multimatch = require 'masson/lib/utils/multimatch'
{merge} = require 'mixme'
array_get = require 'masson/lib/utils/array_get'
normalize = require 'masson/lib/config/normalize'
describe 'MariaDB installation - Functionnal tests (may take 10+ minutes)', ->
@timeout 1500000 # Extended timeout for these lengthy test
it 'default conf tests', () ->
await nikita
.call ->
this
.system.execute
header: 'Test Environment Creation'
cmd: "coffee #{build_env_script}"
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node1 running'
cmd: '[[ `lxc ls | grep "node1 | RUNNING"` ]] && echo "node1 running" || echo "node1 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node1 running\n' unless err
.system.execute
header: 'Verify node1 IP'
cmd: 'ping -c 1 11.10.10.11'
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/server':
affinity: type: 'nodes', match: 'any', values: 'node1'
options: admin_username: 'root', admin_password: 'secret', ssl: enabled: false
nodes: 'node1': ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster_test'
nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,"./../../env/assets/id_rsa"
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
this
.system.execute
header: 'Check'
cmd: """
lxc exec node1 -- bash -c 'mysql --password=secret -e "SHOW DATABASES;"'
"""
, (err, {stdout}) ->
stdout.should.eql 'Database\ninformation_schema\nmysql\nperformance_schema\n' unless err
.promise()
.promise()
it 'Replication conf tests', () ->
await nikita
.call ->
this
.system.execute
header: 'Test Environment Creation'
cmd: "coffee #{build_env_script}"
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node1 running'
cmd: '[[ `lxc ls | grep "node1 | RUNNING"` ]] && echo "node1 running" || echo "node1 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node1 running\n' unless err
.system.execute
header: 'Verify node2 running'
cmd: '[[ `lxc ls | grep "node2 | RUNNING"` ]] && echo "node2 running" || echo "node2 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node2 running\n' unless err
.system.execute
header: 'Verify node1 IP'
cmd: 'ping -c 1 11.10.10.11'
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node2 IP'
cmd: 'ping -c 1 11.10.10.12'
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/server':
affinity: type: 'nodes', match: 'any', values: ['node1', 'node2']
options: admin_username: 'root', admin_password: 'secret', ssl: (enabled: false), repl_master: (admin_password: 'secret', password: 'secret')
nodes: 'node1': (ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster_test'), 'node2': (ip: '11.10.10.12', tags: 'type': 'node', cluster: 'cluster_test')
nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,"./../../env/assets/id_rsa"
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
this
.system.execute
header: 'Check'
cmd: """
lxc exec node1 -- bash -c 'mysql --password=secret -e "CREATE DATABASE MyData"'
lxc exec node2 -- bash -c 'mysql --password=secret -e "SHOW DATABASES;"'
"""
, (err, {stdout}) ->
stdout.should.eql 'Database\ninformation_schema\nMyData\nmysql\nperformance_schema\n' unless err
.promise()
.promise()
it 'ssl conf tests', () ->
await nikita
.call ->
this
.system.execute
header: 'Test Environment Creation'
cmd: "coffee #{build_env_script}"
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node1 running'
cmd: '[[ `lxc ls | grep "node1 | RUNNING"` ]] && echo "node1 running" || echo "node1 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node1 running\n' unless err
.system.execute
header: 'Verify node2 running'
cmd: '[[ `lxc ls | grep "node2 | RUNNING"` ]] && echo "node2 running" || echo "node2 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node2 running\n' unless err
.system.execute
header: 'Verify node1 IP'
cmd: 'ping -c 1 11.10.10.11'
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node2 IP'
cmd: 'ping -c 1 11.10.10.12'
, (err, {status}) ->
status.should.be.true() unless err
# Generate all the necessary files
.system.execute
header: 'Create Certificates'
cmd: """
sh #{generate_script_path} cacert
sh #{generate_script_path} cert server
sh #{generate_script_path} cert client
"""
, (err, {status}) ->
status.should.be.true() unless err
.file.assert
header: 'server.cert created'
source: path.join(__dirname,"./cert/server.cert.pem")
.file.assert
header: 'client.cert created'
source: path.join(__dirname,"/cert/client.cert.pem")
# Sevrer SSL files
.lxd.file.push
header: 'Copy server cert'
container: "node1"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/server.cert.pem")
target: '/etc/ssl/server.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy server key'
container: "node1"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/server.key.pem")
target: '/etc/ssl/server.key.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy server ca-cert'
container: "node1"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/ca.cert.pem")
target: '/etc/ssl/ca.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
# Client SSL files
.lxd.file.push
header: 'Copy client cert'
container: "node2"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"/cert/client.cert.pem")
target: '/etc/ssl/client.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy client key'
container: "node2"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/client.key.pem")
target: '/etc/ssl/client.key.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy client ca-cert'
container: "node2"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/ca.cert.pem")
target: '/etc/ssl/ca.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Local cert deletion'
cmd: """
cd ./test/server/cert
rm -rf ca.cert.pem ca.key.pem ca.seq client.cert.pem client.key.pem server.cert.pem server.key.pem
"""
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/server':
affinity: type: 'nodes', match: 'any', values: 'node1'
options:
admin_username: 'root'
admin_password: 'secret'
ssl:
enabled: true
cacert: source: '/etc/ssl/ca.cert.pem'
cert: source: '/etc/ssl/server.cert.pem'
key: source: '/etc/ssl/server.key.pem'
nodes: 'node1': ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster_test'
nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,'/../../env/assets/id_rsa'
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/client':
affinity: type: 'nodes', match: 'any', values: 'node2'
options: admin_username: 'root', admin_password: 'secret'
nodes: 'node2': ip: '11.10.10.12', tags: 'type': 'node', cluster: 'cluster_test'
nikita: ssh: username: 'nikita', private_key_path: path.join(__dirname,"./../../env/assets/id_rsa")
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
this
.system.execute
header: 'Give privileges'
cmd: """
lxc exec node2 -- bash -c 'echo "ssl-ca=/etc/ssl/ca.cert.pem">>/etc/my.cnf.d/client.cnf'
lxc exec node2 -- bash -c 'echo "ssl-cert=/etc/ssl/client.cert.pem">>/etc/my.cnf.d/client.cnf'
lxc exec node2 -- bash -c 'echo "ssl-key=/etc/ssl/client.key.pem">>/etc/my.cnf.d/client.cnf'
"""
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Check SSL'
cmd: """
lxc exec node2 -- bash -c 'mysql --password=secret -h node1 -e "STATUS"'
"""
, (err, {stdout}) ->
stdout.should.containEql 'Cipher in use' unless err
.system.execute
header: 'SSH keys deletion'
cmd: """
cd ./env/assets
rm -rf id_rsa id_rsa.pub
cd ./../../log
rm -rf node1.log node2.log
"""
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.promise()
| 193049 | path = require 'path'
nikita = require 'nikita'
build_env_script = path.join(__dirname, './../../env/build_env.coffee')
generate_script_path = path.join(__dirname, './../server/cert/generate')
each = require 'each'
store = require 'masson/lib/config/store'
multimatch = require 'masson/lib/utils/multimatch'
{merge} = require 'mixme'
array_get = require 'masson/lib/utils/array_get'
normalize = require 'masson/lib/config/normalize'
describe 'MariaDB installation - Functionnal tests (may take 10+ minutes)', ->
@timeout 1500000 # Extended timeout for these lengthy test
it 'default conf tests', () ->
await nikita
.call ->
this
.system.execute
header: 'Test Environment Creation'
cmd: "coffee #{build_env_script}"
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node1 running'
cmd: '[[ `lxc ls | grep "node1 | RUNNING"` ]] && echo "node1 running" || echo "node1 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node1 running\n' unless err
.system.execute
header: 'Verify node1 IP'
cmd: 'ping -c 1 11.10.10.11'
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/server':
affinity: type: 'nodes', match: 'any', values: 'node1'
options: admin_username: 'root', admin_password: '<PASSWORD>', ssl: enabled: false
nodes: 'node1': ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster_test'
nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,"./../../env/assets/id_rsa"
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
this
.system.execute
header: 'Check'
cmd: """
lxc exec node1 -- bash -c 'mysql --password=secret -e "SHOW DATABASES;"'
"""
, (err, {stdout}) ->
stdout.should.eql 'Database\ninformation_schema\nmysql\nperformance_schema\n' unless err
.promise()
.promise()
it 'Replication conf tests', () ->
await nikita
.call ->
this
.system.execute
header: 'Test Environment Creation'
cmd: "coffee #{build_env_script}"
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node1 running'
cmd: '[[ `lxc ls | grep "node1 | RUNNING"` ]] && echo "node1 running" || echo "node1 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node1 running\n' unless err
.system.execute
header: 'Verify node2 running'
cmd: '[[ `lxc ls | grep "node2 | RUNNING"` ]] && echo "node2 running" || echo "node2 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node2 running\n' unless err
.system.execute
header: 'Verify node1 IP'
cmd: 'ping -c 1 11.10.10.11'
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node2 IP'
cmd: 'ping -c 1 11.10.10.12'
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/server':
affinity: type: 'nodes', match: 'any', values: ['node1', 'node2']
options: admin_username: 'root', admin_password: '<PASSWORD>', ssl: (enabled: false), repl_master: (admin_password: '<PASSWORD>', password: '<PASSWORD>')
nodes: 'node1': (ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster_test'), 'node2': (ip: '11.10.10.12', tags: 'type': 'node', cluster: 'cluster_test')
nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,"./../../env/assets/id_rsa"
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
this
.system.execute
header: 'Check'
cmd: """
lxc exec node1 -- bash -c 'mysql --password=secret -e "CREATE DATABASE MyData"'
lxc exec node2 -- bash -c 'mysql --password=secret -e "SHOW DATABASES;"'
"""
, (err, {stdout}) ->
stdout.should.eql 'Database\ninformation_schema\nMyData\nmysql\nperformance_schema\n' unless err
.promise()
.promise()
it 'ssl conf tests', () ->
await nikita
.call ->
this
.system.execute
header: 'Test Environment Creation'
cmd: "coffee #{build_env_script}"
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node1 running'
cmd: '[[ `lxc ls | grep "node1 | RUNNING"` ]] && echo "node1 running" || echo "node1 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node1 running\n' unless err
.system.execute
header: 'Verify node2 running'
cmd: '[[ `lxc ls | grep "node2 | RUNNING"` ]] && echo "node2 running" || echo "node2 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node2 running\n' unless err
.system.execute
header: 'Verify node1 IP'
cmd: 'ping -c 1 11.10.10.11'
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node2 IP'
cmd: 'ping -c 1 11.10.10.12'
, (err, {status}) ->
status.should.be.true() unless err
# Generate all the necessary files
.system.execute
header: 'Create Certificates'
cmd: """
sh #{generate_script_path} cacert
sh #{generate_script_path} cert server
sh #{generate_script_path} cert client
"""
, (err, {status}) ->
status.should.be.true() unless err
.file.assert
header: 'server.cert created'
source: path.join(__dirname,"./cert/server.cert.pem")
.file.assert
header: 'client.cert created'
source: path.join(__dirname,"/cert/client.cert.pem")
# Sevrer SSL files
.lxd.file.push
header: 'Copy server cert'
container: "node1"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/server.cert.pem")
target: '/etc/ssl/server.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy server key'
container: "node1"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/server.key.pem")
target: '/etc/ssl/server.key.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy server ca-cert'
container: "node1"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/ca.cert.pem")
target: '/etc/ssl/ca.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
# Client SSL files
.lxd.file.push
header: 'Copy client cert'
container: "node2"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"/cert/client.cert.pem")
target: '/etc/ssl/client.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy client key'
container: "node2"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/client.key.pem")
target: '/etc/ssl/client.key.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy client ca-cert'
container: "node2"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/ca.cert.pem")
target: '/etc/ssl/ca.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Local cert deletion'
cmd: """
cd ./test/server/cert
rm -rf ca.cert.pem ca.key.pem ca.seq client.cert.pem client.key.pem server.cert.pem server.key.pem
"""
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/server':
affinity: type: 'nodes', match: 'any', values: 'node1'
options:
admin_username: 'root'
admin_password: '<PASSWORD>'
ssl:
enabled: true
cacert: source: '/etc/ssl/ca.cert.pem'
cert: source: '/etc/ssl/server.cert.pem'
key: source: '/etc/ssl/server.key.pem'
nodes: 'node1': ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster_test'
nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,'/../../env/assets/id_rsa'
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/client':
affinity: type: 'nodes', match: 'any', values: 'node2'
options: admin_username: 'root', admin_password: '<PASSWORD>'
nodes: 'node2': ip: '11.10.10.12', tags: 'type': 'node', cluster: 'cluster_test'
nikita: ssh: username: 'nikita', private_key_path: path.join(__dirname,"./../../env/assets/id_rsa")
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
this
.system.execute
header: 'Give privileges'
cmd: """
lxc exec node2 -- bash -c 'echo "ssl-ca=/etc/ssl/ca.cert.pem">>/etc/my.cnf.d/client.cnf'
lxc exec node2 -- bash -c 'echo "ssl-cert=/etc/ssl/client.cert.pem">>/etc/my.cnf.d/client.cnf'
lxc exec node2 -- bash -c 'echo "ssl-key=/etc/ssl/client.key.pem">>/etc/my.cnf.d/client.cnf'
"""
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Check SSL'
cmd: """
lxc exec node2 -- bash -c 'mysql --password=secret -h node1 -e "STATUS"'
"""
, (err, {stdout}) ->
stdout.should.containEql 'Cipher in use' unless err
.system.execute
header: 'SSH keys deletion'
cmd: """
cd ./env/assets
rm -rf id_rsa id_rsa.pub
cd ./../../log
rm -rf node1.log node2.log
"""
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.promise()
| true | path = require 'path'
nikita = require 'nikita'
build_env_script = path.join(__dirname, './../../env/build_env.coffee')
generate_script_path = path.join(__dirname, './../server/cert/generate')
each = require 'each'
store = require 'masson/lib/config/store'
multimatch = require 'masson/lib/utils/multimatch'
{merge} = require 'mixme'
array_get = require 'masson/lib/utils/array_get'
normalize = require 'masson/lib/config/normalize'
describe 'MariaDB installation - Functionnal tests (may take 10+ minutes)', ->
@timeout 1500000 # Extended timeout for these lengthy test
it 'default conf tests', () ->
await nikita
.call ->
this
.system.execute
header: 'Test Environment Creation'
cmd: "coffee #{build_env_script}"
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node1 running'
cmd: '[[ `lxc ls | grep "node1 | RUNNING"` ]] && echo "node1 running" || echo "node1 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node1 running\n' unless err
.system.execute
header: 'Verify node1 IP'
cmd: 'ping -c 1 11.10.10.11'
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/server':
affinity: type: 'nodes', match: 'any', values: 'node1'
options: admin_username: 'root', admin_password: 'PI:PASSWORD:<PASSWORD>END_PI', ssl: enabled: false
nodes: 'node1': ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster_test'
nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,"./../../env/assets/id_rsa"
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
this
.system.execute
header: 'Check'
cmd: """
lxc exec node1 -- bash -c 'mysql --password=secret -e "SHOW DATABASES;"'
"""
, (err, {stdout}) ->
stdout.should.eql 'Database\ninformation_schema\nmysql\nperformance_schema\n' unless err
.promise()
.promise()
it 'Replication conf tests', () ->
await nikita
.call ->
this
.system.execute
header: 'Test Environment Creation'
cmd: "coffee #{build_env_script}"
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node1 running'
cmd: '[[ `lxc ls | grep "node1 | RUNNING"` ]] && echo "node1 running" || echo "node1 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node1 running\n' unless err
.system.execute
header: 'Verify node2 running'
cmd: '[[ `lxc ls | grep "node2 | RUNNING"` ]] && echo "node2 running" || echo "node2 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node2 running\n' unless err
.system.execute
header: 'Verify node1 IP'
cmd: 'ping -c 1 11.10.10.11'
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node2 IP'
cmd: 'ping -c 1 11.10.10.12'
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/server':
affinity: type: 'nodes', match: 'any', values: ['node1', 'node2']
options: admin_username: 'root', admin_password: 'PI:PASSWORD:<PASSWORD>END_PI', ssl: (enabled: false), repl_master: (admin_password: 'PI:PASSWORD:<PASSWORD>END_PI', password: 'PI:PASSWORD:<PASSWORD>END_PI')
nodes: 'node1': (ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster_test'), 'node2': (ip: '11.10.10.12', tags: 'type': 'node', cluster: 'cluster_test')
nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,"./../../env/assets/id_rsa"
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
this
.system.execute
header: 'Check'
cmd: """
lxc exec node1 -- bash -c 'mysql --password=secret -e "CREATE DATABASE MyData"'
lxc exec node2 -- bash -c 'mysql --password=secret -e "SHOW DATABASES;"'
"""
, (err, {stdout}) ->
stdout.should.eql 'Database\ninformation_schema\nMyData\nmysql\nperformance_schema\n' unless err
.promise()
.promise()
it 'ssl conf tests', () ->
await nikita
.call ->
this
.system.execute
header: 'Test Environment Creation'
cmd: "coffee #{build_env_script}"
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node1 running'
cmd: '[[ `lxc ls | grep "node1 | RUNNING"` ]] && echo "node1 running" || echo "node1 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node1 running\n' unless err
.system.execute
header: 'Verify node2 running'
cmd: '[[ `lxc ls | grep "node2 | RUNNING"` ]] && echo "node2 running" || echo "node2 not running"'
, (err, {stdout}) ->
stdout.should.eql 'node2 running\n' unless err
.system.execute
header: 'Verify node1 IP'
cmd: 'ping -c 1 11.10.10.11'
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Verify node2 IP'
cmd: 'ping -c 1 11.10.10.12'
, (err, {status}) ->
status.should.be.true() unless err
# Generate all the necessary files
.system.execute
header: 'Create Certificates'
cmd: """
sh #{generate_script_path} cacert
sh #{generate_script_path} cert server
sh #{generate_script_path} cert client
"""
, (err, {status}) ->
status.should.be.true() unless err
.file.assert
header: 'server.cert created'
source: path.join(__dirname,"./cert/server.cert.pem")
.file.assert
header: 'client.cert created'
source: path.join(__dirname,"/cert/client.cert.pem")
# Sevrer SSL files
.lxd.file.push
header: 'Copy server cert'
container: "node1"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/server.cert.pem")
target: '/etc/ssl/server.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy server key'
container: "node1"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/server.key.pem")
target: '/etc/ssl/server.key.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy server ca-cert'
container: "node1"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/ca.cert.pem")
target: '/etc/ssl/ca.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
# Client SSL files
.lxd.file.push
header: 'Copy client cert'
container: "node2"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"/cert/client.cert.pem")
target: '/etc/ssl/client.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy client key'
container: "node2"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/client.key.pem")
target: '/etc/ssl/client.key.pem'
, (err, {status}) ->
status.should.be.true() unless err
.lxd.file.push
header: 'Copy client ca-cert'
container: "node2"
gid: 'root'
uid: 'root'
source: path.join(__dirname,"./cert/ca.cert.pem")
target: '/etc/ssl/ca.cert.pem'
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Local cert deletion'
cmd: """
cd ./test/server/cert
rm -rf ca.cert.pem ca.key.pem ca.seq client.cert.pem client.key.pem server.cert.pem server.key.pem
"""
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/server':
affinity: type: 'nodes', match: 'any', values: 'node1'
options:
admin_username: 'root'
admin_password: 'PI:PASSWORD:<PASSWORD>END_PI'
ssl:
enabled: true
cacert: source: '/etc/ssl/ca.cert.pem'
cert: source: '/etc/ssl/server.cert.pem'
key: source: '/etc/ssl/server.key.pem'
nodes: 'node1': ip: '11.10.10.11', tags: 'type': 'node', cluster: 'cluster_test'
nikita: ssh: username: 'nikita', private_key_path: path.join __dirname,'/../../env/assets/id_rsa'
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
config = normalize
clusters: 'cluster_test':
services: './src/client':
affinity: type: 'nodes', match: 'any', values: 'node2'
options: admin_username: 'root', admin_password: 'PI:PASSWORD:<PASSWORD>END_PI'
nodes: 'node2': ip: '11.10.10.12', tags: 'type': 'node', cluster: 'cluster_test'
nikita: ssh: username: 'nikita', private_key_path: path.join(__dirname,"./../../env/assets/id_rsa")
params = command: [ 'clusters', 'install' ], config: config
command = params.command.slice(-1)[0]
s = store(config)
each s.nodes()
.parallel(true)
.call (node, callback) ->
services = node.services
config.nikita.no_ssh = true
n = nikita merge config.nikita
n.ssh.open
header: 'SSH Open'
host: node.ip or node.fqdn
, node.ssh
n.call ->
for service in services
service = s.service service.cluster, service.service
instance = array_get service.instances, (instance) -> instance.node.id is node.id
for module in service.commands[command]
isRoot = config.nikita.ssh.username is 'root' or not config.nikita.ssh.username
n.call module, merge instance.options, sudo: not isRoot
n.next (err) ->
n.ssh.close header: 'SSH Close'
n.next -> callback err
.promise()
.call ->
this
.system.execute
header: 'Give privileges'
cmd: """
lxc exec node2 -- bash -c 'echo "ssl-ca=/etc/ssl/ca.cert.pem">>/etc/my.cnf.d/client.cnf'
lxc exec node2 -- bash -c 'echo "ssl-cert=/etc/ssl/client.cert.pem">>/etc/my.cnf.d/client.cnf'
lxc exec node2 -- bash -c 'echo "ssl-key=/etc/ssl/client.key.pem">>/etc/my.cnf.d/client.cnf'
"""
, (err, {status}) ->
status.should.be.true() unless err
.system.execute
header: 'Check SSL'
cmd: """
lxc exec node2 -- bash -c 'mysql --password=secret -h node1 -e "STATUS"'
"""
, (err, {stdout}) ->
stdout.should.containEql 'Cipher in use' unless err
.system.execute
header: 'SSH keys deletion'
cmd: """
cd ./env/assets
rm -rf id_rsa id_rsa.pub
cd ./../../log
rm -rf node1.log node2.log
"""
, (err, {status}) ->
status.should.be.true() unless err
.promise()
.promise()
|
[
{
"context": "###\n * 对文件进行重命名\n * @author jackie Lin <dashi_lin@163.com>\n###\n'use strict'\n\nthrough2 = ",
"end": 37,
"score": 0.9995888471603394,
"start": 27,
"tag": "NAME",
"value": "jackie Lin"
},
{
"context": "###\n * 对文件进行重命名\n * @author jackie Lin <dashi_lin@163.com>\n###\n'use strict'\n\nthrough2 = require 'through2'\n",
"end": 56,
"score": 0.9999297857284546,
"start": 39,
"tag": "EMAIL",
"value": "dashi_lin@163.com"
}
] | rename.coffee | JackieLin/gis | 0 | ###
* 对文件进行重命名
* @author jackie Lin <dashi_lin@163.com>
###
'use strict'
through2 = require 'through2'
path = require 'path'
_ = require 'lodash'
module.exports = (fn)->
through2.obj (file, enc, callback) ->
file = if _.isFunction(fn) then fn(file) else fn
callback null, file
| 216078 | ###
* 对文件进行重命名
* @author <NAME> <<EMAIL>>
###
'use strict'
through2 = require 'through2'
path = require 'path'
_ = require 'lodash'
module.exports = (fn)->
through2.obj (file, enc, callback) ->
file = if _.isFunction(fn) then fn(file) else fn
callback null, file
| true | ###
* 对文件进行重命名
* @author PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
###
'use strict'
through2 = require 'through2'
path = require 'path'
_ = require 'lodash'
module.exports = (fn)->
through2.obj (file, enc, callback) ->
file = if _.isFunction(fn) then fn(file) else fn
callback null, file
|
[
{
"context": ", log.headingStyle\n log.npm \"loves you\", \"Happy Xmas, Noders!\"\n cb()\n return\n\ndg = false\nObject.defi",
"end": 1409,
"score": 0.6764194965362549,
"start": 1406,
"tag": "NAME",
"value": "mas"
},
{
"context": "headingStyle\n log.npm \"loves you\", \"Happy Xmas, Noders!\"\n cb()\n return\n\ndg = false\nObject.defineProper",
"end": 1417,
"score": 0.5669225454330444,
"start": 1412,
"tag": "NAME",
"value": "oders"
}
] | deps/npm/lib/xmas.coffee | lxe/io.coffee | 0 | # happy xmas
log = require("npmlog")
module.exports = (args, cb) ->
w = (s) ->
process.stderr.write s
return
s = (if process.platform is "win32" then " *" else " ★")
f = "/"
b = "\"
x = (if process.platform is "win32" then " " else "")
o = [
"i"
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
"⸛"
"⁂"
"⸮"
"&"
"@"
"。"
]
oc = [
21
33
34
35
36
37
]
l = "^"
w "\n"
(T = (H) ->
i = 0
while i < H
w " "
i++
w x + "\u001b[33m" + s + "\n"
M = H * 2 - 1
L = 1
while L <= H
O = L * 2 - 2
S = (M - O) / 2
i = 0
while i < S
w " "
i++
w x + "\u001b[32m" + f
i = 0
while i < O
w "\u001b[" + oc[Math.floor(Math.random() * oc.length)] + "m" + o[Math.floor(Math.random() * o.length)]
i++
w x + "\u001b[32m" + b + "\n"
L++
w " "
i = 1
while i < H
w "\u001b[32m" + l
i++
w "| " + x + " |"
i = 1
while i < H
w "\u001b[32m" + l
i++
if H > 10
w "\n "
i = 1
while i < H
w " "
i++
w "| " + x + " |"
i = 1
while i < H
w " "
i++
return
) 20
w "\n\n"
log.heading = ""
log.addLevel "npm", 100000, log.headingStyle
log.npm "loves you", "Happy Xmas, Noders!"
cb()
return
dg = false
Object.defineProperty module.exports, "usage",
get: ->
if dg
module.exports [], ->
dg = true
" "
| 92522 | # happy xmas
log = require("npmlog")
module.exports = (args, cb) ->
w = (s) ->
process.stderr.write s
return
s = (if process.platform is "win32" then " *" else " ★")
f = "/"
b = "\"
x = (if process.platform is "win32" then " " else "")
o = [
"i"
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
"⸛"
"⁂"
"⸮"
"&"
"@"
"。"
]
oc = [
21
33
34
35
36
37
]
l = "^"
w "\n"
(T = (H) ->
i = 0
while i < H
w " "
i++
w x + "\u001b[33m" + s + "\n"
M = H * 2 - 1
L = 1
while L <= H
O = L * 2 - 2
S = (M - O) / 2
i = 0
while i < S
w " "
i++
w x + "\u001b[32m" + f
i = 0
while i < O
w "\u001b[" + oc[Math.floor(Math.random() * oc.length)] + "m" + o[Math.floor(Math.random() * o.length)]
i++
w x + "\u001b[32m" + b + "\n"
L++
w " "
i = 1
while i < H
w "\u001b[32m" + l
i++
w "| " + x + " |"
i = 1
while i < H
w "\u001b[32m" + l
i++
if H > 10
w "\n "
i = 1
while i < H
w " "
i++
w "| " + x + " |"
i = 1
while i < H
w " "
i++
return
) 20
w "\n\n"
log.heading = ""
log.addLevel "npm", 100000, log.headingStyle
log.npm "loves you", "Happy X<NAME>, N<NAME>!"
cb()
return
dg = false
Object.defineProperty module.exports, "usage",
get: ->
if dg
module.exports [], ->
dg = true
" "
| true | # happy xmas
log = require("npmlog")
module.exports = (args, cb) ->
w = (s) ->
process.stderr.write s
return
s = (if process.platform is "win32" then " *" else " ★")
f = "/"
b = "\"
x = (if process.platform is "win32" then " " else "")
o = [
"i"
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
"⸛"
"⁂"
"⸮"
"&"
"@"
"。"
]
oc = [
21
33
34
35
36
37
]
l = "^"
w "\n"
(T = (H) ->
i = 0
while i < H
w " "
i++
w x + "\u001b[33m" + s + "\n"
M = H * 2 - 1
L = 1
while L <= H
O = L * 2 - 2
S = (M - O) / 2
i = 0
while i < S
w " "
i++
w x + "\u001b[32m" + f
i = 0
while i < O
w "\u001b[" + oc[Math.floor(Math.random() * oc.length)] + "m" + o[Math.floor(Math.random() * o.length)]
i++
w x + "\u001b[32m" + b + "\n"
L++
w " "
i = 1
while i < H
w "\u001b[32m" + l
i++
w "| " + x + " |"
i = 1
while i < H
w "\u001b[32m" + l
i++
if H > 10
w "\n "
i = 1
while i < H
w " "
i++
w "| " + x + " |"
i = 1
while i < H
w " "
i++
return
) 20
w "\n\n"
log.heading = ""
log.addLevel "npm", 100000, log.headingStyle
log.npm "loves you", "Happy XPI:NAME:<NAME>END_PI, NPI:NAME:<NAME>END_PI!"
cb()
return
dg = false
Object.defineProperty module.exports, "usage",
get: ->
if dg
module.exports [], ->
dg = true
" "
|
[
{
"context": "', y: 'Number'},\n {x: 'Number', name: 'String'}\n ])\n\n suite 'Generics', ->\n te",
"end": 2236,
"score": 0.885814905166626,
"start": 2230,
"tag": "NAME",
"value": "String"
}
] | test/types.coffee | pasberth/TypedCoffeeScript | 5 | {
checkAcceptableObject,
ArrayType
} = require '../src/types'
suite 'Types', ->
suite '.checkAcceptableObject', ->
test 'string <> string', ->
checkAcceptableObject 'Number', 'Number'
test 'Any <> string', ->
checkAcceptableObject 'Any', 'String'
test 'String <> Possibities[String...]', ->
checkAcceptableObject 'String', possibilities: ['String', 'String']
test 'String <> Possibities[...]', ->
throws -> checkAcceptableObject 'String', possibilities: ['Number', 'String']
suite 'Object', ->
test 'throw Object <> string', ->
throws -> checkAcceptableObject {}, 'Number'
test 'Fill all', ->
checkAcceptableObject {x: 'Number'}, {x: 'Number'}
test 'Fill all with unused right params', ->
checkAcceptableObject {x: 'Number'}, {x: 'Number', y: 'Number'}
test 'throw not filled right', ->
throws -> checkAcceptableObject {x: 'Number', y: 'Number'}, {x: 'Number'}
suite 'Array', ->
test 'pure array', ->
checkAcceptableObject "Array", (array: 'String')
test 'throw non-array definition', ->
throws -> checkAcceptableObject "Number", (array: 'String')
test 'fill array', ->
checkAcceptableObject (new ArrayType "Number"), (new ArrayType "Number")
test 'fill array with raw object', ->
checkAcceptableObject (array: {n: 'String'}), (array: {n:'String'})
test 'throw not filled array', ->
throws -> checkAcceptableObject (new ArrayType "Number"), (new ArrayType "String")
test 'fill all array possibilities ', ->
checkAcceptableObject (array: {n: 'String'}), (array:[{n:'String'}, {n: 'String'}])
test 'fill array with complecated object', ->
checkAcceptableObject (array: {
x: 'Number'
y: 'Number'
}), (array:[
{x: 'Number', y: 'Number'},
{x: 'Number', y: 'Number', name: 'String'}
])
test 'throw not filled array(with complecated object)', ->
throws ->
checkAcceptableObject (array: {
x: 'Number'
y: 'Number'
}), (array:[
{x: 'Number', y: 'Number'},
{x: 'Number', name: 'String'}
])
suite 'Generics', ->
test 'fill array', ->
checkAcceptableObject {}
| 40411 | {
checkAcceptableObject,
ArrayType
} = require '../src/types'
suite 'Types', ->
suite '.checkAcceptableObject', ->
test 'string <> string', ->
checkAcceptableObject 'Number', 'Number'
test 'Any <> string', ->
checkAcceptableObject 'Any', 'String'
test 'String <> Possibities[String...]', ->
checkAcceptableObject 'String', possibilities: ['String', 'String']
test 'String <> Possibities[...]', ->
throws -> checkAcceptableObject 'String', possibilities: ['Number', 'String']
suite 'Object', ->
test 'throw Object <> string', ->
throws -> checkAcceptableObject {}, 'Number'
test 'Fill all', ->
checkAcceptableObject {x: 'Number'}, {x: 'Number'}
test 'Fill all with unused right params', ->
checkAcceptableObject {x: 'Number'}, {x: 'Number', y: 'Number'}
test 'throw not filled right', ->
throws -> checkAcceptableObject {x: 'Number', y: 'Number'}, {x: 'Number'}
suite 'Array', ->
test 'pure array', ->
checkAcceptableObject "Array", (array: 'String')
test 'throw non-array definition', ->
throws -> checkAcceptableObject "Number", (array: 'String')
test 'fill array', ->
checkAcceptableObject (new ArrayType "Number"), (new ArrayType "Number")
test 'fill array with raw object', ->
checkAcceptableObject (array: {n: 'String'}), (array: {n:'String'})
test 'throw not filled array', ->
throws -> checkAcceptableObject (new ArrayType "Number"), (new ArrayType "String")
test 'fill all array possibilities ', ->
checkAcceptableObject (array: {n: 'String'}), (array:[{n:'String'}, {n: 'String'}])
test 'fill array with complecated object', ->
checkAcceptableObject (array: {
x: 'Number'
y: 'Number'
}), (array:[
{x: 'Number', y: 'Number'},
{x: 'Number', y: 'Number', name: 'String'}
])
test 'throw not filled array(with complecated object)', ->
throws ->
checkAcceptableObject (array: {
x: 'Number'
y: 'Number'
}), (array:[
{x: 'Number', y: 'Number'},
{x: 'Number', name: '<NAME>'}
])
suite 'Generics', ->
test 'fill array', ->
checkAcceptableObject {}
| true | {
checkAcceptableObject,
ArrayType
} = require '../src/types'
suite 'Types', ->
suite '.checkAcceptableObject', ->
test 'string <> string', ->
checkAcceptableObject 'Number', 'Number'
test 'Any <> string', ->
checkAcceptableObject 'Any', 'String'
test 'String <> Possibities[String...]', ->
checkAcceptableObject 'String', possibilities: ['String', 'String']
test 'String <> Possibities[...]', ->
throws -> checkAcceptableObject 'String', possibilities: ['Number', 'String']
suite 'Object', ->
test 'throw Object <> string', ->
throws -> checkAcceptableObject {}, 'Number'
test 'Fill all', ->
checkAcceptableObject {x: 'Number'}, {x: 'Number'}
test 'Fill all with unused right params', ->
checkAcceptableObject {x: 'Number'}, {x: 'Number', y: 'Number'}
test 'throw not filled right', ->
throws -> checkAcceptableObject {x: 'Number', y: 'Number'}, {x: 'Number'}
suite 'Array', ->
test 'pure array', ->
checkAcceptableObject "Array", (array: 'String')
test 'throw non-array definition', ->
throws -> checkAcceptableObject "Number", (array: 'String')
test 'fill array', ->
checkAcceptableObject (new ArrayType "Number"), (new ArrayType "Number")
test 'fill array with raw object', ->
checkAcceptableObject (array: {n: 'String'}), (array: {n:'String'})
test 'throw not filled array', ->
throws -> checkAcceptableObject (new ArrayType "Number"), (new ArrayType "String")
test 'fill all array possibilities ', ->
checkAcceptableObject (array: {n: 'String'}), (array:[{n:'String'}, {n: 'String'}])
test 'fill array with complecated object', ->
checkAcceptableObject (array: {
x: 'Number'
y: 'Number'
}), (array:[
{x: 'Number', y: 'Number'},
{x: 'Number', y: 'Number', name: 'String'}
])
test 'throw not filled array(with complecated object)', ->
throws ->
checkAcceptableObject (array: {
x: 'Number'
y: 'Number'
}), (array:[
{x: 'Number', y: 'Number'},
{x: 'Number', name: 'PI:NAME:<NAME>END_PI'}
])
suite 'Generics', ->
test 'fill array', ->
checkAcceptableObject {}
|
[
{
"context": "# @author Gianluigi Mango\n# Query User Collection\nUser = require './../../m",
"end": 25,
"score": 0.9998784065246582,
"start": 10,
"tag": "NAME",
"value": "Gianluigi Mango"
},
{
"context": "ser = new User\n\t\t\tuserid: data[0][1],\n\t\t\tpassword: data[1][1],\n\t\t\tactive: 1\n\n\t\tuser.save (err, body) ->\n\t",
"end": 713,
"score": 0.6412302851676941,
"start": 709,
"tag": "PASSWORD",
"value": "data"
}
] | dev/server/api/model/userModel.coffee | knickatheart/mean-api | 0 | # @author Gianluigi Mango
# Query User Collection
User = require './../../models/userModel'
Image = require './../../models/imageModel'
Post = require './../../models/postModel'
module.exports = class UserModel
# Find one user in collection
# @params user[String], cb[Function]
# @return callback
findUser: (user, cb) ->
User.find userid: user
.populate path: 'images', model: Image
.populate path: 'posts', model: Post
.exec (err, body) ->
unless err then (if body.length then cb body else cb false) else console.log err
# Add one user to the collection
# @params data[Array], cb[Function]
# @return callback
addUser: (data, cb) ->
user = new User
userid: data[0][1],
password: data[1][1],
active: 1
user.save (err, body) ->
cb err, body
# Delete one user in collection
# @params id[Number], cb[Function]
# @return callback
deleteUser: (id, cb) ->
User.remove _id: id, (err, body) ->
cb err, body
# Find one user in collection by ID
# @params id[String], cb[Function]
# @return callback
findByUserId: (id, cb) ->
User.findById id
.populate path: 'images', model: Image
.exec (err, body) ->
cb err, body | 215940 | # @author <NAME>
# Query User Collection
User = require './../../models/userModel'
Image = require './../../models/imageModel'
Post = require './../../models/postModel'
module.exports = class UserModel
# Find one user in collection
# @params user[String], cb[Function]
# @return callback
findUser: (user, cb) ->
User.find userid: user
.populate path: 'images', model: Image
.populate path: 'posts', model: Post
.exec (err, body) ->
unless err then (if body.length then cb body else cb false) else console.log err
# Add one user to the collection
# @params data[Array], cb[Function]
# @return callback
addUser: (data, cb) ->
user = new User
userid: data[0][1],
password: <PASSWORD>[1][1],
active: 1
user.save (err, body) ->
cb err, body
# Delete one user in collection
# @params id[Number], cb[Function]
# @return callback
deleteUser: (id, cb) ->
User.remove _id: id, (err, body) ->
cb err, body
# Find one user in collection by ID
# @params id[String], cb[Function]
# @return callback
findByUserId: (id, cb) ->
User.findById id
.populate path: 'images', model: Image
.exec (err, body) ->
cb err, body | true | # @author PI:NAME:<NAME>END_PI
# Query User Collection
User = require './../../models/userModel'
Image = require './../../models/imageModel'
Post = require './../../models/postModel'
module.exports = class UserModel
# Find one user in collection
# @params user[String], cb[Function]
# @return callback
findUser: (user, cb) ->
User.find userid: user
.populate path: 'images', model: Image
.populate path: 'posts', model: Post
.exec (err, body) ->
unless err then (if body.length then cb body else cb false) else console.log err
# Add one user to the collection
# @params data[Array], cb[Function]
# @return callback
addUser: (data, cb) ->
user = new User
userid: data[0][1],
password: PI:PASSWORD:<PASSWORD>END_PI[1][1],
active: 1
user.save (err, body) ->
cb err, body
# Delete one user in collection
# @params id[Number], cb[Function]
# @return callback
deleteUser: (id, cb) ->
User.remove _id: id, (err, body) ->
cb err, body
# Find one user in collection by ID
# @params id[String], cb[Function]
# @return callback
findByUserId: (id, cb) ->
User.findById id
.populate path: 'images', model: Image
.exec (err, body) ->
cb err, body |
[
{
"context": "backup under 'encrypted_key' \n encrypted_key = \"37fd6a251d262ec4c25343016a024a3aec543b7a43a208bf66bc80640dff\" + \"8ac8d52ae4ad7500d067c90f26189f9ee6050a13c087d430d2",
"end": 284,
"score": 0.9877341985702515,
"start": 219,
"tag": "KEY",
"value": "37fd6a251d262ec4c25343016a024a3aec543b7a43a208bf66bc80640dff\" + \""
},
{
"context": "4c25343016a024a3aec543b7a43a208bf66bc80640dff\" + \"8ac8d52ae4ad7500d067c90f26189f9ee6050a13c087d430d24b88e713f1\" + \"5d32cbd59e61b0e69c75da93f43aabb11039d06f\"\n \n ",
"end": 345,
"score": 0.991134524345398,
"start": 284,
"tag": "KEY",
"value": "8ac8d52ae4ad7500d067c90f26189f9ee6050a13c087d430d24b88e713f1\""
},
{
"context": "0d067c90f26189f9ee6050a13c087d430d24b88e713f1\" + \"5d32cbd59e61b0e69c75da93f43aabb11039d06f\"\n \n # echo -n Password01|sha512|xxd -p\n #passw",
"end": 389,
"score": 0.9987163543701172,
"start": 349,
"tag": "KEY",
"value": "5d32cbd59e61b0e69c75da93f43aabb11039d06f"
},
{
"context": "-p\n #password\n #initalization vector\n password_sha512 = \"a5d69dffbc219d0c0dd0be4a05505b219b973a04b4f",
"end": 481,
"score": 0.9961068630218506,
"start": 478,
"tag": "PASSWORD",
"value": "sha"
},
{
"context": "word\n #initalization vector\n password_sha512 = \"a5d69dffbc219d0c0dd0be4a05505b219b973a04b4f2cd1979a5c9fd65bc0362\" + \"2e4417ec767ffe269e5e53f769ffc6e1\" + \"6bf05796",
"end": 552,
"score": 0.9981964230537415,
"start": 488,
"tag": "PASSWORD",
"value": "a5d69dffbc219d0c0dd0be4a05505b219b973a04b4f2cd1979a5c9fd65bc0362"
},
{
"context": "0be4a05505b219b973a04b4f2cd1979a5c9fd65bc0362\" + \"2e4417ec767ffe269e5e53f769ffc6e1\" + \"6bf05796fddf2771e4dc6d1cb2ac3fcf\" #discard\n ",
"end": 589,
"score": 0.9912600517272949,
"start": 557,
"tag": "PASSWORD",
"value": "2e4417ec767ffe269e5e53f769ffc6e1"
},
{
"context": "65bc0362\" + \"2e4417ec767ffe269e5e53f769ffc6e1\" + \"6bf05796fddf2771e4dc6d1cb2ac3fcf\" #discard\n decrypted_key = \"ab0cb9a14ecaa3078bfe",
"end": 626,
"score": 0.9966097474098206,
"start": 594,
"tag": "PASSWORD",
"value": "6bf05796fddf2771e4dc6d1cb2ac3fcf"
},
{
"context": "2771e4dc6d1cb2ac3fcf\" #discard\n decrypted_key = \"ab0cb9a14ecaa3078bfee11ca0420ea2\" + \"3f5d49d7a7c97f7f45c3a520106491f8\" + \"00000000",
"end": 688,
"score": 0.9996978640556335,
"start": 656,
"tag": "KEY",
"value": "ab0cb9a14ecaa3078bfee11ca0420ea2"
},
{
"context": "decrypted_key = \"ab0cb9a14ecaa3078bfee11ca0420ea2\" + \"3f5d49d7a7c97f7f45c3a520106491f8\" + \"00000000000",
"end": 691,
"score": 0.6749069094657898,
"start": 690,
"tag": "KEY",
"value": "+"
},
{
"context": "ypted_key = \"ab0cb9a14ecaa3078bfee11ca0420ea2\" + \"3f5d49d7a7c97f7f45c3a520106491f8\" + \"000000000000000000000000000000000000000000000",
"end": 725,
"score": 0.9992903470993042,
"start": 693,
"tag": "KEY",
"value": "3f5d49d7a7c97f7f45c3a520106491f8"
},
{
"context": "a0420ea2\" + \"3f5d49d7a7c97f7f45c3a520106491f8\" + \"0000000000000000000000000000000000000000000000000000000",
"end": 735,
"score": 0.982052206993103,
"start": 730,
"tag": "KEY",
"value": "00000"
}
] | programs/web_wallet/test/crypto/test/CryptoFunctions.coffee | larkx/LarkX | 0 | CryptoJS = require("crypto-js")
assert = require("assert")
###*
@see https://code.google.com/p/crypto-js/#The_Cipher_Input
###
describe "Crypto", ->
# wallet.json backup under 'encrypted_key'
encrypted_key = "37fd6a251d262ec4c25343016a024a3aec543b7a43a208bf66bc80640dff" + "8ac8d52ae4ad7500d067c90f26189f9ee6050a13c087d430d24b88e713f1" + "5d32cbd59e61b0e69c75da93f43aabb11039d06f"
# echo -n Password01|sha512|xxd -p
#password
#initalization vector
password_sha512 = "a5d69dffbc219d0c0dd0be4a05505b219b973a04b4f2cd1979a5c9fd65bc0362" + "2e4417ec767ffe269e5e53f769ffc6e1" + "6bf05796fddf2771e4dc6d1cb2ac3fcf" #discard
decrypted_key = "ab0cb9a14ecaa3078bfee11ca0420ea2" + "3f5d49d7a7c97f7f45c3a520106491f8" + "00000000000000000000000000000000000000000000000000000000" + "00000000"
#https://github.com/InvictusInnovations/fc/blob/978de7885a8065bc84b07bfb65b642204e894f55/src/crypto/aes.cpp#L330
#Bitshares aes_decrypt uses part of the password hash as the initilization vector
#console.log(password_sha512.substring(64,96))
iv = CryptoJS.enc.Hex.parse(password_sha512.substring(64, 96))
#console.log(password_sha512.substring(0,64)
key = CryptoJS.enc.Hex.parse(password_sha512.substring(0, 64))
# Convert data into word arrays (used by Crypto)
cipher = CryptoJS.enc.Hex.parse(encrypted_key)
it "Decrypts master key", ->
# see wallet_records.cpp master_key::decrypt_key
decrypted = CryptoJS.AES.decrypt(
ciphertext: cipher
salt: null
, key,
iv: iv
)
#master private key=
#console.log(CryptoJS.enc.Hex.stringify(decrypted))
assert.equal decrypted_key, CryptoJS.enc.Hex.stringify(decrypted)
| 4056 | CryptoJS = require("crypto-js")
assert = require("assert")
###*
@see https://code.google.com/p/crypto-js/#The_Cipher_Input
###
describe "Crypto", ->
# wallet.json backup under 'encrypted_key'
encrypted_key = "<KEY> <KEY> + "<KEY>"
# echo -n Password01|sha512|xxd -p
#password
#initalization vector
password_<PASSWORD>512 = "<PASSWORD>" + "<PASSWORD>" + "<PASSWORD>" #discard
decrypted_key = "<KEY>" <KEY> "<KEY>" + "<KEY>000000000000000000000000000000000000000000000000000" + "00000000"
#https://github.com/InvictusInnovations/fc/blob/978de7885a8065bc84b07bfb65b642204e894f55/src/crypto/aes.cpp#L330
#Bitshares aes_decrypt uses part of the password hash as the initilization vector
#console.log(password_sha512.substring(64,96))
iv = CryptoJS.enc.Hex.parse(password_sha512.substring(64, 96))
#console.log(password_sha512.substring(0,64)
key = CryptoJS.enc.Hex.parse(password_sha512.substring(0, 64))
# Convert data into word arrays (used by Crypto)
cipher = CryptoJS.enc.Hex.parse(encrypted_key)
it "Decrypts master key", ->
# see wallet_records.cpp master_key::decrypt_key
decrypted = CryptoJS.AES.decrypt(
ciphertext: cipher
salt: null
, key,
iv: iv
)
#master private key=
#console.log(CryptoJS.enc.Hex.stringify(decrypted))
assert.equal decrypted_key, CryptoJS.enc.Hex.stringify(decrypted)
| true | CryptoJS = require("crypto-js")
assert = require("assert")
###*
@see https://code.google.com/p/crypto-js/#The_Cipher_Input
###
describe "Crypto", ->
# wallet.json backup under 'encrypted_key'
encrypted_key = "PI:KEY:<KEY>END_PI PI:KEY:<KEY>END_PI + "PI:KEY:<KEY>END_PI"
# echo -n Password01|sha512|xxd -p
#password
#initalization vector
password_PI:PASSWORD:<PASSWORD>END_PI512 = "PI:PASSWORD:<PASSWORD>END_PI" + "PI:PASSWORD:<PASSWORD>END_PI" + "PI:PASSWORD:<PASSWORD>END_PI" #discard
decrypted_key = "PI:KEY:<KEY>END_PI" PI:KEY:<KEY>END_PI "PI:KEY:<KEY>END_PI" + "PI:KEY:<KEY>END_PI000000000000000000000000000000000000000000000000000" + "00000000"
#https://github.com/InvictusInnovations/fc/blob/978de7885a8065bc84b07bfb65b642204e894f55/src/crypto/aes.cpp#L330
#Bitshares aes_decrypt uses part of the password hash as the initilization vector
#console.log(password_sha512.substring(64,96))
iv = CryptoJS.enc.Hex.parse(password_sha512.substring(64, 96))
#console.log(password_sha512.substring(0,64)
key = CryptoJS.enc.Hex.parse(password_sha512.substring(0, 64))
# Convert data into word arrays (used by Crypto)
cipher = CryptoJS.enc.Hex.parse(encrypted_key)
it "Decrypts master key", ->
# see wallet_records.cpp master_key::decrypt_key
decrypted = CryptoJS.AES.decrypt(
ciphertext: cipher
salt: null
, key,
iv: iv
)
#master private key=
#console.log(CryptoJS.enc.Hex.stringify(decrypted))
assert.equal decrypted_key, CryptoJS.enc.Hex.stringify(decrypted)
|
[
{
"context": " = class Student extends Person\n constructor: (firstName, lastName, age, grade) ->\n super\n\n ",
"end": 67,
"score": 0.9993539452552795,
"start": 58,
"tag": "NAME",
"value": "firstName"
},
{
"context": "tudent extends Person\n constructor: (firstName, lastName, age, grade) ->\n super\n\n @grade = g",
"end": 77,
"score": 0.9966802000999451,
"start": 69,
"tag": "NAME",
"value": "lastName"
}
] | WebDesign/5.JavaScriptApplications/2.AdvancedOOP/1.SchoolRepository/scripts/Student.coffee | trinityimma/TelerikAcademy | 0 | @Student = class Student extends Person
constructor: (firstName, lastName, age, grade) ->
super
@grade = grade
| 170362 | @Student = class Student extends Person
constructor: (<NAME>, <NAME>, age, grade) ->
super
@grade = grade
| true | @Student = class Student extends Person
constructor: (PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI, age, grade) ->
super
@grade = grade
|
[
{
"context": " = new Klass\n id: idA\n name: nameA\n attr: _attr\n\n expect(k.id).",
"end": 2656,
"score": 0.7838494181632996,
"start": 2652,
"tag": "NAME",
"value": "name"
}
] | test/registry/RegistryItem.coffee | marc-ed-raffalli/EventService | 2 | # global require
'use strict'
RegistryItem = require '../../src/registry/RegistryItem.js'
idA = 1
channelA = 'channelA'
nameA = 'nameA'
nameB = 'nameB'
registryItemTestRunner = ->
# ------------------------------------------------------
describe 'RegistryItem', ->
# ----------------------------------------
describe 'Class definition', ->
it 'RegistryItem API should be defined', ->
expect(RegistryItem).not.to.be.undefined
expect(RegistryItem.prototype.extends).not.to.be.undefined
expect(RegistryItem.prototype.init).not.to.be.undefined
# ----------------------------------------
# ----------------------------------------
describe 'API', ->
# ----------------------------------------
describe 'RegistryItem -> init()', ->
it 'should accept id, name [,channel]', ->
item = new RegistryItem
id: idA
name: nameA
expect(item.id).to.equal idA
expect(item.name).to.equal nameA
expect(item.channel).to.equal undefined
# ----------------------------------------
it 'should THROW TypeError on missing id or name', ->
missingIdFunc = ->
new RegistryItem
name: nameA
missingNameFunc = ->
new RegistryItem
id: idA
missingIdNameFunc = ->
new RegistryItem
expect(missingIdFunc).to.throw
expect(missingNameFunc).to.throw
expect(missingIdNameFunc).to.throw
# ----------------------------------------
# ----------------------------------------
describe 'RegistryItem -> extends()', ->
it 'should return new Class with RegistryItem functions overridden/inherited', ->
CST = 123
_init = ->
_fcA = ->
Klass = RegistryItem.prototype.extends
CST: CST
init: _init
fcA: _fcA
expect(Klass).not.to.be.undefined
expect(Klass.prototype.extends).not.to.be.undefined
expect(Klass.prototype.init).not.to.be.undefined
expect(Klass.prototype.CST).to.equal CST
expect(Klass.prototype.init).to.equal _init
expect(Klass.prototype.fcA).to.equal _fcA
# ----------------------------------------
it 'should new Class extending RegistryItem', ->
_attr = 1234
_init = (options) ->
Object.defineProperty this, 'attr',
value: options.attr
Klass = RegistryItem.prototype.extends
init: _init
k = new Klass
id: idA
name: nameA
attr: _attr
expect(k.id).to.equal idA
expect(k.name).to.equal nameA
expect(k.channel).to.equal undefined
expect(k.attr).to.equal _attr
#------------------------------------------------------------
#------------------------------------------------------------
module.exports = registryItemTestRunner; | 61619 | # global require
'use strict'
RegistryItem = require '../../src/registry/RegistryItem.js'
idA = 1
channelA = 'channelA'
nameA = 'nameA'
nameB = 'nameB'
registryItemTestRunner = ->
# ------------------------------------------------------
describe 'RegistryItem', ->
# ----------------------------------------
describe 'Class definition', ->
it 'RegistryItem API should be defined', ->
expect(RegistryItem).not.to.be.undefined
expect(RegistryItem.prototype.extends).not.to.be.undefined
expect(RegistryItem.prototype.init).not.to.be.undefined
# ----------------------------------------
# ----------------------------------------
describe 'API', ->
# ----------------------------------------
describe 'RegistryItem -> init()', ->
it 'should accept id, name [,channel]', ->
item = new RegistryItem
id: idA
name: nameA
expect(item.id).to.equal idA
expect(item.name).to.equal nameA
expect(item.channel).to.equal undefined
# ----------------------------------------
it 'should THROW TypeError on missing id or name', ->
missingIdFunc = ->
new RegistryItem
name: nameA
missingNameFunc = ->
new RegistryItem
id: idA
missingIdNameFunc = ->
new RegistryItem
expect(missingIdFunc).to.throw
expect(missingNameFunc).to.throw
expect(missingIdNameFunc).to.throw
# ----------------------------------------
# ----------------------------------------
describe 'RegistryItem -> extends()', ->
it 'should return new Class with RegistryItem functions overridden/inherited', ->
CST = 123
_init = ->
_fcA = ->
Klass = RegistryItem.prototype.extends
CST: CST
init: _init
fcA: _fcA
expect(Klass).not.to.be.undefined
expect(Klass.prototype.extends).not.to.be.undefined
expect(Klass.prototype.init).not.to.be.undefined
expect(Klass.prototype.CST).to.equal CST
expect(Klass.prototype.init).to.equal _init
expect(Klass.prototype.fcA).to.equal _fcA
# ----------------------------------------
it 'should new Class extending RegistryItem', ->
_attr = 1234
_init = (options) ->
Object.defineProperty this, 'attr',
value: options.attr
Klass = RegistryItem.prototype.extends
init: _init
k = new Klass
id: idA
name: <NAME>A
attr: _attr
expect(k.id).to.equal idA
expect(k.name).to.equal nameA
expect(k.channel).to.equal undefined
expect(k.attr).to.equal _attr
#------------------------------------------------------------
#------------------------------------------------------------
module.exports = registryItemTestRunner; | true | # global require
'use strict'
RegistryItem = require '../../src/registry/RegistryItem.js'
idA = 1
channelA = 'channelA'
nameA = 'nameA'
nameB = 'nameB'
registryItemTestRunner = ->
# ------------------------------------------------------
describe 'RegistryItem', ->
# ----------------------------------------
describe 'Class definition', ->
it 'RegistryItem API should be defined', ->
expect(RegistryItem).not.to.be.undefined
expect(RegistryItem.prototype.extends).not.to.be.undefined
expect(RegistryItem.prototype.init).not.to.be.undefined
# ----------------------------------------
# ----------------------------------------
describe 'API', ->
# ----------------------------------------
describe 'RegistryItem -> init()', ->
it 'should accept id, name [,channel]', ->
item = new RegistryItem
id: idA
name: nameA
expect(item.id).to.equal idA
expect(item.name).to.equal nameA
expect(item.channel).to.equal undefined
# ----------------------------------------
it 'should THROW TypeError on missing id or name', ->
missingIdFunc = ->
new RegistryItem
name: nameA
missingNameFunc = ->
new RegistryItem
id: idA
missingIdNameFunc = ->
new RegistryItem
expect(missingIdFunc).to.throw
expect(missingNameFunc).to.throw
expect(missingIdNameFunc).to.throw
# ----------------------------------------
# ----------------------------------------
describe 'RegistryItem -> extends()', ->
it 'should return new Class with RegistryItem functions overridden/inherited', ->
CST = 123
_init = ->
_fcA = ->
Klass = RegistryItem.prototype.extends
CST: CST
init: _init
fcA: _fcA
expect(Klass).not.to.be.undefined
expect(Klass.prototype.extends).not.to.be.undefined
expect(Klass.prototype.init).not.to.be.undefined
expect(Klass.prototype.CST).to.equal CST
expect(Klass.prototype.init).to.equal _init
expect(Klass.prototype.fcA).to.equal _fcA
# ----------------------------------------
it 'should new Class extending RegistryItem', ->
_attr = 1234
_init = (options) ->
Object.defineProperty this, 'attr',
value: options.attr
Klass = RegistryItem.prototype.extends
init: _init
k = new Klass
id: idA
name: PI:NAME:<NAME>END_PIA
attr: _attr
expect(k.id).to.equal idA
expect(k.name).to.equal nameA
expect(k.channel).to.equal undefined
expect(k.attr).to.equal _attr
#------------------------------------------------------------
#------------------------------------------------------------
module.exports = registryItemTestRunner; |
[
{
"context": "onship?\"}\n\t\t11: {active: 1, play: 1, text:\"What is Batman's guilty pleasure?\"}\n\t\t12: {active: 1, play: 1, t",
"end": 1033,
"score": 0.9778544306755066,
"start": 1027,
"tag": "NAME",
"value": "Batman"
},
{
"context": "iend?\"}\n\t\t13: {active: 1, play: 1, text:\"What does Dick Cheney prefer?\"}\n\t\t14: {active: 1, play: 1, text:\"What's",
"end": 1173,
"score": 0.9962671399116516,
"start": 1162,
"tag": "NAME",
"value": "Dick Cheney"
},
{
"context": "___.\"}\n\t\t42: {active: 1, play: 1, text:\"I'm sorry, Professor, but I couldn't complete my homework because of _",
"end": 3263,
"score": 0.9904683232307434,
"start": 3254,
"tag": "NAME",
"value": "Professor"
},
{
"context": "1, text:\"In the new Disney Channel Original Movie, Hannah Montana struggles with ____ for the first time.\"}\n\t\t49",
"end": 3919,
"score": 0.7710679769515991,
"start": 3908,
"tag": "NAME",
"value": "Hannah Mont"
},
{
"context": "____.\"}\n\t\t53: {active: 1, play: 1, text:\"Next from J.K. Rowling: Harry Potter and the Chamber of ____.\"}\n\t\t54: {a",
"end": 4418,
"score": 0.9988017082214355,
"start": 4406,
"tag": "NAME",
"value": "J.K. Rowling"
},
{
"context": "{active: 1, play: 1, text:\"Next from J.K. Rowling: Harry Potter and the Chamber of ____.\"}\n\t\t54: {active: 1, play",
"end": 4432,
"score": 0.9345977306365967,
"start": 4420,
"tag": "NAME",
"value": "Harry Potter"
},
{
"context": "ctive: 1, play: 1, text:\"But before I kill you, Mr. Bond, I must show you ____.\"}\n\t\t66: {active: 1, play: ",
"end": 5436,
"score": 0.6561751961708069,
"start": 5432,
"tag": "NAME",
"value": "Bond"
},
{
"context": ": 1, play: 1, text:\"When Pharaoh remained unmoved, Moses called down a plague of ____.\"}\n\t\t67: {active: 1,",
"end": 5531,
"score": 0.9305816888809204,
"start": 5526,
"tag": "NAME",
"value": "Moses"
},
{
"context": "ned by ____.\"}\n\t\t68: {active: 1, play: 1, text:\"In Michael Jackson's final moments, he thought about ____.\"}\n\t\t69: {",
"end": 5702,
"score": 0.9975602030754089,
"start": 5687,
"tag": "NAME",
"value": "Michael Jackson"
},
{
"context": "ctive: 1, play: 2, text:\"In his new summer comedy, Rob Schneider is ____ trapped in the body of ____.\"}\n\t\t80: {act",
"end": 6781,
"score": 0.9995949864387512,
"start": 6768,
"tag": "NAME",
"value": "Rob Schneider"
},
{
"context": "= ____.\"}\n\t\t84: {active: 1, play: 1, text:\"What is Curious George so curious about?\"}\n\t\t85: {active: 1, play: 1, te",
"end": 7193,
"score": 0.9017984867095947,
"start": 7179,
"tag": "NAME",
"value": "Curious George"
},
{
"context": "__.\"}\n\t\t92: {active: 1, play: 2, text:\"Dear Sir or Madam, We regret to inform you that the Office of ____ ",
"end": 7941,
"score": 0.8617724180221558,
"start": 7936,
"tag": "NAME",
"value": "Madam"
},
{
"context": "ve: 1, play: 1, text:\"In its new tourism campaign, Detroit proudly proclaims that it has finally elimina",
"end": 8492,
"score": 0.6564580798149109,
"start": 8489,
"tag": "NAME",
"value": "Det"
},
{
"context": "sidekick duo?\"}\n\t\t110: {active: 1, play: 1, text:\"Daddy, why is Mommy crying?\"}\n\t\t111: {active: 1, play: ",
"end": 9749,
"score": 0.9415467977523804,
"start": 9744,
"tag": "NAME",
"value": "Daddy"
},
{
"context": "\"}\n\t\t110: {active: 1, play: 1, text:\"Daddy, why is Mommy crying?\"}\n\t\t111: {active: 1, play: 1, text:\"And I",
"end": 9763,
"score": 0.957610547542572,
"start": 9758,
"tag": "NAME",
"value": "Mommy"
},
{
"context": "\t\t125: {active: 1, play: 1, text:\"Next time on Dr. Phil: How to talk to your child about ____.\"}\n\t\t126: {",
"end": 11322,
"score": 0.949600338935852,
"start": 11318,
"tag": "NAME",
"value": "Phil"
},
{
"context": "261: {active: 1, play: 1, text:\"In his next movie, Will Smith saves the world from ____.\"}\n\t\t262: {active: 1, p",
"end": 22278,
"score": 0.9995951652526855,
"start": 22268,
"tag": "NAME",
"value": "Will Smith"
},
{
"context": "ld from ____.\"}\n\t\t262: {active: 1, play: 1, text:\"Lady Gaga has revealed her new dress will be made of ____.\"",
"end": 22351,
"score": 0.9958553314208984,
"start": 22342,
"tag": "NAME",
"value": "Lady Gaga"
},
{
"context": "made of ____.\"}\n\t\t263: {active: 1, play: 1, text:\"Justin Bieber's new song is all about ____.\"}\n\t\t264: {active: 1",
"end": 22450,
"score": 0.9995859861373901,
"start": 22437,
"tag": "NAME",
"value": "Justin Bieber"
},
{
"context": "5: {active: 1, play: 1, text:\"In the next episode, SpongeBob gets introduced to ____. \"}\n\t\t286: {active: 1, pl",
"end": 24128,
"score": 0.712638795375824,
"start": 24119,
"tag": "NAME",
"value": "SpongeBob"
},
{
"context": "at MAGFest.\"}\n\t\t# 323: {active: 1, play: 1, text:\"Kyle's next student film will focus on ____.\"}\n\t\t# 324",
"end": 27758,
"score": 0.6402167081832886,
"start": 27754,
"tag": "NAME",
"value": "Kyle"
},
{
"context": "more views.\"}\n\t\t# 345: {active: 1, play: 1, text:\"Doug still regrets the day he decided to do a Let's Pl",
"end": 29547,
"score": 0.9923502802848816,
"start": 29543,
"tag": "NAME",
"value": "Doug"
},
{
"context": " the day he decided to do a Let's Play video for 'Bart Simpson's ____ Adventure'.\"}\n\t\t# 346: {active: 1, play: 1",
"end": 29623,
"score": 0.996729850769043,
"start": 29611,
"tag": "NAME",
"value": "Bart Simpson"
},
{
"context": "\n\t\t# 439: {active: 1, play: 1, text:\"Welcome home, Master! Is there anything your servant girl can bring yo",
"end": 37791,
"score": 0.9197708368301392,
"start": 37785,
"tag": "NAME",
"value": "Master"
},
{
"context": "tive: 1, play: 1, text:\"While writing Dragon Ball, Akira Toriyama would occasionally take a break from working t",
"end": 40300,
"score": 0.7514317035675049,
"start": 40289,
"tag": "NAME",
"value": "Akira Toriy"
},
{
"context": "as ____.\"}\n\t\t# 512: {active: 1, play: 1, text:\"Dr. Black Jack, please hurry! The patient is suffering from a te",
"end": 44865,
"score": 0.994644045829773,
"start": 44855,
"tag": "NAME",
"value": "Black Jack"
},
{
"context": " lost ____.\"}\n\t\t# 535: {active: 1, play: 1, text:\"Disney presents ____, on ice!\"}\n\t\t# 536: {active: 1, ",
"end": 47002,
"score": 0.5531905293464661,
"start": 46999,
"tag": "NAME",
"value": "Dis"
},
{
"context": " cup.\"}\n\t\t# 537: {active: 1, play: 1, text:\"Though Thomas Edison invented the lightbulb, he is also known for givi",
"end": 47173,
"score": 0.9970928430557251,
"start": 47160,
"tag": "NAME",
"value": "Thomas Edison"
},
{
"context": "ng us ____.\"}\n\t\t# 538: {active: 1, play: 2, text:\"Little Miss. Muffet sat on her tuffet, eating her ____ and ____.\"}\n\t\t",
"end": 47292,
"score": 0.9352527856826782,
"start": 47273,
"tag": "NAME",
"value": "Little Miss. Muffet"
},
{
"context": " ____.'\"}\n\t\t# 548: {active: 1, play: 1, text:\"'Why Grandma', said Little Red Riding Hood, 'What big ____ you",
"end": 48343,
"score": 0.9972984790802002,
"start": 48336,
"tag": "NAME",
"value": "Grandma"
},
{
"context": "tive: 1, play: 1, text:\"After a wild night of crusading, Applebloom learned that ____ was her super speci",
"end": 55740,
"score": 0.5140829086303711,
"start": 55735,
"tag": "NAME",
"value": "ading"
},
{
"context": "1, play: 1, text:\"After a wild night of crusading, Applebloom learned that ____ was her super special tale",
"end": 55747,
"score": 0.723458468914032,
"start": 55742,
"tag": "NAME",
"value": "Apple"
},
{
"context": "r ____.\"}\n\t\t# 633: {active: 1, play: 1, text:\"Dear Princess Celestia, Today I learned about ____. \"}\n\t\t# 634: {active:",
"end": 56438,
"score": 0.9997649192810059,
"start": 56421,
"tag": "NAME",
"value": "Princess Celestia"
},
{
"context": ", play: 1, text:\"Despite everypony's expectations, Sweetie Belle's cutie mark ended up being ____.\"}\n\t\t# 635: {act",
"end": 56554,
"score": 0.9868464469909668,
"start": 56541,
"tag": "NAME",
"value": "Sweetie Belle"
},
{
"context": " ____.\"}\n\t\t# 695: {active: 1, play: 1, text:\"Sorry Mario, but ____ is in another castle.\"}\n\t\t# 696: {activ",
"end": 61534,
"score": 0.9189764857292175,
"start": 61529,
"tag": "NAME",
"value": "Mario"
},
{
"context": "4: {active: 1, play: 1, text:\"In Kingdom Hearts, Donald Duck will be replaced with ____ .\"}\n\t\t# 745: {ac",
"end": 65237,
"score": 0.5206078290939331,
"start": 65233,
"tag": "NAME",
"value": "onal"
},
{
"context": "___.\"}\n\t\t# 793: {active: 1, play: 1, text:\"HELLO FURRIEND, HOWL ARE YOU DOING?\"}\n\t\t# 794: {active: 1, ",
"end": 69867,
"score": 0.5504760146141052,
"start": 69865,
"tag": "NAME",
"value": "UR"
},
{
"context": "ere's ____.\"}\n\t\t# 820: {active: 1, play: 1, text:\"MikeJ's next sexual conquest is ____.\"}\n\t\t# 821: {activ",
"end": 72277,
"score": 0.9664566516876221,
"start": 72272,
"tag": "NAME",
"value": "MikeJ"
},
{
"context": "st is ____.\"}\n\t\t# 821: {active: 1, play: 1, text:\"Nash had a long day at work, so tonight he'll stream _",
"end": 72352,
"score": 0.9912288188934326,
"start": 72348,
"tag": "NAME",
"value": "Nash"
},
{
"context": "tream ____.\"}\n\t\t# 822: {active: 1, play: 1, text:\"Nash rejected yet another RDA request for ____.\"}\n\t\t# ",
"end": 72449,
"score": 0.9893732070922852,
"start": 72445,
"tag": "NAME",
"value": "Nash"
},
{
"context": "t for ____.\"}\n\t\t# 823: {active: 1, play: 1, text:\"Nash's recent rant about Microsoft led to ____.\"}\n\t\t# ",
"end": 72535,
"score": 0.9841840863227844,
"start": 72531,
"tag": "NAME",
"value": "Nash"
},
{
"context": "ed to ____.\"}\n\t\t# 824: {active: 1, play: 1, text:\"Nash's Reviewer Spotlight featured ____.\"}\n\t\t# 825: {a",
"end": 72621,
"score": 0.977863609790802,
"start": 72617,
"tag": "NAME",
"value": "Nash"
},
{
"context": "\"}\n\t\t# 834: {active: 1, play: 1, text:\"What killed Harvey Finevoice's son?\"}\n\t\t# 835: {active: 1, play: 1, text:\"What",
"end": 73629,
"score": 0.999470591545105,
"start": 73613,
"tag": "NAME",
"value": "Harvey Finevoice"
},
{
"context": "ue to ____.\"}\n\t\t# 865: {active: 1, play: 1, text:\"Ohmwrecker is known for his MLG online play. What people don",
"end": 76151,
"score": 0.92236328125,
"start": 76141,
"tag": "NAME",
"value": "Ohmwrecker"
},
{
"context": "71: {active: 1, play: 1, text:\"Hello anybody, I am ____Patrol.\"}\n\t\t# 872: {active: 1, play: 2, text:\"I have ___",
"end": 76749,
"score": 0.9374489188194275,
"start": 76739,
"tag": "USERNAME",
"value": "____Patrol"
},
{
"context": "talk? ____.\"}\n\t\t# 899: {active: 1, play: 1, text:\"Jon's mom called him to tell him about ____.\"}\n\t\t# 90",
"end": 78800,
"score": 0.9296067953109741,
"start": 78797,
"tag": "NAME",
"value": "Jon"
},
{
"context": " this shit.\"}\n\t\t# 902: {active: 1, play: 1, text:\"Jon believes that the most important part of any vide",
"end": 79039,
"score": 0.9717384576797485,
"start": 79036,
"tag": "NAME",
"value": "Jon"
},
{
"context": "me is ____.\"}\n\t\t# 903: {active: 1, play: 1, text:\"Jon can't get enough of ____.\"}\n\t\t# 904: {active: 1, ",
"end": 79146,
"score": 0.9473361968994141,
"start": 79143,
"tag": "NAME",
"value": "Jon"
},
{
"context": "gh of ____.\"}\n\t\t# 904: {active: 1, play: 1, text:\"Jon can't survive air travel without ____.\"}\n\t\t# 905:",
"end": 79214,
"score": 0.8212285041809082,
"start": 79211,
"tag": "NAME",
"value": "Jon"
},
{
"context": "thout ____.\"}\n\t\t# 905: {active: 1, play: 1, text:\"Jon just wants to touch ____.\"}\n\t\t# 906: {active: 1, ",
"end": 79295,
"score": 0.9857818484306335,
"start": 79292,
"tag": "NAME",
"value": "Jon"
},
{
"context": ", play: 1, text:\"Do you remember the episode where Ash caught a ____?\"}\n\t\t# 915: {active: 1, play: 1, te",
"end": 80059,
"score": 0.7333382368087769,
"start": 80056,
"tag": "NAME",
"value": "Ash"
},
{
"context": "es of ____.\"}\n\t\t# 937: {active: 1, play: 1, text:\"Barry, add ____ into the video!\"}\n\t\t# 938: {active: 1, ",
"end": 81937,
"score": 0.996534526348114,
"start": 81932,
"tag": "NAME",
"value": "Barry"
},
{
"context": " the video!\"}\n\t\t# 938: {active: 1, play: 1, text:\"Barry, we need a replay on ____.\"}\n\t\t# 939: {active: 1,",
"end": 82007,
"score": 0.9956027865409851,
"start": 82002,
"tag": "NAME",
"value": "Barry"
},
{
"context": "ay on ____.\"}\n\t\t# 939: {active: 1, play: 1, text:\"BARRY! SHOW ____ AGAIN!\"}\n\t\t# 940: {active: 1, play: 1,",
"end": 82078,
"score": 0.9796347618103027,
"start": 82073,
"tag": "NAME",
"value": "BARRY"
},
{
"context": "____ AGAIN!\"}\n\t\t# 940: {active: 1, play: 1, text:\"Barry's sheer skill at ____ is unmatched.\"}\n\t\t# 941: {a",
"end": 82140,
"score": 0.9931869506835938,
"start": 82135,
"tag": "NAME",
"value": "Barry"
},
{
"context": "ve: 1, play: 1, text:\"After getting wasted at PAX, Burnie announced that 'I am ____!'\"}\n\t\t# 961: {active: 1",
"end": 83626,
"score": 0.9876837134361267,
"start": 83620,
"tag": "NAME",
"value": "Burnie"
},
{
"context": "I am ____!'\"}\n\t\t# 961: {active: 1, play: 1, text:\"Barbara sucks ____.\"}\n\t\t# 962: {active: 1, play: 1, text:",
"end": 83700,
"score": 0.9912437200546265,
"start": 83693,
"tag": "NAME",
"value": "Barbara"
},
{
"context": " in my way.\"}\n\t\t# 976: {active: 1, play: 1, text:\"Joel plays ____.\"}\n\t\t# 977: {active: 1, play: 1, text:",
"end": 84783,
"score": 0.7822403907775879,
"start": 84779,
"tag": "NAME",
"value": "Joel"
},
{
"context": ".\"}\n\t\t# 1017: {active: 1, play: 1, text:\"I'm sorry Timmy, but I must ____ you.\"}\n\t\t# 1018: {active: 1, pla",
"end": 88002,
"score": 0.9991445541381836,
"start": 87997,
"tag": "NAME",
"value": "Timmy"
},
{
"context": "damage!\"}\n\t\t# 1031: {active: 1, play: 1, text:\"But Beardman! Why do you think that ____?\"}\n\t\t# 1032: {active:",
"end": 89242,
"score": 0.7524095177650452,
"start": 89234,
"tag": "NAME",
"value": "Beardman"
},
{
"context": "_.\"}\n\t\t# 1033: {active: 1, play: 1, text:\"What did Criken do this time to break ARMA III? \"}\n\t\t# 1034: {",
"end": 89435,
"score": 0.6556350588798523,
"start": 89432,
"tag": "NAME",
"value": "Cri"
},
{
"context": "l?\"}\n\t\t# 1035: {active: 1, play: 1, text:\"What did Mitch or Bajan Canadian find in the fridge today?\"}\n\t\t#",
"end": 89637,
"score": 0.923302412033081,
"start": 89632,
"tag": "NAME",
"value": "Mitch"
},
{
"context": "1035: {active: 1, play: 1, text:\"What did Mitch or Bajan Canadian find in the fridge today?\"}\n\t\t# 1036: {active: 1,",
"end": 89655,
"score": 0.881428062915802,
"start": 89641,
"tag": "NAME",
"value": "Bajan Canadian"
},
{
"context": "Trust.\"}\n\t\t# 1037: {active: 1, play: 1, text:\"When Sp00n finally removed his horsemask on the livestream, ",
"end": 89788,
"score": 0.6769965291023254,
"start": 89783,
"tag": "NAME",
"value": "Sp00n"
},
{
"context": "_.\"}\n\t\t# 1039: {active: 1, play: 1, text:\"What did Pewdiepie overreact to on his channel today?\"}\n\t\t# 1040: {a",
"end": 89982,
"score": 0.9555139541625977,
"start": 89973,
"tag": "NAME",
"value": "Pewdiepie"
},
{
"context": "\t# 1042: {active: 1, play: 1, text:\"Last Thursday, Riorach was identified in public and she proceeded to ___",
"end": 90278,
"score": 0.9974473118782043,
"start": 90271,
"tag": "NAME",
"value": "Riorach"
},
{
"context": "ets weird?\"}\n\t\t# 1059: {active: 1, play: 1, text:\"Wes Anderson's new film tells the story of a precocious child ",
"end": 91876,
"score": 0.9974309206008911,
"start": 91864,
"tag": "NAME",
"value": "Wes Anderson"
},
{
"context": "}\n\t\t# 1064: {active: 1, play: 1, text:\"Dear Leader Kim Jong-un, our village praises your infinite wisdom with a ",
"end": 92447,
"score": 0.9980255365371704,
"start": 92436,
"tag": "NAME",
"value": "Kim Jong-un"
},
{
"context": "ds a ____.\"}\n\t\t# 1137: {active: 1, play: 1, text:\"Justin Bieber is a ____.\"}\n\t\t# 1138: {active: 1, play: 1, text:",
"end": 99172,
"score": 0.9998759031295776,
"start": 99159,
"tag": "NAME",
"value": "Justin Bieber"
},
{
"context": ", ____ it!\"}\n\t\t# 1152: {active: 1, play: 1, text:\"Steven Moffat has no ____. \"}\n\t\t# 1153: {active: 1, play: 1, te",
"end": 100221,
"score": 0.9996699094772339,
"start": 100208,
"tag": "NAME",
"value": "Steven Moffat"
},
{
"context": " no ____. \"}\n\t\t# 1153: {active: 1, play: 1, text:\"Dobby is ____!!\"}\n\t\t# 1154: {active: 1, play: 3, text:\"",
"end": 100280,
"score": 0.9991873502731323,
"start": 100275,
"tag": "NAME",
"value": "Dobby"
},
{
"context": "\"}\n\t\t# 1191: {active: 1, play: 1, text:\"Next up: Lord Lysander's paints ____.\"}\n\t\t# 1192: {active: 1, p",
"end": 103555,
"score": 0.5013161897659302,
"start": 103552,
"tag": "NAME",
"value": "ord"
},
{
"context": "# 1191: {active: 1, play: 1, text:\"Next up: Lord Lysander's paints ____.\"}\n\t\t# 1192: {active: 1, play:",
"end": 103559,
"score": 0.634046733379364,
"start": 103557,
"tag": "NAME",
"value": "ys"
},
{
"context": "ay: 1, text:\"After throwing ____ at Karkat's head, Dave made the intriguing discover that troll horns are",
"end": 112894,
"score": 0.9970901012420654,
"start": 112890,
"tag": "NAME",
"value": "Dave"
},
{
"context": "r is ____.\"}\n\t\t# 1304: {active: 1, play: 1, text:\"Dave Strider likes ____, but only ironically.\"}\n\t\t# 1305: {act",
"end": 113330,
"score": 0.9854764342308044,
"start": 113318,
"tag": "NAME",
"value": "Dave Strider"
},
{
"context": "s ____.\"}\n\t\t# 1307: {active: 1, play: 1, text:\"For Betty Crocker's latest ad campaign/brainwashing scheme, she is ",
"end": 113559,
"score": 0.9788405299186707,
"start": 113546,
"tag": "NAME",
"value": "Betty Crocker"
},
{
"context": "1308: {active: 1, play: 1, text:\"For his birthday, Dave gave John ____.\"}\n\t\t# 1309: {active: 1, play: 1, ",
"end": 113697,
"score": 0.9980508089065552,
"start": 113693,
"tag": "NAME",
"value": "Dave"
},
{
"context": "ive: 1, play: 1, text:\"For his birthday, Dave gave John ____.\"}\n\t\t# 1309: {active: 1, play: 1, text:\"Fuck",
"end": 113707,
"score": 0.9991096258163452,
"start": 113703,
"tag": "NAME",
"value": "John"
},
{
"context": "they work?\"}\n\t\t# 1310: {active: 1, play: 1, text:\"Gamzee not only likes using his clubs for juggling and s",
"end": 113830,
"score": 0.9947776794433594,
"start": 113824,
"tag": "NAME",
"value": "Gamzee"
},
{
"context": "hout ____?\"}\n\t\t# 1313: {active: 1, play: 2, text:\"Hussie died on his quest bed and rose as the fully reali",
"end": 114116,
"score": 0.9541740417480469,
"start": 114110,
"tag": "NAME",
"value": "Hussie"
},
{
"context": "_ of ____.\"}\n\t\t# 1314: {active: 1, play: 2, text:\"Hussie unintentionally revealed that Homestuck will",
"end": 114224,
"score": 0.7868183851242065,
"start": 114223,
"tag": "NAME",
"value": "H"
},
{
"context": " ____.\"}\n\t\t# 1314: {active: 1, play: 2, text:\"Hussie unintentionally revealed that Homestuck will end ",
"end": 114229,
"score": 0.7329780459403992,
"start": 114227,
"tag": "NAME",
"value": "ie"
},
{
"context": "9: {active: 1, play: 1, text:\"In the final battle, John distracts Lord English by showing him ____.\"}\n\t\t#",
"end": 114763,
"score": 0.9980899095535278,
"start": 114759,
"tag": "NAME",
"value": "John"
},
{
"context": "derstands.\"}\n\t\t# 1321: {active: 1, play: 1, text:\"John is a good boy. And he loves ____.\"}\n\t\t# 1322: {ac",
"end": 114947,
"score": 0.999219536781311,
"start": 114943,
"tag": "NAME",
"value": "John"
},
{
"context": "oves ____.\"}\n\t\t# 1322: {active: 1, play: 1, text:\"John may not be a homosexual, but he has a serious thi",
"end": 115025,
"score": 0.9688764810562134,
"start": 115021,
"tag": "NAME",
"value": "John"
},
{
"context": "erse ____.\"}\n\t\t# 1326: {active: 1, play: 1, text:\"Latula and Porrin have decided to teach Kankri about the",
"end": 115394,
"score": 0.989004909992218,
"start": 115388,
"tag": "NAME",
"value": "Latula"
},
{
"context": "\"}\n\t\t# 1326: {active: 1, play: 1, text:\"Latula and Porrin have decided to teach Kankri about the wonders of",
"end": 115405,
"score": 0.9809634685516357,
"start": 115399,
"tag": "NAME",
"value": "Porrin"
},
{
"context": ": 1, text:\"Latula and Porrin have decided to teach Kankri about the wonders of ____.\"}\n\t\t# 1327: {active:",
"end": 115432,
"score": 0.6270642280578613,
"start": 115428,
"tag": "NAME",
"value": "Kank"
},
{
"context": "328: {active: 1, play: 1, text:\"Little known fact: Kurloz's stitching is actually made out of ____.\"}\n\t\t# 1",
"end": 115640,
"score": 0.9105413556098938,
"start": 115634,
"tag": "NAME",
"value": "Kurloz"
},
{
"context": "t of ____.\"}\n\t\t# 1329: {active: 1, play: 1, text:\"Nanna baked a cake for John to commemorate ____.\"}\n\t\t# ",
"end": 115727,
"score": 0.9954177141189575,
"start": 115722,
"tag": "NAME",
"value": "Nanna"
},
{
"context": " {active: 1, play: 1, text:\"Nanna baked a cake for John to commemorate ____.\"}\n\t\t# 1330: {active: 1, play",
"end": 115749,
"score": 0.9959110021591187,
"start": 115745,
"tag": "NAME",
"value": "John"
},
{
"context": "rate ____.\"}\n\t\t# 1330: {active: 1, play: 1, text:\"Nepeta only likes Karkat for his ____.\"}\n\t\t# 1331: {ac",
"end": 115814,
"score": 0.6757823824882507,
"start": 115810,
"tag": "NAME",
"value": "Nepe"
},
{
"context": "\t# 1332: {active: 1, play: 1, text:\"The next thing Hussie will turn into a sex joke will be ____.\"}\n\t\t",
"end": 115982,
"score": 0.8465805053710938,
"start": 115981,
"tag": "NAME",
"value": "H"
},
{
"context": "4: {active: 1, play: 1, text:\"The only way to beat Vriska in an eating contest is to put ____ on the table.",
"end": 116229,
"score": 0.8326134085655212,
"start": 116223,
"tag": "NAME",
"value": "Vriska"
},
{
"context": "the table.\"}\n\t\t# 1335: {active: 1, play: 1, text:\"Porrim made Kankri a sweater to cover his ____.\"}\n\t\t# 13",
"end": 116325,
"score": 0.9749813079833984,
"start": 116319,
"tag": "NAME",
"value": "Porrim"
},
{
"context": "}\n\t\t# 1335: {active: 1, play: 1, text:\"Porrim made Kankri a sweater to cover his ____.\"}\n\t\t# 1336: {active:",
"end": 116337,
"score": 0.9722683429718018,
"start": 116331,
"tag": "NAME",
"value": "Kankri"
},
{
"context": "__.\"}\n\t\t# 1336: {active: 1, play: 1, text:\"Problem Sleuth had a hard time investigating ____.\"}\n\t\t# 1337: {",
"end": 116420,
"score": 0.667833149433136,
"start": 116414,
"tag": "NAME",
"value": "Sleuth"
},
{
"context": "# 1337: {active: 1, play: 1, text:\"The real reason Terezi stabbed Vriska was to punish her for ____.\"}\n\t\t# ",
"end": 116518,
"score": 0.9475029110908508,
"start": 116512,
"tag": "NAME",
"value": "Terezi"
},
{
"context": ": 1, play: 1, text:\"The real reason Terezi stabbed Vriska was to punish her for ____.\"}\n\t\t# 1338: {active: ",
"end": 116533,
"score": 0.9815826416015625,
"start": 116527,
"tag": "NAME",
"value": "Vriska"
},
{
"context": "p of ____.\"}\n\t\t# 1340: {active: 1, play: 1, text:\"Terezi can top anyone except ____.\"}\n\t\t# 1341: {active",
"end": 116807,
"score": 0.5964325666427612,
"start": 116803,
"tag": "NAME",
"value": "Tere"
},
{
"context": "41: {active: 1, play: 1, text:\"The thing that made Kankri break his vow of celibacy was ____.\"}\n\t\t# 1342: {",
"end": 116903,
"score": 0.9346001744270325,
"start": 116897,
"tag": "NAME",
"value": "Kankri"
},
{
"context": "best idea.\"}\n\t\t# 1343: {active: 1, play: 1, text:\"Vriska killed Spidermom with ____.\"}\n\t\t# 1344: {active: ",
"end": 117090,
"score": 0.8116044998168945,
"start": 117084,
"tag": "NAME",
"value": "Vriska"
},
{
"context": "\t\t# 1343: {active: 1, play: 1, text:\"Vriska killed Spidermom with ____.\"}\n\t\t# 1344: {active: 1, play: 2",
"end": 117100,
"score": 0.6254025101661682,
"start": 117098,
"tag": "NAME",
"value": "Sp"
},
{
"context": "tive: 1, play: 2, text:\"Vriska roleplays ____ with Terezi as ____.\"}\n\t\t# 1345: {active: 1, play: 1, te",
"end": 117186,
"score": 0.5904325246810913,
"start": 117185,
"tag": "NAME",
"value": "T"
},
{
"context": "_.\"}\n\t\t# 1347: {active: 1, play: 1, text:\"What did Jake get Dirk for his birthday?\"}\n\t\t# 1348: {active: 1",
"end": 117386,
"score": 0.9735929369926453,
"start": 117382,
"tag": "NAME",
"value": "Jake"
},
{
"context": "ve: 1, play: 1, text:\"What is the worst thing that Terezi ever licked?\"}\n\t\t# 1349: {active: 1, play: 1, t",
"end": 117486,
"score": 0.8213651180267334,
"start": 117482,
"tag": "NAME",
"value": "Tere"
},
{
"context": "350: {active: 1, play: 1, text:\"What's in the box, Jack?\"}\n\t\t# 1351: {active: 1, play: 1, text:\"When a bu",
"end": 117642,
"score": 0.997212827205658,
"start": 117638,
"tag": "NAME",
"value": "Jack"
},
{
"context": " ____.\"}\n\t\t# 1352: {active: 1, play: 1, text:\"When Dave received ____ from his Bro for his 9th birthday, ",
"end": 117783,
"score": 0.9953054785728455,
"start": 117779,
"tag": "NAME",
"value": "Dave"
},
{
"context": "\n\t\t# 1355: {active: 1, play: 1, text:\"Your name is JOHN EGBERT and boy do you love ____!\"}\n\t\t# 1356: {active: 1,",
"end": 118115,
"score": 0.9998428821563721,
"start": 118104,
"tag": "NAME",
"value": "JOHN EGBERT"
},
{
"context": "t on ____.\"}\n\t\t# 1380: {active: 1, play: 1, text:\"Jack Harkness, I can't leave you alone for a minute! I turn aro",
"end": 120645,
"score": 0.9998486042022705,
"start": 120632,
"tag": "NAME",
"value": "Jack Harkness"
},
{
"context": "\t# 1386: {active: 1, play: 1, text:\"We found a map Charlie! A map to ____ Mountain!\"}\n\t\t# 1387: {active: 1, ",
"end": 121263,
"score": 0.9917511940002441,
"start": 121256,
"tag": "NAME",
"value": "Charlie"
},
{
"context": "what next?\"}\n\t\t# 1537: {active: 1, play: 1, text:\"Lena goes from Eurovision winner, to participant, to s",
"end": 133401,
"score": 0.9988821744918823,
"start": 133397,
"tag": "NAME",
"value": "Lena"
},
{
"context": "even ____.\"}\n\t\t# 1540: {active: 1, play: 1, text:\"Krista Siegfrids' chronic marrying spree added ____ to her victims",
"end": 133734,
"score": 0.9997847676277161,
"start": 133718,
"tag": "NAME",
"value": "Krista Siegfrids"
},
{
"context": "fans: ____\"}\n\t\t# 1543: {active: 1, play: 1, text:\"Johnny Logan is a man of many talents; he wins Eurovisions and",
"end": 134058,
"score": 0.9997506141662598,
"start": 134046,
"tag": "NAME",
"value": "Johnny Logan"
},
{
"context": "ard lyrics of Verjamem resulted in people thinking Eva Boto screeched ____.\"}\n\t\t# 1545: {active: 1, play",
"end": 134213,
"score": 0.8722225427627563,
"start": 134210,
"tag": "NAME",
"value": "Eva"
},
{
"context": ": 1, play: 1, text:\"Do you really expect ____? No, Mister Bond. I expect you to die!\"}\n\t\t# 1564: {active: 1, pla",
"end": 136008,
"score": 0.9770475625991821,
"start": 135997,
"tag": "NAME",
"value": "Mister Bond"
},
{
"context": "24: {active: 1, play: 1, text:\"If you need him to, Remy Danton can pull some strings and get you ____, but it'll",
"end": 141831,
"score": 0.9997886419296265,
"start": 141820,
"tag": "NAME",
"value": "Remy Danton"
},
{
"context": "____. Wow.\"}\n\t\t# 1630: {active: 1, play: 1, text:\"Siskel and Ebert have panned ____ as 'poorly conceived' ",
"end": 142347,
"score": 0.9269925951957703,
"start": 142341,
"tag": "NAME",
"value": "Siskel"
},
{
"context": "\"}\n\t\t# 1630: {active: 1, play: 1, text:\"Siskel and Ebert have panned ____ as 'poorly conceived' and 'slopp",
"end": 142357,
"score": 0.9477487802505493,
"start": 142352,
"tag": "NAME",
"value": "Ebert"
},
{
"context": "_.'\"}\n\t\t# 1632: {active: 1, play: 1, text:\"How did Stella get her groove back?\"}\n\t\t# 1633: {active: 1, play",
"end": 142564,
"score": 0.9845532178878784,
"start": 142558,
"tag": "NAME",
"value": "Stella"
},
{
"context": "633: {active: 1, play: 1, text:\"Believe it or not, Jim Carrey can do a dead-on impression of ____.\"}\n\t\t# 1634: ",
"end": 142654,
"score": 0.9979694485664368,
"start": 142644,
"tag": "NAME",
"value": "Jim Carrey"
},
{
"context": " is there.\"}\n\t\t# 1650: {active: 1, play: 1, text:\"Bob Ross's little-known first show was called 'The Joy of ",
"end": 144186,
"score": 0.9995176196098328,
"start": 144178,
"tag": "NAME",
"value": "Bob Ross"
},
{
"context": "ed ____.\"}\n\t\t# 1652: {active: 1, play: 2, text:\"In M. Night Shyamalan's new movie, Bruce Willis discovers that ____ had",
"end": 144401,
"score": 0.9871350526809692,
"start": 144383,
"tag": "NAME",
"value": "M. Night Shyamalan"
},
{
"context": " play: 2, text:\"In M. Night Shyamalan's new movie, Bruce Willis discovers that ____ had really been ____ all alon",
"end": 144427,
"score": 0.9996654391288757,
"start": 144415,
"tag": "NAME",
"value": "Bruce Willis"
},
{
"context": "long.\"}\n\t\t# 1653: {active: 1, play: 1, text:\"After Hurricane Katrina, Sean Penn brought ____ to all the people of New ",
"end": 144542,
"score": 0.9972453117370605,
"start": 144525,
"tag": "NAME",
"value": "Hurricane Katrina"
},
{
"context": "active: 1, play: 1, text:\"After Hurricane Katrina, Sean Penn brought ____ to all the people of New Orleans.\"}\n",
"end": 144553,
"score": 0.9929794669151306,
"start": 144544,
"tag": "NAME",
"value": "Sean Penn"
},
{
"context": "w Orleans.\"}\n\t\t# 1654: {active: 1, play: 2, text:\"Michael Bay's new three-hour action epic pits ____ against __",
"end": 144651,
"score": 0.996620237827301,
"start": 144640,
"tag": "NAME",
"value": "Michael Bay"
},
{
"context": "inst ____.\"}\n\t\t# 1655: {active: 1, play: 1, text:\"Keith Richards enjoys ____ on his food.\"}\n\t\t# 1656: {active: 1, ",
"end": 144758,
"score": 0.9991487264633179,
"start": 144744,
"tag": "NAME",
"value": "Keith Richards"
},
{
"context": "ve: 1, play: 1, text:\"My new favorite porn star is Joey '____' McGee.\"}\n\t\t# 1657: {active: 1, play: 1, te",
"end": 144856,
"score": 0.9988223314285278,
"start": 144852,
"tag": "NAME",
"value": "Joey"
},
{
"context": " 1, text:\"My new favorite porn star is Joey '____' McGee.\"}\n\t\t# 1657: {active: 1, play: 1, text:\"In his ne",
"end": 144869,
"score": 0.9984230995178223,
"start": 144864,
"tag": "NAME",
"value": "McGee"
},
{
"context": ": 1, text:\"In his newest and most difficult stunt, David Blaine must escape from ____.\"}\n\t\t# 1658: {active: 1, pl",
"end": 144962,
"score": 0.9994885325431824,
"start": 144950,
"tag": "NAME",
"value": "David Blaine"
},
{
"context": " 1658: {active: 1, play: 1, text:\"Little Miss Muffet Sat on a tuffet, Eating her curds and ____.\"}\n\t\t#",
"end": 145043,
"score": 0.5536196827888489,
"start": 145041,
"tag": "NAME",
"value": "et"
},
{
"context": "d of ____.\"}\n\t\t# 1660: {active: 1, play: 1, text:\"Charades was ruined for me forever when my mom had to act ",
"end": 145220,
"score": 0.9972213506698608,
"start": 145212,
"tag": "NAME",
"value": "Charades"
},
{
"context": ": {active: 1, play: 1, text:\"After the earthquake, Sean Penn brought ____ to the people of Haiti.\"}\n\t\t# 1662: ",
"end": 145350,
"score": 0.9985233545303345,
"start": 145341,
"tag": "NAME",
"value": "Sean Penn"
},
{
"context": "2: {active: 1, play: 1, text:\"This holiday season, Tim Allen must overcome his fear of ____ to save Christmas.",
"end": 145457,
"score": 0.999461829662323,
"start": 145448,
"tag": "NAME",
"value": "Tim Allen"
},
{
"context": "Christmas.\"}\n\t\t# 1663: {active: 1, play: 1, text:\"Jesus is ____.\"}\n\t\t# 1664: {active: 1, play: 1, text:\"D",
"end": 145552,
"score": 0.9923572540283203,
"start": 145547,
"tag": "NAME",
"value": "Jesus"
},
{
"context": "{active: 1, play: 1, text:\"Call the law offices of Goldstein & Goldstein, because no one should have to t",
"end": 146692,
"score": 0.5763624906539917,
"start": 146688,
"tag": "NAME",
"value": "Gold"
},
{
"context": ", play: 1, text:\"To prepare for his upcoming role, Daniel Day-Lewis immersed himself in the world of ____.\"}\n\t\t# 1678",
"end": 146862,
"score": 0.9991790652275085,
"start": 146846,
"tag": "NAME",
"value": "Daniel Day-Lewis"
},
{
"context": "e: 1, play: 1, text:\"As part of his daily regimen, Anderson Cooper sets aside 15 minutes for ____.\"}\n\t\t# 1679: {acti",
"end": 146986,
"score": 0.9991511702537537,
"start": 146971,
"tag": "NAME",
"value": "Anderson Cooper"
},
{
"context": " ____.\"}\n\t\t# 1687: {active: 1, play: 1, text:\"Dear Abby, I'm having some trouble with ____ and would like",
"end": 147763,
"score": 0.9914239645004272,
"start": 147759,
"tag": "NAME",
"value": "Abby"
},
{
"context": ":\"Northernlion's latest novelty Twitter account is @____.\"}\n\t\t# 1696: {active: 1, play: 1, text:\"Northernl",
"end": 148519,
"score": 0.8000525236129761,
"start": 148514,
"tag": "USERNAME",
"value": "@____"
},
{
"context": " is @____.\"}\n\t\t# 1696: {active: 1, play: 1, text:\"Northernlion has been facing ridicule for calling ____ a rogue",
"end": 148572,
"score": 0.661444902420044,
"start": 148560,
"tag": "NAME",
"value": "Northernlion"
},
{
"context": "ogue-like.\"}\n\t\t# 1697: {active: 1, play: 1, text:\"Northernlion always forgets the name of ____.\"}\n\t\t# 1698: {act",
"end": 148680,
"score": 0.7650307416915894,
"start": 148668,
"tag": "NAME",
"value": "Northernlion"
},
{
"context": "e of ____.\"}\n\t\t# 1698: {active: 1, play: 1, text:\"Northernlion's refusal to Let's Play ____ was probably a good ",
"end": 148765,
"score": 0.7102874517440796,
"start": 148753,
"tag": "NAME",
"value": "Northernlion"
},
{
"context": " {active: 1, play: 1, text:\"Of all the things that Ryan and Josh have in common, they bond together throu",
"end": 148887,
"score": 0.9951143264770508,
"start": 148883,
"tag": "NAME",
"value": "Ryan"
},
{
"context": " 1, play: 1, text:\"Of all the things that Ryan and Josh have in common, they bond together through their ",
"end": 148896,
"score": 0.9835495948791504,
"start": 148892,
"tag": "NAME",
"value": "Josh"
},
{
"context": ".\"}\n\t\t# 1701: {active: 1, play: 1, text:\"One thing Northernlion was right about was ____.\"}\n\t\t# 1702: {active: 1,",
"end": 149111,
"score": 0.9215788841247559,
"start": 149099,
"tag": "NAME",
"value": "Northernlion"
},
{
"context": ".\"}\n\t\t# 1702: {active: 1, play: 1, text:\"Recently, Northernlion has felt woefully insecure due to ____.\"}\n\t\t# ",
"end": 149196,
"score": 0.7137739658355713,
"start": 149187,
"tag": "NAME",
"value": "Northernl"
},
{
"context": "inal boss.\"}\n\t\t# 1723: {active: 1, play: 1, text:\"Dustin Browder demands more ____ in StarCraft®.\"}\n\t\t# 1724: ",
"end": 151158,
"score": 0.9997084736824036,
"start": 151144,
"tag": "NAME",
"value": "Dustin Browder"
},
{
"context": ": 1, play: 1, text:\"An intervention was staged for Linkara after ____ was discovered in his hat.\"}\n\t\t# 17",
"end": 153716,
"score": 0.5126527547836304,
"start": 153712,
"tag": "NAME",
"value": "Link"
},
{
"context": "n his hat.\"}\n\t\t# 1750: {active: 1, play: 1, text:\"Linkara was shocked when he found out Insano was secre",
"end": 153801,
"score": 0.5142399668693542,
"start": 153797,
"tag": "NAME",
"value": "Link"
},
{
"context": ": {active: 1, play: 1, text:\"During his childhood, Salvador Dalí produced hundreds of paintings of ____.\"}",
"end": 154115,
"score": 0.9550507664680481,
"start": 154103,
"tag": "NAME",
"value": "Salvador Dal"
},
{
"context": "1754: {active: 1, play: 2, text:\"Rumor has it that Vladimir Putin's favorite delicacy is ____ stuffed with ____.\"}\n",
"end": 154235,
"score": 0.9391735196113586,
"start": 154221,
"tag": "NAME",
"value": "Vladimir Putin"
},
{
"context": "p as ____.\"}\n\t\t# 1759: {active: 1, play: 1, text:\"Brad Tries ____.\"}\n\t\t# 1760: {active: 1, play: 1, text",
"end": 154727,
"score": 0.8318988084793091,
"start": 154723,
"tag": "NAME",
"value": "Brad"
},
{
"context": " Game?\"}\n\t\t# 1763: {active: 1, play: 1, text:\"When Barta isn't talking he's ____.\"}\n\t\t# 1764: {active: 1, ",
"end": 155131,
"score": 0.8408650159835815,
"start": 155126,
"tag": "NAME",
"value": "Barta"
},
{
"context": "he's ____.\"}\n\t\t# 1764: {active: 1, play: 1, text:\"Hayao Miyazaki's latest family film is about a young boy befrien",
"end": 155210,
"score": 0.9229674339294434,
"start": 155196,
"tag": "NAME",
"value": "Hayao Miyazaki"
},
{
"context": " 1768: {active: 1, play: 1, text:\"At the last PAX, Paul and Storm had ____ thrown at them during 'Opening",
"end": 155642,
"score": 0.9833285212516785,
"start": 155638,
"tag": "NAME",
"value": "Paul"
},
{
"context": "ctive: 1, play: 1, text:\"At the last PAX, Paul and Storm had ____ thrown at them during 'Opening Band'.\"}\n",
"end": 155652,
"score": 0.8825041651725769,
"start": 155647,
"tag": "NAME",
"value": "Storm"
},
{
"context": "1770: {active: 1, play: 1, text:\"The RDA chat knew Nash was trolling them when he played ____.\"}\n\t\t# 1771",
"end": 155850,
"score": 0.8587697744369507,
"start": 155846,
"tag": "NAME",
"value": "Nash"
},
{
"context": "with ____.\"}\n\t\t# 1773: {active: 1, play: 1, text:\"Connie the Condor often doesn't talk on skype because of",
"end": 156185,
"score": 0.6823342442512512,
"start": 156179,
"tag": "NAME",
"value": "Connie"
},
{
"context": "e of ____.\"}\n\t\t# 1774: {active: 1, play: 1, text:\"Jorgi the Corgi most definitely enjoys ____.\"}\n\t\t# 1775: {a",
"end": 156290,
"score": 0.7465177774429321,
"start": 156281,
"tag": "NAME",
"value": "Jorgi the"
},
{
"context": "}\n\t\t# 1774: {active: 1, play: 1, text:\"Jorgi the Corgi most definitely enjoys ____.\"}\n\t\t# 1775: {active",
"end": 156295,
"score": 0.6646924614906311,
"start": 156292,
"tag": "NAME",
"value": "org"
},
{
"context": "__.\"}\n\t\t# 1775: {active: 1, play: 1, text:\"It's DJ Manny in the hizouse, playing ____ all night long!\"}\n\t\t",
"end": 156378,
"score": 0.7697741985321045,
"start": 156373,
"tag": "NAME",
"value": "Manny"
},
{
"context": "\t\t# 1776: {active: 1, play: 2, text:\"____ + ____ = Golby.\"}\n\t\t# 1777: {active: 1, play: 1, text:\"____ was ",
"end": 156482,
"score": 0.6526878476142883,
"start": 156477,
"tag": "NAME",
"value": "Golby"
},
{
"context": "\"}\n\t\t# 1778: {active: 1, play: 1, text:\"What broke Nash this week?\"}\n\t\t# 1779: {active: 1, play: 1, text:",
"end": 156640,
"score": 0.8164129257202148,
"start": 156636,
"tag": "NAME",
"value": "Nash"
},
{
"context": "1, play: 1, text:\"To troll the RDA chat this time, Todd requested a song by ____.\"}\n\t\t# 1783: {active: 1,",
"end": 157035,
"score": 0.9090043902397156,
"start": 157031,
"tag": "NAME",
"value": "Todd"
},
{
"context": "g by ____.\"}\n\t\t# 1783: {active: 1, play: 1, text:\"Todd knew he didn't have a chance after trying to sedu",
"end": 157105,
"score": 0.8555126190185547,
"start": 157101,
"tag": "NAME",
"value": "Todd"
},
{
"context": "ctive: 1, play: 1, text:\"Viewers were shocked when Paw declared ____ the best song of the movie.\"}\n\t\t#",
"end": 157335,
"score": 0.5527144074440002,
"start": 157334,
"tag": "NAME",
"value": "P"
},
{
"context": ".\"}\n\t\t# 1787: {active: 1, play: 1, text:\"What does Nash like to sing about?\"}\n\t\t# 1788: {active: 1, play:",
"end": 157542,
"score": 0.8390299081802368,
"start": 157538,
"tag": "NAME",
"value": "Nash"
},
{
"context": "?\"}\n\t\t# 1788: {active: 1, play: 1, text:\"What does Todd look like under his mask?\"}\n\t\t# 1789: {active: 1,",
"end": 157616,
"score": 0.9990218877792358,
"start": 157612,
"tag": "NAME",
"value": "Todd"
},
{
"context": "?\"}\n\t\t# 1789: {active: 1, play: 1, text:\"What will Tara name her next hippo?\"}\n\t\t# 1790: {active: 1, play",
"end": 157696,
"score": 0.9981517791748047,
"start": 157692,
"tag": "NAME",
"value": "Tara"
},
{
"context": "__!\"}\n\t\t# 1798: {active: 1, play: 1, text:\"What do Brad and Floyd like to do after a long day?\"}\n\t\t# 1799",
"end": 158647,
"score": 0.9995859861373901,
"start": 158643,
"tag": "NAME",
"value": "Brad"
},
{
"context": " 1798: {active: 1, play: 1, text:\"What do Brad and Floyd like to do after a long day?\"}\n\t\t# 1799: {active:",
"end": 158657,
"score": 0.9977278113365173,
"start": 158652,
"tag": "NAME",
"value": "Floyd"
},
{
"context": "ve: 1, play: 3, text:\"In this episode of Master Keaton, Keaton builds ____ out of ____ and ____.\"}\n\t\t# 1",
"end": 158974,
"score": 0.7293980717658997,
"start": 158970,
"tag": "NAME",
"value": "aton"
},
{
"context": "02: {active: 1, play: 1, text:\"So just who is this Henry Goto fellow, anyway?\"}\n\t\t# 1803: {active: 1, play: 1, ",
"end": 159086,
"score": 0.9974788427352905,
"start": 159076,
"tag": "NAME",
"value": "Henry Goto"
},
{
"context": "nyway?\"}\n\t\t# 1803: {active: 1, play: 1, text:\"When Henry Goto is alone and thinks that no one's looking, he sec",
"end": 159157,
"score": 0.9979536533355713,
"start": 159147,
"tag": "NAME",
"value": "Henry Goto"
},
{
"context": ": {active: 1, play: 1, text:\"In her newest review, Diamanda Hagan finds herself in the body of ____.\"}\n\t\t# 1805: {a",
"end": 159301,
"score": 0.9985195994377136,
"start": 159287,
"tag": "NAME",
"value": "Diamanda Hagan"
},
{
"context": "y of ____.\"}\n\t\t# 1805: {active: 1, play: 1, text:\"Madoka Kyouno's nickname for Muginami's older brother is ____.\"",
"end": 159389,
"score": 0.9980661869049072,
"start": 159376,
"tag": "NAME",
"value": "Madoka Kyouno"
},
{
"context": "ve: 1, play: 1, text:\"Madoka Kyouno's nickname for Muginami's older brother is ____.\"}\n\t\t# 1806: {active: 1, ",
"end": 159413,
"score": 0.8806717991828918,
"start": 159405,
"tag": "NAME",
"value": "Muginami"
},
{
"context": "\t# 1807: {active: 1, play: 1, text:\"Every Morning, Princess Celestia Rises ____.\"}\n\t\t# 1808: {active: 1, play: 1, text",
"end": 159602,
"score": 0.9818533658981323,
"start": 159585,
"tag": "NAME",
"value": "Princess Celestia"
},
{
"context": "ises ____.\"}\n\t\t# 1808: {active: 1, play: 1, text:\"Lauren Faust was shocked to find ____ in her mailbox.\"}\n\t\t# 18",
"end": 159666,
"score": 0.9990628957748413,
"start": 159654,
"tag": "NAME",
"value": "Lauren Faust"
},
{
"context": "r mailbox.\"}\n\t\t# 1809: {active: 1, play: 1, text:\"Luna didn't help in the fight against Chrysalis becaus",
"end": 159751,
"score": 0.9476882219314575,
"start": 159747,
"tag": "NAME",
"value": "Luna"
},
{
"context": "ctive: 1, play: 1, text:\"Not many people know that Tara Strong is also the voice of ____.\"}\n\t\t# 1811: {active: 1",
"end": 159907,
"score": 0.9414590001106262,
"start": 159896,
"tag": "NAME",
"value": "Tara Strong"
},
{
"context": "1812: {active: 1, play: 3, text:\"In a fit of rage, Princess Celestia sent ____ to the ____ for ____.\"}\n\t\t# 18",
"end": 160111,
"score": 0.7893426418304443,
"start": 160103,
"tag": "NAME",
"value": "Princess"
},
{
"context": " 1, play: 3, text:\"In a fit of rage, Princess Celestia sent ____ to the ____ for ____.\"}\n\t\t# 1813: {acti",
"end": 160120,
"score": 0.6587220430374146,
"start": 160116,
"tag": "NAME",
"value": "stia"
},
{
"context": " for ____.\"}\n\t\t# 1813: {active: 1, play: 1, text:\"Ponyville was shocked to discover ____ in Fluttershy's",
"end": 160196,
"score": 0.7714598178863525,
"start": 160192,
"tag": "NAME",
"value": "Pony"
},
{
"context": "tive: 1, play: 2, text:\"The worst mishap caused by Princess Cadance was when she made ____ and ____ fall in love.\"}\n\t",
"end": 161101,
"score": 0.6432250142097473,
"start": 161085,
"tag": "NAME",
"value": "Princess Cadance"
},
{
"context": "4: {active: 1, play: 1, text:\"To much controversy, Princess Celestia made ____ illegal.\"}\n\t\t# 1825: {active: 1, play: ",
"end": 161225,
"score": 0.7316735982894897,
"start": 161208,
"tag": "NAME",
"value": "Princess Celestia"
},
{
"context": "gal.\"}\n\t\t# 1825: {active: 1, play: 2, text:\"Today, Mayor Mare announced her official campaign position on ____ ",
"end": 161301,
"score": 0.9746987223625183,
"start": 161291,
"tag": "NAME",
"value": "Mayor Mare"
},
{
"context": "o admit.\"}\n\t\t# 1828: {active: 1, play: 1, text:\"If Gordon Freeman spoke, what would he talk about?\"}\n\t\t# 1829: {act",
"end": 161687,
"score": 0.9994502663612366,
"start": 161673,
"tag": "NAME",
"value": "Gordon Freeman"
},
{
"context": "t?\"}\n\t\t# 1829: {active: 1, play: 1, text:\"Wake up, Mr. Freeman. Wake up and ____.\"}\n\t\t# 1830: {active: 1, play: ",
"end": 161780,
"score": 0.9294509887695312,
"start": 161769,
"tag": "NAME",
"value": "Mr. Freeman"
},
{
"context": " way of apologizing for a poorly received episode, E Rod promised to review ____.\"}\n\t\t# 1833: {active: 1, ",
"end": 162120,
"score": 0.89497971534729,
"start": 162115,
"tag": "NAME",
"value": "E Rod"
},
{
"context": "view ____.\"}\n\t\t# 1833: {active: 1, play: 1, text:\"E Rod has a new dance move called ____.\"}\n\t\t# 1834: {ac",
"end": 162190,
"score": 0.699659526348114,
"start": 162185,
"tag": "NAME",
"value": "E Rod"
},
{
"context": " ____.\"}\n\t\t# 1834: {active: 1, play: 1, text:\"Even Kyle thinks ____ is pretentious.\"}\n\t\t# 1835: {active: ",
"end": 162273,
"score": 0.7130349278450012,
"start": 162269,
"tag": "NAME",
"value": "Kyle"
},
{
"context": "\t\t# 1836: {active: 1, play: 1, text:\"Hey kids, I'm Nash, and I couldn't make ____ up if I tried.\"}\n\t\t# 18",
"end": 162418,
"score": 0.9988842010498047,
"start": 162414,
"tag": "NAME",
"value": "Nash"
},
{
"context": " tried.\"}\n\t\t# 1837: {active: 1, play: 1, text:\"Hey Nash, whatcha playin'?\"}\n\t\t# 1838: {active: 1, play: 1",
"end": 162507,
"score": 0.9872835874557495,
"start": 162503,
"tag": "NAME",
"value": "Nash"
},
{
"context": "in'?\"}\n\t\t# 1838: {active: 1, play: 1, text:\"How is Bennett going to creep out Ask That Guy this time? \"}\n\t\t#",
"end": 162579,
"score": 0.9916911125183105,
"start": 162572,
"tag": "NAME",
"value": "Bennett"
},
{
"context": " 1, play: 1, text:\"In his most recent Avatar vlog, Doug's favorite thing about the episode was ____.\"}\n\t\t",
"end": 162699,
"score": 0.6315709948539734,
"start": 162695,
"tag": "NAME",
"value": "Doug"
},
{
"context": "n of ____.\"}\n\t\t# 1841: {active: 1, play: 1, text:\"Leon Thomas almost named his show Renegade ____.\"}\n\t\t# 1842: ",
"end": 162913,
"score": 0.8999693989753723,
"start": 162902,
"tag": "NAME",
"value": "Leon Thomas"
},
{
"context": ", play: 1, text:\"Leon Thomas almost named his show Renegade ____.\"}\n\t\t# 1842: {active: 1, play: 1, tex",
"end": 162937,
"score": 0.71739661693573,
"start": 162936,
"tag": "NAME",
"value": "R"
},
{
"context": "gade ____.\"}\n\t\t# 1842: {active: 1, play: 1, text:\"Luke Mochrie proved he was still part of the site by____.\"}\n\t\t",
"end": 163002,
"score": 0.9976257085800171,
"start": 162990,
"tag": "NAME",
"value": "Luke Mochrie"
},
{
"context": "_.\"}\n\t\t# 1846: {active: 1, play: 1, text:\"What did Doug bring to the set of To Boldly Flee?\"}\n\t\t# 1847",
"end": 163401,
"score": 0.6770288944244385,
"start": 163400,
"tag": "NAME",
"value": "D"
},
{
"context": "ammer?\"}\n\t\t# 1852: {active: 1, play: 1, text:\"When Arlo The Orc turns into a werewolf, he likes to snack on _",
"end": 163919,
"score": 0.7072014808654785,
"start": 163911,
"tag": "NAME",
"value": "Arlo The"
},
{
"context": "1854: {active: 1, play: 1, text:\"Who REALLY called Oancitizen to help him snap out of his ennui?\"}\n\t\t# 1855: {a",
"end": 164162,
"score": 0.9699789881706238,
"start": 164152,
"tag": "NAME",
"value": "Oancitizen"
},
{
"context": "\t\t# 1855: {active: 1, play: 1, text:\"Whose ass did Zodann kick this time?\"}\n\t\t# 1856: {active: 1, play: 1, ",
"end": 164257,
"score": 0.8648038506507874,
"start": 164251,
"tag": "NAME",
"value": "Zodann"
},
{
"context": "me?\"}\n\t\t# 1856: {active: 1, play: 1, text:\"Why did Nash go to Chicago?\"}\n\t\t# 1857: {active: 1, play: 1, t",
"end": 164325,
"score": 0.8662042617797852,
"start": 164321,
"tag": "NAME",
"value": "Nash"
},
{
"context": "}\n\t\t# 1857: {active: 1, play: 1, text:\"Why doesn't Doug ever attend MAGFest?\"}\n\t\t# 1858: {active: 1, play",
"end": 164396,
"score": 0.7720934748649597,
"start": 164392,
"tag": "NAME",
"value": "Doug"
},
{
"context": "}\n\t\t# 1858: {active: 1, play: 1, text:\"Why doesn't Film Brain have an actual reviewer costume?\"}\n\t\t# 185",
"end": 164472,
"score": 0.8576397895812988,
"start": 164469,
"tag": "NAME",
"value": "Fil"
},
{
"context": "{active: 1, play: 2, text:\"For a late night snack, Nash made a sandwich of ____ and ____.\"}\n\t\t# 1861: {ac",
"end": 164688,
"score": 0.9120866656303406,
"start": 164684,
"tag": "NAME",
"value": "Nash"
},
{
"context": "ey.\"}\n\t\t# 1865: {active: 1, play: 1, text:\"Krazy Mike lost to ____!\"}\n\t\t# 1866: {active: 1, play: 1, te",
"end": 165114,
"score": 0.5508601069450378,
"start": 165111,
"tag": "NAME",
"value": "ike"
},
{
"context": "6: {active: 1, play: 1, text:\"What would you do if Ohm really did just die?\"}\n\t\t# 1867: {active: 1, pl",
"end": 165190,
"score": 0.7751743793487549,
"start": 165189,
"tag": "NAME",
"value": "O"
},
{
"context": "___.\"}\n\t\t# 1868: {active: 1, play: 1, text:\"Follow MichaelALFox on Twitter and you can see pictures of ____.\"}\n\t\t",
"end": 165382,
"score": 0.9959797859191895,
"start": 165370,
"tag": "USERNAME",
"value": "MichaelALFox"
},
{
"context": "\"}\n\t\t# 1870: {active: 1, play: 1, text:\"What would Ohm do?\"}\n\t\t# 1871: {active: 1, play: 1, text:\"Nort",
"end": 165577,
"score": 0.9134313464164734,
"start": 165576,
"tag": "NAME",
"value": "O"
},
{
"context": ".\"}\n\t\t# 1872: {active: 1, play: 1, text:\"What gave Ohmwrecker his gaming powers?\"}\n\t\t# 1873: {active: 1,",
"end": 165736,
"score": 0.7301136255264282,
"start": 165733,
"tag": "NAME",
"value": "Ohm"
},
{
"context": "\t# 1872: {active: 1, play: 1, text:\"What gave Ohmwrecker his gaming powers?\"}\n\t\t# 1873: {active: 1, pl",
"end": 165739,
"score": 0.5038789510726929,
"start": 165737,
"tag": "NAME",
"value": "re"
},
{
"context": "that Green9090 is ____, but we must all admit that Ohm is better at ____\"}\n\t\t# 1874: {active: 1, play:",
"end": 165864,
"score": 0.8065009713172913,
"start": 165863,
"tag": "NAME",
"value": "O"
},
{
"context": " 1, play: 2, text:\"After winning yet another race, Josh made ____ tweet about ____.\"}\n\t\t# 1876: {active: ",
"end": 166055,
"score": 0.8678028583526611,
"start": 166051,
"tag": "NAME",
"value": "Josh"
},
{
"context": "ns?\"}\n\t\t# 1877: {active: 1, play: 1, text:\"What do Mumbo's magic words mean?\"}\n\t\t# 1878: {active: 1, p",
"end": 166206,
"score": 0.8015574216842651,
"start": 166205,
"tag": "NAME",
"value": "M"
},
{
"context": " {active: 1, play: 1, text:\"What's the real reason Jon left?\"}\n\t\t# 1880: {active: 1, play: 1, text:\"Who ",
"end": 166369,
"score": 0.9806950092315674,
"start": 166366,
"tag": "NAME",
"value": "Jon"
},
{
"context": "\n\t\t# 1880: {active: 1, play: 1, text:\"Who replaced Jon when he left GameGrumps?\"}\n\t\t# 1881: {active: 1, ",
"end": 166431,
"score": 0.9926637411117554,
"start": 166428,
"tag": "NAME",
"value": "Jon"
},
{
"context": "mps, ____!\"}\n\t\t# 1885: {active: 1, play: 1, text:\"Jon and Arin suck at ____.\"}\n\t\t# 1886: {active: 1, pl",
"end": 166811,
"score": 0.9997338652610779,
"start": 166808,
"tag": "NAME",
"value": "Jon"
},
{
"context": "__!\"}\n\t\t# 1885: {active: 1, play: 1, text:\"Jon and Arin suck at ____.\"}\n\t\t# 1886: {active: 1, play: 1, te",
"end": 166820,
"score": 0.9936604499816895,
"start": 166816,
"tag": "NAME",
"value": "Arin"
},
{
"context": "k at ____.\"}\n\t\t# 1886: {active: 1, play: 1, text:\"Jon and Arin win! They realize ____ is more important",
"end": 166877,
"score": 0.9997273087501526,
"start": 166874,
"tag": "NAME",
"value": "Jon"
},
{
"context": "__.\"}\n\t\t# 1886: {active: 1, play: 1, text:\"Jon and Arin win! They realize ____ is more important.\"}\n\t\t# 1",
"end": 166886,
"score": 0.9972069263458252,
"start": 166882,
"tag": "NAME",
"value": "Arin"
},
{
"context": "889: {active: 1, play: 1, text:\"____. Put that in, Barry.\"}\n\t\t# 1890: {active: 1, play: 1, text:\"'These ne",
"end": 167135,
"score": 0.9995417594909668,
"start": 167130,
"tag": "NAME",
"value": "Barry"
},
{
"context": "ese new ____ t-shirts are gonna change some lives, Arin.'\"}\n\t\t# 1891: {active: 1, play: 1, text:\"____ Gru",
"end": 167234,
"score": 0.9993916749954224,
"start": 167230,
"tag": "NAME",
"value": "Arin"
},
{
"context": " of guy.\"}\n\t\t# 1897: {active: 1, play: 1, text:\"If Jack was frog and you kissed him, what would he turn i",
"end": 167776,
"score": 0.9985159039497375,
"start": 167772,
"tag": "NAME",
"value": "Jack"
},
{
"context": "# 1899: {active: 1, play: 1, text:\"They questioned Ryan's sanity after finding ____ in his house.\"}\n\t\t# 1",
"end": 167972,
"score": 0.996901273727417,
"start": 167968,
"tag": "NAME",
"value": "Ryan"
},
{
"context": ".\"}\n\t\t# 1900: {active: 1, play: 1, text:\"What does Ryan's kid listen to?\"}\n\t\t# 1901: {active: 1, play: 1,",
"end": 168068,
"score": 0.986261248588562,
"start": 168064,
"tag": "NAME",
"value": "Ryan"
},
{
"context": "\"}\n\t\t# 1901: {active: 1, play: 1, text:\"What makes Michael the angriest?\"}\n\t\t# 1902: {active: 1, play: 1, te",
"end": 168143,
"score": 0.999407172203064,
"start": 168136,
"tag": "NAME",
"value": "Michael"
},
{
"context": "ctive: 1, play: 1, text:\"What mysteries lie beyond Jack's beard? \"}\n\t\t# 1903: {active: 1, play: 1, text:\"",
"end": 168227,
"score": 0.9962038397789001,
"start": 168223,
"tag": "NAME",
"value": "Jack"
},
{
"context": " \"}\n\t\t# 1903: {active: 1, play: 1, text:\"What's in Gavin's desk?\"}\n\t\t# 1904: {active: 1, play: 1, text",
"end": 168288,
"score": 0.9312753081321716,
"start": 168287,
"tag": "NAME",
"value": "G"
},
{
"context": "\"}\n\t\t# 1904: {active: 1, play: 1, text:\"Where does Ray belong?\"}\n\t\t# 1905: {active: 1, play: 1, text:\"Wh",
"end": 168354,
"score": 0.996277928352356,
"start": 168351,
"tag": "NAME",
"value": "Ray"
},
{
"context": "ong?\"}\n\t\t# 1905: {active: 1, play: 1, text:\"Why is Geoff cool?\"}\n\t\t# 1906: {active: 1, play: 1, text:\"Why ",
"end": 168414,
"score": 0.9968809485435486,
"start": 168409,
"tag": "NAME",
"value": "Geoff"
},
{
"context": "ol?\"}\n\t\t# 1906: {active: 1, play: 1, text:\"Why was Michael screaming at Gavin?\"}\n\t\t# 1907: {active: 1, play:",
"end": 168475,
"score": 0.9991228580474854,
"start": 168468,
"tag": "NAME",
"value": "Michael"
},
{
"context": "ve: 1, play: 1, text:\"Why was Michael screaming at Gavin?\"}\n\t\t# 1907: {active: 1, play: 2, text:\"Buzzfeed ",
"end": 168494,
"score": 0.9723817706108093,
"start": 168489,
"tag": "NAME",
"value": "Gavin"
}
] | black.common.coffee | dolor/happeningAgainstHumanity | 2 | exports.numcards = !->
return Object.keys(exports.cards()).length
exports.getCard = (id) !->
return exports.cards()[id]
# New cards should be added/uncommented *after* the last uncommented card. That way, the
# plugin will automatically add the new cards to existing games.
exports.cards = !->
return {
1: {active: 1, play: 1, text:"Who stole the cookies from the cookie jar?"}
2: {active: 1, play: 1, text:"What is the next great Kickstarter project?"}
3: {active: 1, play: 1, text:"What's the next superhero?"}
4: {active: 1, play: 1, text:"____ 2012."}
5: {active: 1, play: 1, text:"____."}
6: {active: 1, play: 2, text:"Personals ad: Seeking a female who doesn't mind ____, might also be willing to try a male if they're ____."}
7: {active: 1, play: 1, text:"Why can't I sleep at night?"}
8: {active: 1, play: 1, text:"What's that smell?"}
9: {active: 1, play: 1, text:"What's that sound?"}
10: {active: 1, play: 1, text:"What ended my last relationship?"}
11: {active: 1, play: 1, text:"What is Batman's guilty pleasure?"}
12: {active: 1, play: 1, text:"What's a girl's best friend?"}
13: {active: 1, play: 1, text:"What does Dick Cheney prefer?"}
14: {active: 1, play: 1, text:"What's the most emo?"}
15: {active: 1, play: 1, text:"What are my parents hiding from me?"}
16: {active: 1, play: 1, text:"What will always get you laid?"}
17: {active: 1, play: 1, text:"What did I bring back from Mexico?"}
18: {active: 1, play: 1, text:"What don't you want to find in your Chinese food?"}
19: {active: 1, play: 1, text:"What will I bring back in time to convince people that I am a powerful wizard?"}
20: {active: 1, play: 1, text:"How am I maintaining my relationship status?"}
21: {active: 1, play: 1, text:"What gives me uncontrollable gas?"}
22: {active: 1, play: 1, text:"What do old people smell like? "}
23: {active: 1, play: 1, text:"What's my secret power?"}
24: {active: 1, play: 1, text:"What's there a ton of in heaven?"}
25: {active: 1, play: 1, text:"What would grandma find disturbing, yet oddly charming?"}
26: {active: 1, play: 1, text:"What did the U.S. airdrop to the children of Afghanistan?"}
27: {active: 1, play: 1, text:"What helps Obama unwind?"}
28: {active: 1, play: 1, text:"What did Vin Diesel eat for dinner?"}
29: {active: 1, play: 1, text:"Why am I sticky?"}
30: {active: 1, play: 1, text:"What gets better with age?"}
31: {active: 1, play: 1, text:"What's the crustiest?"}
32: {active: 1, play: 1, text:"What's Teach for America using to inspire inner city students to succeed?"}
33: {active: 1, play: 3, text:"Make a haiku."}
34: {active: 1, play: 1, text:"Why do I hurt all over?"}
35: {active: 1, play: 1, text:"What's my anti-drug?"}
36: {active: 1, play: 1, text:"What never fails to liven up the party?"}
37: {active: 1, play: 1, text:"What's the new fad diet?"}
38: {active: 1, play: 1, text:"I got 99 problems but ____ ain't one."}
39: {active: 1, play: 1, text:"TSA guidelines now prohibit ____ on airplanes."}
40: {active: 1, play: 1, text:"MTV's new reality show features eight washed-up celebrities living with ____."}
41: {active: 1, play: 1, text:"I drink to forget ____."}
42: {active: 1, play: 1, text:"I'm sorry, Professor, but I couldn't complete my homework because of ____."}
43: {active: 1, play: 1, text:"During Picasso's often-overlooked Brown Period, he produced hundreds of paintings of ____."}
44: {active: 1, play: 1, text:"Alternative medicine is now embracing the curative powers of ____."}
45: {active: 1, play: 1, text:"Anthropologists have recently discovered a primitive tribe that worships ____."}
46: {active: 1, play: 1, text:"It's a pity that kids these days are all getting involved with ____."}
47: {active: 1, play: 1, text:"____. That's how I want to die."}
48: {active: 1, play: 1, text:"In the new Disney Channel Original Movie, Hannah Montana struggles with ____ for the first time."}
49: {active: 1, play: 1, text:"I wish I hadn't lost the instruction manual for ____."}
50: {active: 1, play: 1, text:"Instead of coal, Santa now gives the bad children ____."}
51: {active: 1, play: 1, text:"In 1,000 years, when paper money is but a distant memory, ____ will be our currency."}
52: {active: 1, play: 1, text:"A romantic, candlelit dinner would be incomplete without ____."}
53: {active: 1, play: 1, text:"Next from J.K. Rowling: Harry Potter and the Chamber of ____."}
54: {active: 1, play: 1, text:"____. Betcha can't have just one!"}
55: {active: 1, play: 1, text:"White people like ____."}
56: {active: 1, play: 1, text:"____. High five, bro."}
57: {active: 1, play: 1, text:"During sex, I like to think about ____."}
58: {active: 1, play: 1, text:"When I'm in prison, I'll have ____ smuggled in."}
59: {active: 1, play: 1, text:"When I am the President of the United States, I will create the Department of ____."}
60: {active: 1, play: 1, text:"Major League Baseball has banned ____ for giving players an unfair advantage."}
61: {active: 1, play: 1, text:"When I am a billionare, I shall erect a 50-foot statue to commemorate ____."}
62: {active: 1, play: 1, text:"____. It's a trap!"}
63: {active: 1, play: 1, text:"Coming to Broadway this season, ____: The Musical."}
64: {active: 1, play: 1, text:"Due to a PR fiasco, Walmart no longer offers ____."}
65: {active: 1, play: 1, text:"But before I kill you, Mr. Bond, I must show you ____."}
66: {active: 1, play: 1, text:"When Pharaoh remained unmoved, Moses called down a plague of ____."}
67: {active: 1, play: 1, text:"The class field trip was completely ruined by ____."}
68: {active: 1, play: 1, text:"In Michael Jackson's final moments, he thought about ____."}
69: {active: 1, play: 1, text:"In an attempt to reach a wider audience, the Smithsonian Museum of Natural History has opened an interactive exhibit on ____."}
70: {active: 1, play: 1, text:"Studies show that lab rats navigate mazes 50% faster after being exposed to ____."}
71: {active: 1, play: 1, text:"I do not know with which weapons World War III will be fought, but World War IV will be fought with ____."}
72: {active: 1, play: 1, text:"Life was difficult for cavemen before ____."}
73: {active: 1, play: 1, text:"____: Good to the last drop."}
74: {active: 1, play: 1, text:"____: kid-tested, mother-approved."}
75: {active: 1, play: 2, text:"And the Academy Award for ____ goes to ____."}
76: {active: 1, play: 2, text:"For my next trick, I will pull ____ out of ____."}
77: {active: 1, play: 2, text:"____ is a slippery slope that leads to ____."}
78: {active: 1, play: 2, text:"In a world ravaged by ____, our only solace is ____."}
79: {active: 1, play: 2, text:"In his new summer comedy, Rob Schneider is ____ trapped in the body of ____."}
80: {active: 1, play: 2, text:"I never truly understood ____ until I encountered ____."}
81: {active: 1, play: 2, text:"When I was tripping on acid, ____ turned into ____."}
82: {active: 1, play: 2, text:"That's right, I killed ____. How, you ask? ____."}
83: {active: 1, play: 3, text:"____ + ____ = ____."}
84: {active: 1, play: 1, text:"What is Curious George so curious about?"}
85: {active: 1, play: 1, text:"O Canada, we stand on guard for ____."}
86: {active: 1, play: 1, text:"Air Canada guidelines now prohibit ____ on airplanes."}
87: {active: 1, play: 1, text:"In an attempt to reach a wider audience, the Royal Ontario Museum has opened an interactive exhibit on ____."}
88: {active: 1, play: 2, text:"CTV presents ____, the story of ____."}
89: {active: 1, play: 1, text:"What's the Canadian government using to inspire rural students to succeed?"}
90: {active: 1, play: 1, text:"He who controls ____ controls the world."}
91: {active: 1, play: 1, text:"The CIA now interrogates enemy agents by repeatedly subjecting them to ____."}
92: {active: 1, play: 2, text:"Dear Sir or Madam, We regret to inform you that the Office of ____ has denied your request for ____."}
93: {active: 1, play: 1, text:"In Rome, there are whisperings that the Vatican has a secret room devoted to ____."}
94: {active: 1, play: 1, text:"Science will never explain the origin of ____."}
95: {active: 1, play: 1, text:"When all else fails, I can always masturbate to ____."}
96: {active: 1, play: 1, text:"I learned the hard way that you can't cheer up a grieving friend with ____."}
97: {active: 1, play: 1, text:"In its new tourism campaign, Detroit proudly proclaims that it has finally eliminated ____."}
98: {active: 1, play: 2, text:"An international tribunal has found ____ guilty of ____."}
99: {active: 1, play: 1, text:"The socialist governments of Scandinavia have declared that access to ____ is a basic human right."}
100: {active: 1, play: 1, text:"In his new self-produced album, Kanye West raps over the sounds of ____."}
101: {active: 1, play: 1, text:"What's the gift that keeps on giving?"}
102: {active: 1, play: 1, text:"This season on Man vs. Wild, Bear Grylls must survive in the depths of the Amazon with only ____ and his wits."}
103: {active: 1, play: 1, text:"When I pooped, what came out of my butt?"}
104: {active: 1, play: 1, text:"In the distant future, historians will agree that ____ marked the beginning of America's decline."}
105: {active: 1, play: 2, text:"In a pinch, ____ can be a suitable substitute for ____."}
106: {active: 1, play: 1, text:"What has been making life difficult at the nudist colony?"}
107: {active: 1, play: 1, text:"What is the next big sideshow attraction?"}
108: {active: 1, play: 1, text:"Praise ____!"}
109: {active: 1, play: 2, text:"What's the next superhero/sidekick duo?"}
110: {active: 1, play: 1, text:"Daddy, why is Mommy crying?"}
111: {active: 1, play: 1, text:"And I would have gotten away with it, too, if it hadn't been for ____!"}
112: {active: 1, play: 1, text:"What brought the orgy to a grinding halt?"}
113: {active: 1, play: 1, text:"During his midlife crisis, my dad got really into ____."}
114: {active: 1, play: 2, text:"____ would be woefully incomplete without ____."}
115: {active: 1, play: 1, text:"Before I run for president, I must destroy all evidence of my involvement with ____."}
116: {active: 1, play: 1, text:"This is your captain speaking. Fasten your seatbelts and prepare for ____."}
117: {active: 1, play: 1, text:"The Five Stages of Grief: denial, anger, bargaining, ____, acceptance."}
118: {active: 1, play: 2, text:"My mom freaked out when she looked at my browser history and found ____.com/____."}
119: {active: 1, play: 3, text:"I went from ____ to ____, all thanks to ____."}
120: {active: 1, play: 1, text:"Members of New York's social elite are paying thousands of dollars just to experience ____."}
121: {active: 1, play: 1, text:"This month's Cosmo: 'Spice up your sex life by bringing ____ into the bedroom.'"}
122: {active: 1, play: 2, text:"If God didn't want us to enjoy ____, he wouldn't have given us ____."}
123: {active: 1, play: 1, text:"After months of debate, the Occupy Wall Street General Assembly could only agree on 'More ____!'"}
124: {active: 1, play: 2, text:"I spent my whole life working toward ____, only to have it ruined by ____."}
125: {active: 1, play: 1, text:"Next time on Dr. Phil: How to talk to your child about ____."}
126: {active: 1, play: 1, text:"Only two things in life are certain: death and ____."}
127: {active: 1, play: 1, text:"Everyone down on the ground! We don't want to hurt anyone. We're just here for ____."}
128: {active: 1, play: 1, text:"The healing process began when I joined a support group for victims of ____."}
129: {active: 1, play: 1, text:"The votes are in, and the new high school mascot is ____."}
130: {active: 1, play: 2, text:"Before ____, all we had was ____."}
131: {active: 1, play: 1, text:"Tonight on 20/20: What you don't know about ____ could kill you."}
132: {active: 1, play: 2, text:"You haven't truly lived until you've experienced ____ and ____ at the same time."}
133: {active: 1, play: 1, text:"____? There's an app for that."}
134: {active: 1, play: 1, text:"Maybe she's born with it. Maybe it's ____."}
135: {active: 1, play: 1, text:"In L.A. County Jail, word is you can trade 200 cigarettes for ____."}
136: {active: 1, play: 1, text:"Next on ESPN2, the World Series of ____."}
137: {active: 1, play: 2, text:"Step 1: ____. Step 2: ____. Step 3: Profit."}
138: {active: 1, play: 1, text:"Life for American Indians was forever changed when the White Man introduced them to ____."}
139: {active: 1, play: 1, text:"On the third day of Christmas, my true love gave to me: three French hens, two turtle doves, and ____."}
140: {active: 1, play: 1, text:"Wake up, America. Christmas is under attack by secular liberals and their ____."}
141: {active: 1, play: 1, text:"Every Christmas, my uncle gets drunk and tells the story about ____."}
142: {active: 1, play: 1, text:"What keeps me warm during the cold, cold winter?"}
143: {active: 1, play: 1, text:"After blacking out during New Year's Eve, I was awoken by ____."}
144: {active: 1, play: 2, text:"____ Jesus is the Jesus of ____."}
145: {active: 1, play: 2, text:"____ ALL THE ____."}
146: {active: 1, play: 2, text:"There were A LOT of ____ doing ____."}
147: {active: 1, play: 1, text:"Simple dog ate and vomited ____."}
148: {active: 1, play: 1, text:"When I was 25, I won an award for ____."}
149: {active: 1, play: 1, text:"I'm more awesome than a T-rex because of ____."}
150: {active: 1, play: 1, text:"____ in my pants."}
151: {active: 1, play: 1, text:"Clean ALL the ____."}
152: {active: 1, play: 1, text:"The first rule of Jade Club is ____."}
153: {active: 1, play: 2, text:"The forum nearly broke when ____ posted ____ in The Dead Thread."}
154: {active: 1, play: 1, text:"No one likes me after I posted ____ in the TMI thread."}
155: {active: 1, play: 1, text:"____ for president!"}
156: {active: 1, play: 1, text:"I did ____, like a fucking adult."}
157: {active: 1, play: 2, text:"Domo travelled across ____ to win the prize of ____."}
158: {active: 1, play: 1, text:"After Blue posted ____ in chat, I never trusted his links again."}
159: {active: 1, play: 1, text:"Fuck you, I'm a ____."}
160: {active: 1, play: 1, text:"Cunnilungus and psychiatry brought us to ____."}
161: {active: 1, play: 2, text:"I CAN ____ ACROSS THE ____."}
162: {active: 1, play: 1, text:"____ is the only thing that matters."}
163: {active: 1, play: 1, text:"I'm an expert on ____."}
164: {active: 1, play: 1, text:"What can you always find in between the couch cushions?"}
165: {active: 1, play: 1, text:"I want ____ in my mouflon RIGHT MEOW."}
166: {active: 1, play: 1, text:"Don't get mad, get ____."}
167: {active: 1, play: 1, text:"Have fun, don't be ____."}
168: {active: 1, play: 1, text:"It's the end of ____ as we know it."}
169: {active: 1, play: 1, text:"____ is my worst habit."}
170: {active: 1, play: 1, text:"Everything's better with ____."}
171: {active: 1, play: 1, text:"What would you taste like?"}
172: {active: 1, play: 1, text:"What have you accomplished today?"}
173: {active: 1, play: 1, text:"What made you happy today?"}
174: {active: 1, play: 1, text:"Why are you frothing with rage?"}
175: {active: 1, play: 1, text:"What mildy annoyed you today?"}
176: {active: 1, play: 1, text:"We'll always have ____."}
177: {active: 1, play: 2, text:"____ uses ____. It is SUPER EFFECTIVE!"}
178: {active: 1, play: 1, text:"Let's all rock out to the sounds of ____."}
179: {active: 1, play: 1, text:"Take ____, it will last longer."}
180: {active: 1, play: 1, text:"You have my bow. AND MY ____."}
181: {active: 1, play: 2, text:"A wild ____ appeared! It used ____!"}
182: {active: 1, play: 2, text:"I thought being a ____ was the best thing ever, until I became a ____."}
183: {active: 1, play: 1, text:"Live long and ____."}
184: {active: 1, play: 1, text:"The victim was found with ____."}
185: {active: 1, play: 2, text:"If life gives you ____, make ____."}
186: {active: 1, play: 1, text:"Who needs a bidet when you have ____?"}
187: {active: 1, play: 1, text:"Kill it with ____!"}
188: {active: 1, play: 1, text:"My ____ is too big!"}
189: {active: 1, play: 3, text:"Best drink ever: One part ____, three parts ____, and a splash of ____."}
190: {active: 1, play: 1, text:"____ makes me uncomfortable."}
191: {active: 1, play: 1, text:"Stop, drop, and ____."}
192: {active: 1, play: 1, text:"Think before you ____."}
193: {active: 1, play: 2, text:"The hills are alive with ____ of ____."}
194: {active: 1, play: 1, text:"What is love without ____?"}
195: {active: 1, play: 2, text:"____ is the name of my ____ cover band."}
196: {active: 1, play: 1, text:"I have an idea even better than Kickstarter, and it's called ____starter."}
197: {active: 1, play: 1, text:"You have been waylaid by ____ and must defend yourself."}
198: {active: 1, play: 1, text:"Action stations! Action stations! Set condition one throughout the fleet and brace for ____!"}
199: {active: 1, play: 2, text:"____: Hours of fun. Easy to use. Perfect for ____!"}
200: {active: 1, play: 1, text:"Turns out that ____-Man was neither the hero we needed nor wanted."}
201: {active: 1, play: 1, text:"What left this stain on my couch?"}
202: {active: 1, play: 1, text:"A successful job interview begins with a firm handshake and ends with ____."}
203: {active: 1, play: 1, text:"Lovin' you is easy 'cause you're ____."}
204: {active: 1, play: 1, text:"Money can't buy me love, but it can buy me ____."}
205: {active: 1, play: 2, text:"Listen, son. If you want to get involved with ____, I won't stop you. Just steer clear of ____."}
206: {active: 1, play: 1, text:"During high school, I never really fit in until I found ____ club."}
207: {active: 1, play: 1, text:"Hey baby, come back to my place and I'll show you ____."}
208: {active: 1, play: 1, text:"Finally! A service that delivers ____ right to your door."}
209: {active: 1, play: 1, text:"My gym teacher got fired for adding ____ to the obstacle course."}
210: {active: 1, play: 2, text:"When you get right down to it, ____ is just ____."}
211: {active: 1, play: 1, text:"In the seventh circle of Hell, sinners must endure ____ for all eternity."}
212: {active: 1, play: 2, text:"After months of practice with ____, I think I'm finally ready for ____."}
213: {active: 1, play: 1, text:"The blind date was going horribly until we discovered our shared interest in ____."}
214: {active: 1, play: 1, text:"____. Awesome in theory, kind of a mess in practice."}
215: {active: 1, play: 2, text:"With enough time and pressure, ____ will turn into ____."}
216: {active: 1, play: 1, text:"I'm not like the rest of you. I'm too rich and busy for ____."}
217: {active: 1, play: 1, text:"And what did you bring for show and tell?"}
218: {active: 1, play: 2, text:"Having problems with ____? Try ____!"}
219: {active: 1, play: 1, text:"____.tumblr.com"}
220: {active: 1, play: 1, text:"What's the next Happy Meal toy?"}
221: {active: 1, play: 2, text:"My life is ruled by a vicious cycle of ____ and ____."}
222: {active: 1, play: 2, text:"After I saw ____, I needed ____."}
223: {active: 1, play: 1, text:"There's ____ in my soup."}
224: {active: 1, play: 1, text:"____ sounds like a great alternative rock band."}
225: {active: 1, play: 1, text:"____? Well, I won't look a gift horse in the mouth on that one."}
226: {active: 1, play: 1, text:"____. Everything else is uncivilized."}
227: {active: 1, play: 1, text:"'Hey everybody and welcome to Let's Look At ____!'"}
228: {active: 1, play: 1, text:"Best game of 2013? ____, of course."}
229: {active: 1, play: 1, text:"But that ____ has sailed."}
230: {active: 1, play: 1, text:"Fuck the haters, this is ____."}
231: {active: 1, play: 1, text:"Get in my ____ zone."}
232: {active: 1, play: 1, text:"How do you get your dog to stop humping your leg?"}
233: {active: 1, play: 1, text:"I can do ____ and die immediately afterward."}
234: {active: 1, play: 1, text:"Invaded the world of ____."}
235: {active: 1, play: 1, text:"It's ____, ya dangus!"}
236: {active: 1, play: 1, text:"Legend has it, the Thug of Porn was arrested for ____."}
237: {active: 1, play: 1, text:"Let's Look At: ____."}
238: {active: 1, play: 1, text:"More like the Duke of ____, right?"}
239: {active: 1, play: 1, text:"No one man should have all that ____."}
240: {active: 1, play: 1, text:"Only in Korea can you see ____."}
241: {active: 1, play: 1, text:"Praise the ____!"}
242: {active: 1, play: 1, text:"Roguelike? How about ___-like."}
243: {active: 1, play: 1, text:"Sometimes, a man's just gotta ____."}
244: {active: 1, play: 1, text:"The hero of the stream was ____."}
245: {active: 1, play: 1, text:"____? It's a DLC item."}
246: {active: 1, play: 1, text:"This new game is an interesting ____-like-like."}
247: {active: 1, play: 1, text:"We're rolling in ____!"}
248: {active: 1, play: 1, text:"Today's trivia topic is ____."}
249: {active: 1, play: 1, text:"What do you give to the CEO of Youtube as a gift?"}
250: {active: 1, play: 1, text:"Well there's nothing wrong with ____ by any stretch of the imagination."}
251: {active: 1, play: 1, text:"I'd sacrifice ____ at the Altar."}
252: {active: 1, play: 3, text:"The Holy Trinity: ____, ____, and ____!"}
253: {active: 1, play: 2, text:"____ was indicted on account of ____."}
254: {active: 1, play: 2, text:"____: The ____ Story."}
255: {active: 1, play: 2, text:"Hello everybody, welcome to a new episode of ____ plays ____."}
256: {active: 1, play: 1, text:"I've always wanted to become a voice actor, so I could play the role of ____."}
257: {active: 1, play: 1, text:"____. And now I'm bleeding."}
258: {active: 1, play: 1, text:"While the United States raced the Soviet Union to the moon, the Mexican government funneled millions of pesos into research on ____."}
259: {active: 1, play: 1, text:"My life for ____!"}
260: {active: 1, play: 1, text:"Who let the dogs out?"}
261: {active: 1, play: 1, text:"In his next movie, Will Smith saves the world from ____."}
262: {active: 1, play: 1, text:"Lady Gaga has revealed her new dress will be made of ____."}
263: {active: 1, play: 1, text:"Justin Bieber's new song is all about ____."}
264: {active: 1, play: 2, text:"The new fad diet is all about making people do ____ and eat ____."}
265: {active: 1, play: 1, text:"I whip my ____ back and forth."}
266: {active: 1, play: 1, text:"When North Korea gets ____, it will be the end of the world."}
267: {active: 1, play: 3, text:"Plan a three course meal."}
268: {active: 1, play: 1, text:"Tastes like ____."}
269: {active: 1, play: 1, text:"What is literally worse than Hitler?"}
270: {active: 1, play: 1, text:"____ ruined many people's childhood."}
271: {active: 1, play: 1, text:"Who needs college when you have ____."}
272: {active: 1, play: 1, text:"When short on money, you can always ____."}
273: {active: 1, play: 2, text:"The next pokemon will combine ____ and ____."}
274: {active: 1, play: 1, text:"Instead of playing Cards Against Humanity, you could be ____."}
275: {active: 1, play: 1, text:"One does not simply walk into ____."}
276: {active: 1, play: 1, text:"Welcome to my secret lair on ____."}
277: {active: 1, play: 1, text:"What is the answer to life's question?"}
278: {active: 1, play: 1, text:"I've got the whole world in my ____."}
279: {active: 1, play: 1, text:"I never thought ____ would be so enjoyable."}
280: {active: 1, play: 1, text:"In his second term, Obama will rid America of ____."}
281: {active: 1, play: 1, text:"What is Japan's national pastime?"}
282: {active: 1, play: 1, text:"Suck my ____."}
283: {active: 1, play: 1, text:"In the future, ____ will fuel our cars."}
284: {active: 1, play: 1, text:"The lion, the witch, and ____."}
285: {active: 1, play: 1, text:"In the next episode, SpongeBob gets introduced to ____. "}
286: {active: 1, play: 1, text:"____ Game of the Year Edition."}
287: {active: 1, play: 1, text:"What was going through Osama Bin Laden's head before he died?"}
288: {active: 1, play: 1, text:"In a news conference, Obama pulled out ____, to everyone's surprise."}
289: {active: 1, play: 1, text:"Nights filled with ____."}
290: {active: 1, play: 1, text:"If the anime industry is dying, what will be the final nail in it's coffin?"}
291: {active: 1, play: 2, text:"If a dog and a dolphin can get along, why not ____ and ____?"}
292: {active: 1, play: 2, text:"If I wanted to see ____, I'll stick with ____, thank you very much."}
293: {active: 1, play: 1, text:"Ladies and gentlemen, I give you ____... COVERED IN BEES!!!"}
294: {active: 1, play: 1, text:"Don't stand behind him, if you value your ____."}
295: {active: 1, play: 2, text:"Rock and Roll is nothing but ____ and the rage of ____!"}#
# 296: {active: 1, play: 1, text:"What the hell is 'Juvijuvibro'?!"}
# 297: {active: 1, play: 2, text:"When I was a kid, all we had in Lunchables were three ____ and ____."}
# 298: {active: 1, play: 2, text:"On its last dying breath, ____ sent out a cry for help. A bunch of ____ heard the cry."}
# 299: {active: 1, play: 1, text:"I also take ____ as payment for commissions."}
# 300: {active: 1, play: 1, text:"____ looks pretty in all the art, but have you seen one in real life?"}
# 301: {active: 1, play: 1, text:"How did I lose my virginity?"}
# 302: {active: 1, play: 1, text:"Here is the church, here is the steeple, open the doors, and there is ____."}
# 303: {active: 1, play: 1, text:"This is the way the world ends \ This is the way the world ends \ Not with a bang but with ____."}
# 304: {active: 1, play: 1, text:"In 1,000 years, when paper money is a distant memory, how will we pay for goods and services?"}
# 305: {active: 1, play: 1, text:"War! What is it good for?"}
# 306: {active: 1, play: 1, text:"What don't you want to find in your Kung Pao chicken?"}
# 307: {active: 1, play: 1, text:"The Smithsonian Museum of Natural History has just opened an exhibit on ____."}
# 308: {active: 1, play: 1, text:"At first I couldn't understand ____, but now it's my biggest kink."}
# 309: {active: 1, play: 1, text:"Long story short, I ended up with ____ in my ass."}
# 310: {active: 1, play: 1, text:"Don't knock ____ until you've tried it."}
# 311: {active: 1, play: 1, text:"Who knew I'd be able to make a living off of ____?"}
# 312: {active: 1, play: 1, text:"It's difficult to explain to friends and family why I know so much about ____."}
# 313: {active: 1, play: 1, text:"Once I started roleplaying ____, it was all downhill from there."}
# 314: {active: 1, play: 1, text:"____ are so goddamn cool."}
# 315: {active: 1, play: 1, text:"No, look, you don't understand. I REALLY like ____."}
# 316: {active: 1, play: 1, text:"I don't think my parents will ever accept that the real me is ____."}
# 317: {active: 1, play: 1, text:"I can't believe I spent most of my paycheck on ____."}
# 318: {active: 1, play: 2, text:"You can try to justify ____ all you want, but you don't have to be ____ to realize it's just plain wrong."}
# 319: {active: 1, play: 1, text:"I've been waiting all year for ____."}
# 320: {active: 1, play: 1, text:"I can't wait to meet up with my internet friends for ____."}
# 321: {active: 1, play: 3, text:"The next crossover will have ____ and ____ review ____."}
# 322: {active: 1, play: 1, text:"We all made a mistake when we ate ____ at MAGFest."}
# 323: {active: 1, play: 1, text:"Kyle's next student film will focus on ____."}
# 324: {active: 1, play: 1, text:"____ will be the subject of the next TGWTG panel at MAGFest."}
# 325: {active: 1, play: 1, text:"WAIT! I have an idea! It involves using ____!"}
# 326: {active: 1, play: 1, text:"If you value your life, never mention ____ around Oancitizen."}
# 327: {active: 1, play: 2, text:"____ is only on the site because of ____."}
# 328: {active: 1, play: 2, text:"The newest fanfic trend is turning ____ into ____."}
# 329: {active: 1, play: 1, text:"Tom is good, but he's not ____ good."}
# 330: {active: 1, play: 1, text:"BENCH ALL THE ____."}
# 331: {active: 1, play: 1, text:"Hey guys, check out my ____ montage!"}
# 332: {active: 1, play: 1, text:"____ was completely avoidable!"}
# 333: {active: 1, play: 1, text:"____ will live!"}
# 334: {active: 1, play: 1, text:"____ should be on TGWTG."}
# 335: {active: 1, play: 1, text:"____! What are you doing here?"}
# 336: {active: 1, play: 1, text:"____! You know, for kids."}
# 337: {active: 1, play: 1, text:"I love ____. It's so bad."}
# 338: {active: 1, play: 1, text:"____. With onions."}
# 339: {active: 1, play: 1, text:"____ is the theme of this year's anniversary crossover."}
# 340: {active: 1, play: 1, text:"A ____ Credit Card!?"}
# 341: {active: 1, play: 3, text:"Fighting ____ by moonlight! Winning ____ by daylight! Never running from a real fight! She is the one named ____!"}
# 342: {active: 1, play: 1, text:"It's no secret. Deep down, everybody wants to fuck ____."}
# 343: {active: 1, play: 1, text:"Behold! My trap card, ____!"}
# 344: {active: 1, play: 1, text:"Blip checks are way smaller in January so I'll spend the month riffing on ____ to gain more views."}
# 345: {active: 1, play: 1, text:"Doug still regrets the day he decided to do a Let's Play video for 'Bart Simpson's ____ Adventure'."}
# 346: {active: 1, play: 1, text:"High and away on a wing and a prayer, who could it be? Believe it or not, it's just ____."}
# 347: {active: 1, play: 1, text:"I ____ so you don't have to."}
# 348: {active: 1, play: 1, text:"I AM THE VOICELESS. THE NEVER SHOULD. I AM ____."}
# 349: {active: 1, play: 1, text:"I prefer for MY exploitation films to have ____, thank you very much."}
# 350: {active: 1, play: 1, text:"I watch movies just to see if I can find a Big Lipped ____ Moment."}
# 351: {active: 1, play: 1, text:"I'm looking forward to Jesuotaku's playthrough of Fire Emblem: ____."}
# 352: {active: 1, play: 1, text:"After eating a Devil Fruit, I now have the power of ____."}
# 353: {active: 1, play: 1, text:"It was all going well until they found ____."}
# 354: {active: 1, play: 1, text:"JW confirms, you can play ____,"}
# 355: {active: 1, play: 1, text:"Next January, the Nostalgia Critic is doing ____ Month."}
# 356: {active: 1, play: 1, text:"No one wants to see your ____."}
# 357: {active: 1, play: 1, text:"Of Course! Don't you know anything about ____?"}
# 358: {active: 1, play: 1, text:"OH MY GOD THIS IS THE GREATEST ____ I'VE EVER SEEN IN MY LIFE!"}
# 359: {active: 1, play: 1, text:"On the other side of the Plot Hole, the Nostalgia Critic found ____."}
# 360: {active: 1, play: 1, text:"Reactions were mixed when ____ joined TGWTG."}
# 361: {active: 1, play: 1, text:"Sage has presented JO with the new ecchi series ____."}
# 362: {active: 1, play: 1, text:"Sean got his head stuck in ____."}
# 363: {active: 1, play: 1, text:"STOP OR I WILL ____."}
# 364: {active: 1, play: 1, text:"The invasion of Molassia was tragically thwarted by ____."}
# 365: {active: 1, play: 1, text:"The newest reviewer addition to the site specializes in ____."}
# 366: {active: 1, play: 1, text:"The next person to leave Channel Awesome will announce their departure via ____."}
# 367: {active: 1, play: 1, text:"The next Renegade Cut is about ____ in a beloved children's movie."}
# 368: {active: 1, play: 1, text:"The Nostalgia Critic will NEVER review ____."}
# 369: {active: 1, play: 1, text:"By far, the most mind-bogglingly awesome thing I've ever seen in anime is ____."}
# 370: {active: 1, play: 1, text:"My Little Sister Can't Be ____!"}
# 371: {active: 1, play: 1, text:"WE WERE FIGHTING LIKE ____."}
# 372: {active: 1, play: 1, text:"What doesn't go there?"}
# 373: {active: 1, play: 1, text:"What doesn't work that way?"}
# 374: {active: 1, play: 1, text:"What is in Sci Fi Guy's vest?"}
# 375: {active: 1, play: 1, text:"What the fuck is wrong with you?"}
# 376: {active: 1, play: 1, text:"What's holding up the site redesign?"}
# 377: {active: 1, play: 1, text:"What's really inside the Plot Hole?"}
# 378: {active: 1, play: 1, text:"What's up next on WTFIWWY?"}
# 379: {active: 1, play: 1, text:"When the JesuOtaku stream got to the 'awful part of the night,' the GreatSG video featured ____."}
# 380: {active: 1, play: 1, text:"Why can't Film Brain stop extending his final vowels?"}
# 381: {active: 1, play: 1, text:"90's Kid's favorite comic is ____."}
# 382: {active: 1, play: 1, text:"Because poor literacy is ____."}
# 383: {active: 1, play: 1, text:"He is a glitch. He is missing. He is ____."}
# 384: {active: 1, play: 1, text:"Of course! Don't you know anything about ___?"}
# 385: {active: 1, play: 1, text:"Snowflame feels no ____."}
# 386: {active: 1, play: 1, text:"Snowflame found a new love besides cocaine. What is it?"}
# 387: {active: 1, play: 1, text:"So let's dig into ____ #1."}
# 388: {active: 1, play: 1, text:"Where'd he purchase that?"}
# 389: {active: 1, play: 1, text:"When is the next History of Power Rangers coming out?"}
# 390: {active: 1, play: 1, text:"What is as low as the standards of the 90's Kid?"}
# 391: {active: 1, play: 1, text:"What delayed the next History of Power Rangers?"}
# 392: {active: 1, play: 1, text:"____ has the 'mount' keyword."}
# 393: {active: 1, play: 1, text:"You're so _____ I'll have to delete you."}
# 394: {active: 1, play: 1, text:"I got a new tattoo, it looks a bit like ____."}
# 395: {active: 1, play: 1, text:"What strange Korean delicacy will Mark enjoy today?"}
# 396: {active: 1, play: 1, text:"____ is camping my lane."}
# 397: {active: 1, play: 1, text:"The OGN was fun, but there was far too much ____ cosplay."}
# 398: {active: 1, play: 1, text:"'What are you thinking?' 'You know, ____ and stuff.'"}
# 399: {active: 1, play: 2, text:"Drunken games of Pretend You're Xyzzy lead to ____ and ____."}
# 400: {active: 1, play: 1, text:"Vegeta, what does the scouter say?"}
# 401: {active: 1, play: 1, text:"____. BELIEVE IT!"}
# 402: {active: 1, play: 1, text:"Make a contract with me, and become ____!"}
# 403: {active: 1, play: 1, text:"You guys are so wrong. Obviously, ____ is best waifu."}
# 404: {active: 1, play: 1, text:"THIS ____ HAS BEEN PASSED DOWN THE ARMSTRONG FAMILY LINE FOR GENERATIONS!!!"}
# 405: {active: 1, play: 2, text:"My favorite episode of ____ is the one with ____."}
# 406: {active: 1, play: 2, text:"This doujinshi I just bought has ____ and ____ getting it on, hardcore."}
# 407: {active: 1, play: 2, text:"On the next episode of Dragon Ball Z, ____ is forced to do the fusion dance with ____."}
# 408: {active: 1, play: 1, text:"You are already ____."}
# 409: {active: 1, play: 1, text:"Who the hell do you think I am?!"}
# 410: {active: 1, play: 1, text:"On the next episode of Dragon Ball Z, Goku has a fierce battle with ____."}
# 411: {active: 1, play: 1, text:"____. YOU SHOULD BE WATCHING."}
# 412: {active: 1, play: 1, text:"Most cats are ____."}
# 413: {active: 1, play: 2, text:"Fresh from Japan: The new smash hit single by ____ titled ____."}
# 414: {active: 1, play: 2, text:"____ vs. ____. BEST. FIGHT. EVER."}
# 415: {active: 1, play: 2, text:"So wait, ____ was actually ____? Wow, I didn't see that one coming!"}
# 416: {active: 1, play: 1, text:"Real men watch ____."}
# 417: {active: 1, play: 1, text:"When it comes to hentai, nothing gets me hotter than ____."}
# 418: {active: 1, play: 1, text:"Whenever I'm splashed with cold water, I turn into ____."}
# 419: {active: 1, play: 2, text:"No matter how you look at it, ultimately ____ is responsible for ____."}
# 420: {active: 1, play: 1, text:"S-Shut up!! I-It's not like I'm ____ or anything."}
# 421: {active: 1, play: 2, text:"The English dub of ____ sucks worse than ____."}
# 422: {active: 1, play: 1, text:"Congratulations, ____."}
# 423: {active: 1, play: 1, text:"By far the best panel at any anime convention is the one for ____."}
# 424: {active: 1, play: 1, text:"One thing you almost never see in anime is ____."}
# 425: {active: 1, play: 1, text:"What do I hate most about anime?"}
# 426: {active: 1, play: 1, text:"What do I love most about anime?"}
# 427: {active: 1, play: 1, text:"This morning, hundreds of Japanese otaku lined up outside their favorite store to buy the limited collector's edition of ____."}
# 428: {active: 1, play: 1, text:"Every now and then, I like to participate in the time-honored Japanese tradition of ____."}
# 429: {active: 1, play: 1, text:"There are guilty pleasures. And then there's ____."}
# 430: {active: 1, play: 1, text:"Watch it! Or I'll take your ____."}
# 431: {active: 1, play: 1, text:"New from Studio GAINAX: ____ the Animation."}
# 432: {active: 1, play: 1, text:"Using my power of Geass, I command you to do... THIS!"}
# 433: {active: 1, play: 1, text:"Chicks. Dig. ____. Nice."}
# 434: {active: 1, play: 1, text:"When it comes to Japanese cuisine, there's simply nothing better than ____."}
# 435: {active: 1, play: 1, text:"In the name of the moon, I will punish ____!"}
# 436: {active: 1, play: 3, text:"Just announced: The brand new anime adaptation of ____, starring ____ as the voice of ____."}
# 437: {active: 1, play: 1, text:"Don't worry, he's okay! He survived thanks to ____."}
# 438: {active: 1, play: 1, text:"____. Goddammit, Japan."}
# 439: {active: 1, play: 1, text:"Welcome home, Master! Is there anything your servant girl can bring you today?"}
# 440: {active: 1, play: 1, text:"I have never in my life laughed harder than the first time I watched ____."}
# 441: {active: 1, play: 1, text:"Take this! My love, my anger, and all of my ____!"}
# 442: {active: 1, play: 1, text:"Karaoke night! I'm totally gonna sing my favorite song, ____."}
# 443: {active: 1, play: 1, text:"Digimon! Digivolve to: ____-mon!"}
# 444: {active: 1, play: 1, text:"Now! Face my ultimate attack!"}
# 445: {active: 1, play: 3, text:"From the twisted mind of Nabeshin: An anime about ____, ____, and ____."}
# 446: {active: 1, play: 1, text:"____. Only on Toonami"}
# 447: {active: 1, play: 1, text:"I am in despair! ____ has left me in despair!"}
# 448: {active: 1, play: 2, text:"The new manga from ____ is about a highschool girl discovering ____."}
# 449: {active: 1, play: 1, text:"To save the world, you must collect all 7 ____."}
# 450: {active: 1, play: 1, text:"Sasuke has ____ implants."}
# 451: {active: 1, play: 1, text:"In truth, the EVA units are actually powered by the souls of ____."}
# 452: {active: 1, play: 3, text:"Dreaming! Don't give it up ____! Dreaming! Don't give it up ____! Dreaming! Don't give it up ____!"}
# 453: {active: 1, play: 1, text:"Lupin the III's latest caper involves him trying to steal ____."}
# 454: {active: 1, play: 1, text:"A piece of ____ is missing."}
# 455: {active: 1, play: 1, text:"At least he didn't fuck ____."}
# 456: {active: 1, play: 2, text:"Hello, and welcome to Atop ____, where ____ burns."}
# 457: {active: 1, play: 1, text:"No matter how I look at it, it's your fault I'm not ____!"}
# 458: {active: 1, play: 1, text:"Hello, I'm the Nostalgia Critic. I remember ____ so you don't have to!"}
# 459: {active: 1, play: 1, text:"Taking pride in one's collection of ____."}
# 460: {active: 1, play: 3, text:"If you are able to deflect ____ with ____, we refer to it as 'Frying ____'."}
# 461: {active: 1, play: 1, text:"They are the prey, and we are the ____."}
# 462: {active: 1, play: 1, text:"Did you hear about the guy that smuggled ____ into the hotel?"}
# 463: {active: 1, play: 1, text:"The new Gurren Lagann blurays from Aniplex will literally cost you ____."}
# 464: {active: 1, play: 1, text:"The most overused anime cliche is ____."}
# 465: {active: 1, play: 1, text:"The inspiration behind the latest hit show is ____."}
# 466: {active: 1, play: 1, text:"While writing Dragon Ball, Akira Toriyama would occasionally take a break from working to enjoy ____."}
# 467: {active: 1, play: 1, text:"The show was great, until ____ showed up."}
# 468: {active: 1, play: 1, text:"Nothing ruins a good anime faster than ____."}
# 469: {active: 1, play: 1, text:"People die when they are ____."}
# 470: {active: 1, play: 2, text:"I want to be the very best, like no one ever was! ____ is my real test, ____ is my cause!"}
# 471: {active: 1, play: 1, text:"Okay, I'll admit it. I would totally go gay for ____."}
# 472: {active: 1, play: 2, text:"Who are you callin' ____ so short he can't see over his own ____?!?!"}
# 473: {active: 1, play: 1, text:"If you ask me, there need to be more shows about ____."}
# 474: {active: 1, play: 1, text:"____. That is the kind of man I was."}
# 475: {active: 1, play: 1, text:"I'm sorry! I'm sorry! I didn't mean to accidentally walk in on you while you were ____!"}
# 476: {active: 1, play: 2, text:"After a long, arduous battle, ____ finally met their end by ____."}
# 477: {active: 1, play: 1, text:"This is our final battle. Mark my words, I will defeat you, ____!"}
# 478: {active: 1, play: 1, text:"You used ____. It's super effective!"}
# 479: {active: 1, play: 1, text:"The best English dub I've ever heard is the one for ____."}
# 480: {active: 1, play: 1, text:"I know of opinions and all that, but I just don't understand how anyone could actually enjoy ____."}
# 481: {active: 1, play: 1, text:"____. HE DEDD."}
# 482: {active: 1, play: 1, text:"She'll thaw out if you try ____."}
# 483: {active: 1, play: 1, text:"You see, I'm simply ____."}
# 484: {active: 1, play: 1, text:"Truly and without question, ____ is the manliest of all men."}
# 485: {active: 1, play: 1, text:"WANTED: $50,000,000,000 reward for the apprehension of____."}
# 486: {active: 1, play: 1, text:"This year, I totally lucked out and found ____ in the dealer's room."}
# 487: {active: 1, play: 1, text:"How did I avoid your attack? Simple. By ____."}
# 488: {active: 1, play: 1, text:"If I was a magical girl, my cute mascot sidekick would be ____."}
# 489: {active: 1, play: 2, text:"From the creators of Tiger & Bunny: ____ & ____!!"}
# 490: {active: 1, play: 1, text:"In the future of 199X, the barrier between our world and the demon world is broken, and thousands of monsters invade our realm to feed upon ____."}
# 491: {active: 1, play: 2, text:"Animation studio ____ is perhaps best known for ____."}
# 492: {active: 1, play: 1, text:"____. So kawaii!! <3 <3"}
# 493: {active: 1, play: 1, text:"The most annoying kind of anime fans are ____."}
# 494: {active: 1, play: 1, text:"Cooking is so fun! Cooking is so fun! Now it's time to take a break and see what we have done! ____. YAY! IT'S READY!!"}
# 495: {active: 1, play: 2, text:"My favorite hentai is the one where ____ is held down and violated by ____."}
# 496: {active: 1, play: 1, text:"The government of Japan recently passed a law that effectively forbids all forms of ____."}
# 497: {active: 1, play: 1, text:"This year, I'm totally gonna cosplay as ____."}
# 498: {active: 1, play: 1, text:"Coming to Neon Alley: ____, completely UNCUT & UNCENSORED."}
# 499: {active: 1, play: 1, text:"No matter how many times I see it, ____ always brings a tear to my eye."}
# 500: {active: 1, play: 1, text:"Of my entire collection, my most prized possession is ____."}
# 501: {active: 1, play: 1, text:"Someday when I have kids, I want to share with them the joys of ____."}
# 502: {active: 1, play: 1, text:"So, what have you learned from all of this?"}
# 503: {active: 1, play: 1, text:"The World Line was changed when I sent a D-mail to myself about ____."}
# 504: {active: 1, play: 1, text:"After years of searching, the crew of the Thousand Sunny finally found out that the One Piece is actually ____."}
# 505: {active: 1, play: 1, text:"When I found all 7 Dragon Balls, Shenron granted me my wish for ____."}
# 506: {active: 1, play: 2, text:"The best part of my ____ costume is ____."}
# 507: {active: 1, play: 1, text:"Cards Against Anime: It's more fun than ____!"}
# 508: {active: 1, play: 2, text:"On the mean streets of Tokyo, everyone knows that ____ is the leader of the ________ Gang."}
# 509: {active: 1, play: 1, text:"He might just save the universe, if he only had some ____!"}
# 510: {active: 1, play: 5, text:"Make a harem."}
# 511: {active: 1, play: 6, text:"Make a dub cast. ____ as ____, ____ as ____, & ____ as ____."}
# 512: {active: 1, play: 1, text:"Dr. Black Jack, please hurry! The patient is suffering from a terminal case of ____!"}
# 513: {active: 1, play: 1, text:"I'M-A FIRIN' MAH ____!"}
# 514: {active: 1, play: 3, text:"Make a love triangle."}
# 515: {active: 1, play: 2, text:"This ____ of mine glows with an awesome power! Its ____ tells me to defeat you!"}
# 516: {active: 1, play: 1, text:"Yo-Ho-Ho! He took a bite of ____."}
# 517: {active: 1, play: 1, text:"Scientists have reverse engineered alien technology that unlocks the secrets of ____."}
# 518: {active: 1, play: 1, text:"It is often argued that our ancestors would have never evolved without the aid of ____."}
# 519: {active: 1, play: 1, text:"The sad truth is, that at the edge of the universe, there is nothing but ____."}
# 520: {active: 1, play: 1, text:"The 1930's is often regarded as the golden age of ____."}
# 521: {active: 1, play: 2, text:"____ a day keeps ____ away."}
# 522: {active: 1, play: 1, text:"There is a time for peace, a time for war, and a time for ____."}
# 523: {active: 1, play: 1, text:"If a pot of gold is at one end of the rainbow, what is at the other?"}
# 524: {active: 1, play: 1, text:"A fortune teller told me I will live a life filled with ____."}
# 525: {active: 1, play: 1, text:"The Himalayas are filled with many perils, such as ____."}
# 526: {active: 1, play: 1, text:"The road to success is paved with ____."}
# 527: {active: 1, play: 1, text:"I work out so I can look good when I'm ____."}
# 528: {active: 1, play: 1, text:"And on his farm he had ____, E-I-E-I-O!"}
# 529: {active: 1, play: 1, text:"Genius is 10% inspiration and 90% ____."}
# 530: {active: 1, play: 1, text:"I will not eat them Sam-I-Am. I will not eat ____."}
# 531: {active: 1, play: 1, text:"What's the time? ____ time!"}
# 532: {active: 1, play: 1, text:"____ is the root of all evil."}
# 533: {active: 1, play: 1, text:"The primitive villagers were both shocked and amazed when I showed them ____."}
# 534: {active: 1, play: 1, text:"And it is said his ghost still wanders these halls, forever searching for his lost ____."}
# 535: {active: 1, play: 1, text:"Disney presents ____, on ice!"}
# 536: {active: 1, play: 1, text:"The best part of waking up is ____ in your cup."}
# 537: {active: 1, play: 1, text:"Though Thomas Edison invented the lightbulb, he is also known for giving us ____."}
# 538: {active: 1, play: 2, text:"Little Miss. Muffet sat on her tuffet, eating her ____ and ____."}
# 539: {active: 1, play: 1, text:"What do I keep hidden in the crawlspace?"}
# 540: {active: 1, play: 1, text:"Go-Go-Gadget, ____!"}
# 541: {active: 1, play: 1, text:"I qualify for this job because I have several years experience in the field of ____."}
# 542: {active: 1, play: 1, text:"We just adopted ____ from the pound."}
# 543: {active: 1, play: 1, text:"It was the happiest day of my life when I became the proud parent of ____."}
# 544: {active: 1, play: 1, text:"I finally realized I hit rock bottom when I started digging through dumpsters for ____."}
# 545: {active: 1, play: 1, text:"With a million times the destructive force of all our nuclear weapons combined, no one was able to survive ____."}
# 546: {active: 1, play: 2, text:"You have been found guilty of 5 counts of ____, and 13 counts of ____."}
# 547: {active: 1, play: 1, text:"And the award for the filthiest scene in an adult film goes to '5 women and ____.'"}
# 548: {active: 1, play: 1, text:"'Why Grandma', said Little Red Riding Hood, 'What big ____ you have!'"}
# 549: {active: 1, play: 1, text:"Pay no attention to ____ behind the curtain!"}
# 550: {active: 1, play: 1, text:"Who would have guessed that the alien invasion would be easily thwarted by ____."}
# 551: {active: 1, play: 1, text:"With Democrats and Republicans in a dead heat, the election was snatched by ____ party."}
# 552: {active: 1, play: 1, text:"Mama always said life was like ____."}
# 553: {active: 1, play: 1, text:"Who could have guessed that the alien invasion would be easily thwarted by ____."}
# 554: {active: 1, play: 1, text:"With the Democrats and Republicans in a dead heat, the election was snatched by the ____ party."}
# 555: {active: 1, play: 1, text:"The panel I'm looking forward to most at AC this year is..."}
# 556: {active: 1, play: 1, text:"My Original Character's name is ____."}
# 557: {active: 1, play: 1, text:"My secret tumblr account where I post nothing but ____."}
# 558: {active: 1, play: 1, text:"Only my internet friends know that I fantasize about ____."}
# 559: {active: 1, play: 1, text:"Everyone really just goes to the cons for ____."}
# 560: {active: 1, play: 1, text:"It all started with ____."}
# 561: {active: 1, play: 2, text:"I'll roleplay ____, you can be ____."}
# 562: {active: 1, play: 2, text:"I'm no longer allowed near ____ after the incident with ____."}
# 563: {active: 1, play: 1, text:"I've been into ____ since before I hit puberty, I just didn't know what it meant."}
# 564: {active: 1, play: 1, text:"Realizing, too late, the implications of your interest in ____ as a child."}
# 565: {active: 1, play: 1, text:"Whoa, I might fantasize about ____, but I'd never actually go that far in real life."}
# 566: {active: 1, play: 1, text:"I realized they were a furry when they mentioned ____."}
# 567: {active: 1, play: 1, text:"Everyone on this site has such strong opinions about ____."}
# 568: {active: 1, play: 1, text:"My landlord had a lot of uncomfortable questions for me when when he found ____ in my bedroom while I was at work."}
# 569: {active: 1, play: 2, text:"I'm not even aroused by normal porn anymore, I can only get off to ____ or ____."}
# 570: {active: 1, play: 1, text:"____? Oh, yeah, I could get my mouth around that."}
# 571: {active: 1, play: 1, text:"What wouldn't I fuck?"}
# 572: {active: 1, play: 1, text:"When I thought I couldn't go any lower, I realized I would probably fuck ____."}
# 573: {active: 1, play: 1, text:"I knew my boyfriend was a keeper when he said he'd try ____, just for me."}
# 574: {active: 1, play: 2, text:"Fuck ____, get ____."}
# 575: {active: 1, play: 1, text:"I would bend over for ____."}
# 576: {active: 1, play: 1, text:"I think having horns would make ____ complicated."}
# 577: {active: 1, play: 1, text:"In my past life, I was ____."}
# 578: {active: 1, play: 1, text:"____ is my spirit animal."}
# 579: {active: 1, play: 1, text:"____. This is what my life has come to."}
# 580: {active: 1, play: 1, text:"I'm not even sad that I devote at least six hours of each day to ____."}
# 581: {active: 1, play: 1, text:"I never felt more accomplished than when I realized I could fit ____ into my ass."}
# 582: {active: 1, play: 1, text:"Yeah, I know I have a lot of ____ in my favorites, but I'm just here for the art."}
# 583: {active: 1, play: 1, text:"I'm not a 'furry,' I prefer to be called ____."}
# 584: {active: 1, play: 1, text:"Okay, ____? Pretty much the cutest thing ever."}
# 585: {active: 1, play: 1, text:"____. Yeah, that's a pretty interesting way to die."}
# 586: {active: 1, play: 1, text:"I didn't believe the rumors about ____, until I saw the videos."}
# 587: {active: 1, play: 1, text:"I knew I needed to leave the fandom when I realized I was ____."}
# 588: {active: 1, play: 1, text:"After being a furry for so long, I can never see ____ without getting a little aroused."}
# 589: {active: 1, play: 1, text:"It's really hard not to laugh at ____."}
# 590: {active: 1, play: 1, text:"If my parents ever found ____, I'd probably be disowned."}
# 591: {active: 1, play: 1, text:"____ ruined the fandom."}
# 592: {active: 1, play: 1, text:"The most recent item in my search history."}
# 593: {active: 1, play: 1, text:"Is it weird that I want to rub my face on ____?"}
# 594: {active: 1, play: 1, text:"My love for you is like ____. BERSERKER!"}
# 595: {active: 1, play: 2, text:"Last time I took bath salts, I ended up ____ in ____."}
# 596: {active: 1, play: 2, text:"Tara taught me that if you're going to engage in ____, then ____ isn't a good idea."}
# 597: {active: 1, play: 1, text:"The website was almost called 'thatguywith____.com'."}
# 598: {active: 1, play: 1, text:"They even took ____! Who does that?!"}
# 599: {active: 1, play: 1, text:"You may be a robot, but I AM ____!"}
# 600: {active: 1, play: 2, text:"Northernlion's doctor diagnosed him today with ____, an unfortunate condition that would lead to ____."}
# 601: {active: 1, play: 2, text:"And now we're going to be fighting ____ on ____."}
# 602: {active: 1, play: 2, text:"The comment section was nothing but ____ arguing about ____."}
# 603: {active: 1, play: 1, text:"IT'S ____ TIME!"}
# 604: {active: 1, play: 2, text:"It has been said... That there are entire forests of ____, made from the sweetest ____."}
# 605: {active: 1, play: 1, text:"Attention, duelists: My hair is ____."}
# 606: {active: 1, play: 1, text:"What do otaku smell like?"}
# 607: {active: 1, play: 1, text:"And from Kyoto Animation, a show about cute girls doing ____."}
# 608: {active: 1, play: 1, text:"Anime has taught me that classic literature can always be improved by adding ____."}
# 609: {active: 1, play: 1, text:"The moé debate was surprisingly civil until someone mentioned ____."}
# 610: {active: 1, play: 1, text:"That's not a squid! It's ____!"}
# 611: {active: 1, play: 2, text:"The Chocolate Underground stopped the Good For You Party by capturing their ____ and exposing their leader as ____."}
# 612: {active: 1, play: 1, text:"Who cares about the printing press, did that medieval peasant girl just invent ____?!"}
# 613: {active: 1, play: 2, text:"Eating ____ gave me ____."}
# 614: {active: 1, play: 1, text:"The reason I go to church is to learn about ____."}
# 615: {active: 1, play: 2, text:"Show me on ____, where he ____."}
# 616: {active: 1, play: 2, text:"I wouldn't ____ you with ____."}
# 617: {active: 1, play: 1, text:"All attempts at ____, have met with failure and crippling economic sanctions."}
# 618: {active: 1, play: 1, text:"Despite our Administration's best efforts, we are still incapable of ____."}
# 619: {active: 1, play: 1, text:"Technology improves every day. One day soon, surfing the web will be replaced by ____."}
# 620: {active: 1, play: 1, text:"Choosy Moms Choose ____."}
# 621: {active: 1, play: 1, text:"At camp, we'd scare each other by telling stories about ____ around the fire."}
# 622: {active: 1, play: 1, text:"Big Mac sleeps soundly whenever ____ is with him."}
# 623: {active: 1, play: 1, text:"____ is best pony."}
# 624: {active: 1, play: 3, text:"____ should ____ ____."}
# 625: {active: 1, play: 1, text:"____? That's future Spike's problem."}
# 626: {active: 1, play: 1, text:"After a wild night of crusading, Applebloom learned that ____ was her super special talent."}
# 627: {active: 1, play: 1, text:"After a wild night of partying, Fluttershy awakens to find ____ in her bed."}
# 628: {active: 1, play: 1, text:"After living for thousands of years Celestia can only find pleasure in ____."}
# 629: {active: 1, play: 1, text:"Aloe and Lotus have been experimenting with a radical treatment that utilizes the therapeutic properties of ____."}
# 630: {active: 1, play: 1, text:"BUY SOME ____!"}
# 631: {active: 1, play: 1, text:"CUTIE MARK CRUSADERS; ____! YAY!"}
# 632: {active: 1, play: 1, text:"Daring Do and the quest for ____."}
# 633: {active: 1, play: 1, text:"Dear Princess Celestia, Today I learned about ____. "}
# 634: {active: 1, play: 1, text:"Despite everypony's expectations, Sweetie Belle's cutie mark ended up being ____."}
# 635: {active: 1, play: 1, text:"Equestrian researchers have discovered that ____ is The 7th Element of Harmony."}
# 636: {active: 1, play: 2, text:"In a stroke of unparalleled evil, Discord turned ____ into ____."}
# 637: {active: 1, play: 1, text:"In a world without humans, saddles are actually made for ____."}
# 638: {active: 1, play: 1, text:"Inexplicably, the only thing the parasprites wouldn't eat was ____."}
# 639: {active: 1, play: 1, text:"It turns out Hitler's favorite pony was ____."}
# 640: {active: 1, play: 1, text:"It's not a boulder! It's ____!"}
# 641: {active: 1, play: 1, text:"My cutie mark would be ____."}
# 642: {active: 1, play: 1, text:"Nothing makes Pinkie smile more than ____."}
# 643: {active: 1, play: 1, text:"Giggle at ____!"}
# 644: {active: 1, play: 2, text:"I never knew what ____ could be, until you all shared its ____ with me."}
# 645: {active: 1, play: 1, text:"I'd like to be ____."}
# 646: {active: 1, play: 2, text:"Once upon a time, the land of Equestria was ruled by ____ and ____."}
# 647: {active: 1, play: 1, text:"Ponyville is widely known for ____."}
# 648: {active: 1, play: 1, text:"Rarity has a long forgotten line of clothing inspired by ____."}
# 649: {active: 1, play: 1, text:"Rarity was supposed to have a song about ____, but it was cut."}
# 650: {active: 1, play: 1, text:"Rarity's latest dress design was inspired by ____."}
# 651: {active: 1, play: 1, text:"Should the Elements of Harmony fail, ____ is to be used as a last resort."}
# 652: {active: 1, play: 1, text:"____. That is my fetish."}
# 653: {active: 1, play: 1, text:"The Elements of Harmony were originally the Elements of ____."}
# 654: {active: 1, play: 1, text:"When Luna got to the moon, she was greeted with ____."}
# 655: {active: 1, play: 1, text:"____? Oh murr."}
# 656: {active: 1, play: 3, text:"Who dunnit? ____ with ____ in ____."}
# 657: {active: 1, play: 1, text:"When Spike is asleep, Twilight likes to read books about ____."}
# 658: {active: 1, play: 1, text:"Why are you making chocolate pudding at 4 in the morning?"}
# 659: {active: 1, play: 1, text:"The newest feature of the Xbox One is ____."}
# 660: {active: 1, play: 1, text:"PS3: It only does ____."}
# 661: {active: 1, play: 1, text:"The new TF2 promo items are based on ____."}
# 662: {active: 1, play: 1, text:"All you had to do was follow the damn ____, CJ!"}
# 663: {active: 1, play: 1, text:"Liquid! How can you still be alive?"}
# 664: {active: 1, play: 1, text:"What can change the nature of a man?"}
# 665: {active: 1, play: 1, text:" Microsoft revealed that the Xbox One's demos had actually been running on ____ "}
# 666: {active: 1, play: 1, text:"What if ____ was a girl?"}
# 667: {active: 1, play: 1, text:"What did I preorder at gamestop?"}
# 668: {active: 1, play: 1, text:"____ confirmed for Super Smash Bros!"}
# 669: {active: 1, play: 1, text:"Based ____."}
# 670: {active: 1, play: 1, text:"The newest IP from Nintendo, Super ____ Bros. "}
# 671: {active: 1, play: 1, text:"____ only, no items, Final Destination. "}
# 672: {active: 1, play: 1, text:"Enjoy ____ while you play your Xbox one!"}
# 673: {active: 1, play: 1, text:"The future of gaming lies with the ____."}
# 674: {active: 1, play: 1, text:"The best way to be comfy when playing video games is with ____."}
# 675: {active: 1, play: 1, text:"____ has no games."}
# 676: {active: 1, play: 1, text:"PC gamers have made a petition to get ____ on their platform."}
# 677: {active: 1, play: 1, text:"The new Nintendo ____ is a big gimmick. "}
# 678: {active: 1, play: 1, text:"implying you aren't ____"}
# 679: {active: 1, play: 1, text:"WHAT IS A MAN?"}
# 680: {active: 1, play: 2, text:"What is a ___ but a ____?"}
# 681: {active: 1, play: 1, text:"WE WILL DRAG THIS ___ INTO THE 21ST CENTURY."}
# 682: {active: 1, play: 1, text:"All your ____ are belong to us"}
# 683: {active: 1, play: 1, text:"I'm in ur base, ____"}
# 684: {active: 1, play: 1, text:"Pop Quiz: Beatles Song- ___ terday."}
# 685: {active: 1, play: 1, text:" ___ would like to play."}
# 686: {active: 1, play: 1, text:"A mod of doom was made that was based off of ____."}
# 687: {active: 1, play: 1, text:"I really didn't like what they did with the ____ Movie adaption."}
# 688: {active: 1, play: 1, text:"'HEY, GOLLEN PALACE? HOW U SAY ____ IN CHINESE?'"}
# 689: {active: 1, play: 1, text:"Pumpkin doesn't want this."}
# 690: {active: 1, play: 1, text:"NEXT TIME ON GAME GRUMPS: ____."}
# 691: {active: 1, play: 1, text:"I used to be an adventurer like you, until ____."}
# 692: {active: 1, play: 1, text:"Yeah, well, my dad works for ____."}
# 693: {active: 1, play: 1, text:"Kotaku addresses sexism in ____ in their latest article."}
# 694: {active: 1, play: 1, text:"Get double XP for Halo 3 with purchase of ____."}
# 695: {active: 1, play: 1, text:"Sorry Mario, but ____ is in another castle."}
# 696: {active: 1, play: 1, text:"LoL stole their new character design off of ____."}
# 697: {active: 1, play: 1, text:"____ is the cancer killing video games."}
# 698: {active: 1, play: 1, text:"Suffer, like ____ did."}
# 699: {active: 1, play: 1, text:"It's like ____ with guns!"}
# 700: {active: 1, play: 1, text:"Is a man not entitiled to ____?"}
# 701: {active: 1, play: 1, text:"____ has changed."}
# 702: {active: 1, play: 1, text:"But you can call me ____ the ____. Has a nice ring to it dontcha think?"}
# 703: {active: 1, play: 1, text:"Objective: ____"}
# 704: {active: 1, play: 1, text:"EA Sports! It's ____."}
# 705: {active: 1, play: 1, text:"____ is waiting for your challenge!"}
# 706: {active: 1, play: 1, text:"____ sappin' my sentry. "}
# 707: {active: 1, play: 1, text:"I'm here to ____ and chew bubble gum, and I'm all out of gum."}
# 708: {active: 1, play: 1, text:"I've covered ____, you know."}
# 709: {active: 1, play: 1, text:"It's dangerous to go alone! Take this:"}
# 710: {active: 1, play: 1, text:"You were almost a ____ sandwich!"}
# 711: {active: 1, play: 1, text:"That's the second biggest ____ I've ever seen!"}
# 712: {active: 1, play: 1, text:"____. ____ never changes."}
# 713: {active: 1, play: 1, text:"____ has changed. "}
# 714: {active: 1, play: 1, text:"You have been banned. Reason: ____."}
# 715: {active: 1, play: 1, text:"The newest trope against women in video games: ____."}
# 716: {active: 1, play: 1, text:"Fans started a kickstarter for a new ____ game. "}
# 717: {active: 1, play: 1, text:"Huh? What was that noise?"}
# 718: {active: 1, play: 1, text:"Viral marketers are trying to push the new ____."}
# 719: {active: 1, play: 1, text:"I wouldn't call it a Battlestation, more like a ____."}
# 720: {active: 1, play: 1, text:"____: Gotta go fast!"}
# 721: {active: 1, play: 1, text:"The best final fantasy game was ____."}
# 722: {active: 1, play: 1, text:"I love the ____, it's so bad"}
# 723: {active: 1, play: 1, text:"Valve is going to make ____ 2 before they release Half Life 3."}
# 724: {active: 1, play: 1, text:"____ is a pretty cool guy"}
# 725: {active: 1, play: 1, text:"Ah! Your rival! What was his name again?"}
# 726: {active: 1, play: 2, text:"Why is the ____ fandom the worst?"}
# 727: {active: 1, play: 1, text:"Achievement Unlocked: ____ !"}
# 728: {active: 1, play: 1, text:"I'm ____ under the table right now!"}
# 729: {active: 1, play: 1, text:"brb guys, ____ break"}
# 730: {active: 1, play: 1, text:"OH MY GOD JC, A ____"}
# 731: {active: 1, play: 1, text:"wooooooow, it took all 3 of you to ____"}
# 732: {active: 1, play: 1, text:"Rev up those ____, because I am sure hungry for one- HELP! HELP!"}
# 733: {active: 1, play: 1, text:"____ is 2deep and edgy for you."}
# 734: {active: 1, play: 1, text:"Only casuals like ____."}
# 735: {active: 1, play: 1, text:"The princess is in another ____"}
# 736: {active: 1, play: 1, text:"I have the bigger ____."}
# 737: {active: 1, play: 1, text:"____ TEAM RULES!!"}
# 738: {active: 1, play: 1, text:"When you see it... you don't see ____."}
# 739: {active: 1, play: 1, text:"HEY, GOLLEN PALACE? HOW U SAY ____ IN CHINESE?"}
# 740: {active: 1, play: 1, text:"WHAT THE FUCK DID YOU SAY ABOUT ME YOU ____?"}
# 741: {active: 1, play: 1, text:"This will be the 6th time we've posted ____; we've become increasingly efficient at it."}
# 742: {active: 1, play: 1, text:"appealing to a larger audience"}
# 743: {active: 1, play: 1, text:"we must embrace ____ and burn it as fuel for out journey."}
# 744: {active: 1, play: 1, text:"In Kingdom Hearts, Donald Duck will be replaced with ____ ."}
# 745: {active: 1, play: 1, text:"____ is a lie."}
# 746: {active: 1, play: 1, text:"Because of the lastest school shooting, ____ is being blamed for making kids too violent."}
# 747: {active: 1, play: 1, text:"Here lies ____: peperony and chease"}
# 748: {active: 1, play: 1, text:"Throwaway round: Get rid of those shit cards you don't want. Thanks for all the suggestions, /v/"}
# 749: {active: 1, play: 1, text:"The president has been kidnapped by ____. Are you a bad enough dude to rescue the president?"}
# 750: {active: 1, play: 1, text:"We ____ now."}
# 751: {active: 1, play: 1, text:"What is the new mustard paste?"}
# 752: {active: 1, play: 2, text:"All you had to do was ____ the damn ____!"}
# 753: {active: 1, play: 2, text:"The new ititeration in the Call of Duty franchise has players fighting off ____ deep in the jungles of ____ "}
# 754: {active: 1, play: 2, text:"Check your privilege, you ____ ____."}
# 755: {active: 1, play: 2, text:"Jill, here's a ____. It might come in handy if you, the master of ____, take it with you. "}
# 756: {active: 1, play: 2, text:"____ is a pretty cool guy, eh ____ and doesn't afraid of anything."}
# 757: {active: 1, play: 2, text:"It's like ____with ____!"}
# 758: {active: 1, play: 1, text:"I never thought I'd be comfortable with ____, but now it's pretty much the only thing I masturbate to."}
# 759: {active: 1, play: 1, text:"My next fursuit will have ____."}
# 760: {active: 1, play: 2, text:"I'm writing a porn comic about ____ and ____. "}
# 761: {active: 1, play: 1, text:"I tell everyone that I make my money off 'illustration,' when really, I just draw ____."}
# 762: {active: 1, play: 1, text:"Oh, you're an artist? Could you draw ____ for me?"}
# 763: {active: 1, play: 1, text:"Everyone thinks they're so great, but the only thing they're good at drawing is ____."}
# 764: {active: 1, play: 1, text:"They're just going to spend all that money on ____."}
# 765: {active: 1, play: 1, text:"While everyone else seems to have a deep, instinctual fear of ____, it just turns me on."}
# 766: {active: 1, play: 2, text:"Lying about having ____ to get donations, which you spend on ____."}
# 767: {active: 1, play: 1, text:"It's not bestiality, it's ____."}
# 768: {active: 1, play: 1, text:"Everyone thinks that because I'm a furry, I'm into ____. Unfortunately, they're right."}
# 769: {active: 1, play: 1, text:"I'm only gay for ____."}
# 770: {active: 1, play: 1, text:"Excuse you, I'm a were-____."}
# 771: {active: 1, play: 1, text:"If you like it, then you should put ____ on it."}
# 772: {active: 1, play: 1, text:"My girlfriend won't let me do ____."}
# 773: {active: 1, play: 1, text:"The most pleasant surprise I've had this year."}
# 774: {active: 1, play: 2, text:"I knew I had a problem when I had to sell ____ to pay for ____."}
# 775: {active: 1, play: 1, text:"I'm about 50% ____."}
# 776: {active: 1, play: 1, text:"____: Horrible tragedy, or sexual opportunity?"}
# 777: {active: 1, play: 1, text:"It's a little worrying that I have to compare the size of ____ to beverage containers."}
# 778: {active: 1, play: 2, text:"Hey, you guys wanna come back to my place? I've got ____ and ____."}
# 779: {active: 1, play: 1, text:"Jizzing all over ____."}
# 780: {active: 1, play: 1, text:"It's just that much creepier when 40-year-old men are into ____."}
# 781: {active: 1, play: 1, text:"____ is no substitute for social skills, but it's a start."}
# 782: {active: 1, play: 1, text:"The real reason I got into the fandom? ____."}
# 783: {active: 1, play: 1, text:"____ are definitely the new huskies."}
# 784: {active: 1, play: 1, text:"I remember when ____ was just getting started."}
# 785: {active: 1, play: 1, text:"When no one else is around, sometimes I consider doing things with ____."}
# 786: {active: 1, play: 1, text:"Actually coming inside ____."}
# 787: {active: 1, play: 1, text:"I don't know how we got on the subject of dragon cocks, but it probably started with ____."}
# 788: {active: 1, play: 1, text:"____ is a shining example of what those with autism can really do."}
# 789: {active: 1, play: 1, text:"It is my dream to be covered with ____."}
# 790: {active: 1, play: 2, text:"____ fucking ____. Now that's hot."}
# 791: {active: 1, play: 2, text:"Would you rather suck ____, or get dicked by ____?"}
# 792: {active: 1, play: 2, text:"It never fails to liven up the workplace when you ask your coworkers if they'd rather have sex with ____ or ____."}
# 793: {active: 1, play: 1, text:"HELLO FURRIEND, HOWL ARE YOU DOING?"}
# 794: {active: 1, play: 2, text:"What are the two worst cards in your hand right now?"}
# 795: {active: 1, play: 1, text:"Nobody believes me when I tell that one story about walking in on ____."}
# 796: {active: 1, play: 2, text:"You don't know who ____ is? They're the one that draws ____."}
# 797: {active: 1, play: 1, text:"You sometimes wish you'd encounter ____ while all alone, in the woods. With a bottle of lube."}
# 798: {active: 1, play: 1, text:"I used to avoid talking about ____, but now it's just a part of normal conversation with my friends."}
# 799: {active: 1, play: 1, text:"The most controversial game at PAX this year is an 8-bit indie platformer about ____. (38/44)"}
# 800: {active: 1, play: 2, text:"Zecora is a well known supplier of ____ and ____."}
# 801: {active: 1, play: 1, text:"There was a riot at the Gearbox panel when they gave the attendees ____. (41/44)"}
# 802: {active: 1, play: 1, text:"The most controversial game at PAX this year is an 8-bit indie platformer about ____."}
# 803: {active: 1, play: 1, text:"What made Spock cry?"}
# 804: {active: 1, play: 1, text:"____: Achievement unlocked."}
# 805: {active: 1, play: 1, text:"What's the latest bullshit that's troubling this quaint fantasy town?"}
# 806: {active: 1, play: 1, text:"____ didn't make it onto the first AT4W DVD."}
# 807: {active: 1, play: 1, text:"____ is part of the WTFIWWY wheelhouse."}
# 808: {active: 1, play: 1, text:"____ is the subject of the Critic's newest review."}
# 809: {active: 1, play: 1, text:"____ is the subject of the missing short from The Uncanny Valley."}
# 810: {active: 1, play: 1, text:"____ needs more gay."}
# 811: {active: 1, play: 1, text:"____ wound up in this week's top WTFIWWY story."}
# 812: {active: 1, play: 1, text:"After getting snowed in at MAGfest, the reviewers were stuck with ____."}
# 813: {active: 1, play: 1, text:"ALL OF ____."}
# 814: {active: 1, play: 1, text:"Being done with My Little Pony, 8-Bit Mickey has moved onto ____."}
# 815: {active: 1, play: 1, text:"Birdemic 3: ____"}
# 816: {active: 1, play: 1, text:"Florida's new crazy is about ____."}
# 817: {active: 1, play: 1, text:"Hello, I'm a ____."}
# 818: {active: 1, play: 1, text:"IT'S NOT ____!"}
# 819: {active: 1, play: 1, text:"It's not nudity if there's ____."}
# 820: {active: 1, play: 1, text:"MikeJ's next sexual conquest is ____."}
# 821: {active: 1, play: 1, text:"Nash had a long day at work, so tonight he'll stream ____."}
# 822: {active: 1, play: 1, text:"Nash rejected yet another RDA request for ____."}
# 823: {active: 1, play: 1, text:"Nash's recent rant about Microsoft led to ____."}
# 824: {active: 1, play: 1, text:"Nash's Reviewer Spotlight featured ____."}
# 825: {active: 1, play: 1, text:"New rule in the RDA Drinking Game: Every time ____ happens, take a shot!"}
# 826: {active: 1, play: 1, text:"The best Bad Movie Beatdown sketch is where Film Brain ropes Lordhebe into ____."}
# 827: {active: 1, play: 1, text:"The controversy over ad-blocking could be easily solved by ____."}
# 828: {active: 1, play: 1, text:"The easiest way to counteract a DMCA takedown notice is with ____."}
# 829: {active: 1, play: 1, text:"The new site that will overtake TGWTG is ____."}
# 830: {active: 1, play: 1, text:"The newest Rap Libs makes extensive use of the phrase '____.'"}
# 831: {active: 1, play: 1, text:"The theme of this week's WTFIWWY is ____."}
# 832: {active: 1, play: 1, text:"What is literally the only thing tastier than a dragon's soul?"}
# 833: {active: 1, play: 1, text:"What is the name of the next new Channel Awesome contributor?"}
# 834: {active: 1, play: 1, text:"What killed Harvey Finevoice's son?"}
# 835: {active: 1, play: 1, text:"What made Dodger ban someone from the RDA chat this week?"}
# 836: {active: 1, play: 2, text:"The next TGWTG porn spoof? ____ with ____!"}
# 837: {active: 1, play: 2, text:"Putting ____ in ____? That doesn't go there!"}
# 838: {active: 1, play: 2, text:"In trying to ban ____, Florida accidentally banned ____."}
# 839: {active: 1, play: 2, text:"If ____ got to direct an Uncanny Valley short, it would have featured ____."}
# 840: {active: 1, play: 2, text:"At MAGFest, ____ will host a panel focusing on ____."}
# 841: {active: 1, play: 2, text:"'Greetings, dear listeners. Won't you join ____ for ____?'"}
# 842: {active: 1, play: 2, text:"I'm going to die watching ____ review ____."}
# 843: {active: 1, play: 2, text:"In a new latest announcement video, ____ has announced an appearance at ____."}
# 844: {active: 1, play: 2, text:"____ and ____ would make awesome siblings."}
# 845: {active: 1, play: 2, text:"Some fangirls lay awake all night thinking of ____ and ____ together."}
# 846: {active: 1, play: 2, text:"In my new show, I review ____ while dressed like ____."}
# 847: {active: 1, play: 2, text:"Luke's newest character is ____, the Inner ____."}
# 848: {active: 1, play: 2, text:"Good evening! I am ____ of ____."}
# 849: {active: 1, play: 2, text:"____ is the reason that ____ picked 'AIDS.'"}
# 850: {active: 1, play: 3, text:"Nash's newest made-up curse word is ____-____-____! "}
# 851: {active: 1, play: 3, text:"Using alchemy, combine ____ and ____ to make ____! "}
# 852: {active: 1, play: 3, text:"Nash will build his next contraption with just ____, ____, and ____."}
# 853: {active: 1, play: 3, text:" ____ did ____ to avoid ____."}
# 854: {active: 1, play: 3, text:"Make a WTFIWWY story."}
# 855: {active: 1, play: 1, text:"Dang it, ____!"}
# 856: {active: 1, play: 1, text:"____ was full of leeches."}
# 857: {active: 1, play: 1, text:"Pimp your ___!"}
# 858: {active: 1, play: 1, text:"My apologies to the ____ estate."}
# 859: {active: 1, play: 1, text:"What interrupted the #NLSS?"}
# 860: {active: 1, play: 1, text:"Travel by ____."}
# 861: {active: 1, play: 1, text:"Say that to my face one more time and I'll start ____."}
# 862: {active: 1, play: 1, text:"Oh my god, he's using ____ magic!"}
# 863: {active: 1, play: 1, text:"____ has invaded!"}
# 864: {active: 1, play: 1, text:"We're having technical difficulties due to ____."}
# 865: {active: 1, play: 1, text:"Ohmwrecker is known for his MLG online play. What people don't know is that he's also MLG at ____."}
# 866: {active: 1, play: 1, text:"The next movie reading will be of ____."}
# 867: {active: 1, play: 1, text:"How did Northernlion unite Scotland?"}
# 868: {active: 1, play: 1, text:"Green loves the new Paranautical Activity item ____, but keeps comparing it to the crossbow."}
# 869: {active: 1, play: 1, text:"____ is really essential to completing the game."}
# 870: {active: 1, play: 1, text:"My channel is youtube.com/____."}
# 871: {active: 1, play: 1, text:"Hello anybody, I am ____Patrol."}
# 872: {active: 1, play: 2, text:"I have ____, can you ____ me?"}
# 873: {active: 1, play: 2, text:"____! Get off the ____!"}
# 874: {active: 1, play: 2, text:"My name is ____ and today we'll be checking out ____."}
# 875: {active: 1, play: 2, text:"That's the way ____ did it, that's the way ____ does it, and it''s worked out pretty well so far."}
# 876: {active: 1, play: 3, text:"This time on ____ vs. ____, we're playing ____."}
# 877: {active: 1, play: 1, text:"Welcome back to ____."}
# 878: {active: 1, play: 1, text:"Welcome to Sonic Team! We make ____, I think!"}
# 879: {active: 1, play: 1, text:"What am I willing to put up with today?"}
# 880: {active: 1, play: 1, text:"What is the boopinest shit?"}
# 881: {active: 1, play: 1, text:"WHAT THE FUCK IS A ____?!"}
# 882: {active: 1, play: 1, text:"When I look in the mirror I see ____."}
# 883: {active: 1, play: 1, text:"Who's an asshole?"}
# 884: {active: 1, play: 1, text:"WOOP WOOP WOOP I'M A ____!"}
# 885: {active: 1, play: 1, text:"You know what fan mail makes me the happiest every time I see it? It's the ones where people are like, '____.' "}
# 886: {active: 1, play: 1, text:"You're ruining my integrity! ____ won't hire me now!"}
# 887: {active: 1, play: 1, text:"I've been ____ again!"}
# 888: {active: 1, play: 1, text:"Rolling around at the speed of ____!"}
# 889: {active: 1, play: 1, text:"Use your ____!"}
# 890: {active: 1, play: 1, text:"Look at this guy, he's like ____."}
# 891: {active: 1, play: 1, text:"Look, it's ____!"}
# 892: {active: 1, play: 1, text:"Nightshade: The Claws of ____."}
# 893: {active: 1, play: 1, text:"Number one! With a bullet! Zoom in on the ____!"}
# 894: {active: 1, play: 1, text:"Oh, it's ____!"}
# 895: {active: 1, play: 1, text:"One slice of ____ please."}
# 896: {active: 1, play: 1, text:"Pikachu, use your ____ attack!"}
# 897: {active: 1, play: 1, text:"Put a hole in that ____!"}
# 898: {active: 1, play: 1, text:"Real talk? ____."}
# 899: {active: 1, play: 1, text:"Jon's mom called him to tell him about ____."}
# 900: {active: 1, play: 1, text:"Kirby has two iconic abilities: suck and ____."}
# 901: {active: 1, play: 1, text:"Listen to the ____ on this shit."}
# 902: {active: 1, play: 1, text:"Jon believes that the most important part of any video game is ____."}
# 903: {active: 1, play: 1, text:"Jon can't get enough of ____."}
# 904: {active: 1, play: 1, text:"Jon can't survive air travel without ____."}
# 905: {active: 1, play: 1, text:"Jon just wants to touch ____."}
# 906: {active: 1, play: 1, text:"Is there anything to gain from this?"}
# 907: {active: 1, play: 1, text:"It's no use! Take ____!"}
# 908: {active: 1, play: 1, text:"If the ____ wasn't there, I would do. But it's there, so it's not."}
# 909: {active: 1, play: 1, text:"How many nose hairs does ____ have?"}
# 910: {active: 1, play: 1, text:"I certainly can't do it without you, and I know you can't do it without ____!"}
# 911: {active: 1, play: 1, text:"I tell you once, I tell you twice! ____ is good for economy!"}
# 912: {active: 1, play: 1, text:"I wanna put my ____ in her!"}
# 913: {active: 1, play: 1, text:"I'm not even SELLING ____!"}
# 914: {active: 1, play: 1, text:"Do you remember the episode where Ash caught a ____?"}
# 915: {active: 1, play: 1, text:"Don't throw ____! It's expensive to somebody!"}
# 916: {active: 1, play: 1, text:"Dude, real talk? ____."}
# 917: {active: 1, play: 1, text:"Eat your ____, son."}
# 918: {active: 1, play: 1, text:"Egoraptor's fiancee is actually a ____."}
# 919: {active: 1, play: 1, text:"Everybody wants to know about me, but they don't know about my ____."}
# 920: {active: 1, play: 1, text:"Fool me once, I'm mad. Fool me twice? How could you. Fool me three times, you're officially ____."}
# 921: {active: 1, play: 1, text:"For my first attack, I will juggle ____ to impress you."}
# 922: {active: 1, play: 1, text:"Fuck, I found a ____."}
# 923: {active: 1, play: 1, text:"Give ____ a chance! He'll grow on you!"}
# 924: {active: 1, play: 1, text:"____? Ten-outta-ten!"}
# 925: {active: 1, play: 1, text:"____. I AAAAAAIN’T HAVIN’ THAT SHIT!"}
# 926: {active: 1, play: 1, text:"____. It's no use!"}
# 927: {active: 1, play: 1, text:"____. MILLIONS ARE DEAD!!!"}
# 928: {active: 1, play: 1, text:"____. This is like one of my Japanese animes!"}
# 929: {active: 1, play: 1, text:"...What the bloody hell are you two talking about?!"}
# 930: {active: 1, play: 1, text:"'You want cheese pizza?' 'No. ____.'"}
# 931: {active: 1, play: 1, text:"And then, as a fuckin' goof, I'd put a hole in ____."}
# 932: {active: 1, play: 1, text:"And there it was...Kirby had finally met the ____ of the lost city."}
# 933: {active: 1, play: 1, text:"It took hours to edit ____ into the video."}
# 934: {active: 1, play: 1, text:"Arin believes that the most important part of any video game is ____."}
# 935: {active: 1, play: 1, text:"Arin has an adverse reaction to ____."}
# 936: {active: 1, play: 1, text:"Barry entertains himself by watching old episodes of ____."}
# 937: {active: 1, play: 1, text:"Barry, add ____ into the video!"}
# 938: {active: 1, play: 1, text:"Barry, we need a replay on ____."}
# 939: {active: 1, play: 1, text:"BARRY! SHOW ____ AGAIN!"}
# 940: {active: 1, play: 1, text:"Barry's sheer skill at ____ is unmatched."}
# 941: {active: 1, play: 1, text:"I don't like the ____ flavor."}
# 942: {active: 1, play: 1, text:"____ don't even cost this less!"}
# 943: {active: 1, play: 1, text:"____ has aged really well."}
# 944: {active: 1, play: 1, text:"____ is GREAT GREAT GREAT!"}
# 945: {active: 1, play: 1, text:"____ Train!"}
# 946: {active: 1, play: 1, text:"____ WINS!"}
# 947: {active: 1, play: 1, text:"____: Better than deer shit!"}
# 948: {active: 1, play: 2, text:"Welcome back to ____ ____!"}
# 949: {active: 1, play: 2, text:"Real talk? Is that ____ ____?"}
# 950: {active: 1, play: 2, text:"Look at that ____-ass ____!"}
# 951: {active: 1, play: 2, text:"JON'S ____, SHOW US YOUR ____."}
# 952: {active: 1, play: 2, text:"If you don't know what ____ is, you can't go to ____."}
# 953: {active: 1, play: 2, text:"IF I CAN'T BE ____, I SURE AS HELL CAN BE ____!!"}
# 954: {active: 1, play: 2, text:"COME ON AND ____, AND WELCOME TO THE ____!"}
# 955: {active: 1, play: 3, text:"If ____ evolved from ____, why the fuck is there still ____, dude?!"}
# 956: {active: 1, play: 3, text:"____? Pretty smart. ____? Pretty fuckin' smart. ____? FUCKING GENIUS!!!!"}
# 957: {active: 1, play: 1, text:"____ is the greatest Canadian."}
# 958: {active: 1, play: 1, text:"____ is the worst on the Podcast."}
# 959: {active: 1, play: 1, text:"____. That's top."}
# 960: {active: 1, play: 1, text:"After getting wasted at PAX, Burnie announced that 'I am ____!'"}
# 961: {active: 1, play: 1, text:"Barbara sucks ____."}
# 962: {active: 1, play: 1, text:"Close up of my ____."}
# 963: {active: 1, play: 1, text:"Come to Fort ____!"}
# 964: {active: 1, play: 1, text:"Describe yourself in one word/phrase."}
# 965: {active: 1, play: 1, text:"Detective ____ is down!"}
# 966: {active: 1, play: 1, text:"Does our house say 'We love ____?'"}
# 967: {active: 1, play: 1, text:"Dude, I got sixteen ____!"}
# 968: {active: 1, play: 1, text:"Fight, fight, fight, ____?"}
# 969: {active: 1, play: 1, text:"Fuck it, I mean ____, right?"}
# 970: {active: 1, play: 1, text:"I'ma smother you in my ____!"}
# 971: {active: 1, play: 1, text:"If you could fuck anyone in the world, who would you choose?"}
# 972: {active: 1, play: 1, text:"If you could have any superpower, what would it be?"}
# 973: {active: 1, play: 1, text:"If you were allowed to do one illegal thing, what would it be? "}
# 974: {active: 1, play: 1, text:"It's a ____ out there."}
# 975: {active: 1, play: 1, text:"It's not my fault. Somebody put ____ in my way."}
# 976: {active: 1, play: 1, text:"Joel plays ____."}
# 977: {active: 1, play: 1, text:"Let's do ____ again! This is fun!"}
# 978: {active: 1, play: 1, text:"Lindsay could fuck up ____."}
# 979: {active: 1, play: 1, text:"LLLLLLLLLLLLLET'S ____!"}
# 980: {active: 1, play: 1, text:"My ____ is trying to die."}
# 981: {active: 1, play: 1, text:"On tonight's Let's Play, the AH crew plays ____."}
# 982: {active: 1, play: 1, text:"People like ____."}
# 983: {active: 1, play: 1, text:"RT Recap, featuring ____!"}
# 984: {active: 1, play: 1, text:"Shout out to ____!"}
# 985: {active: 1, play: 1, text:"Shout out to my mom. Called my Teddy Bear ____."}
# 986: {active: 1, play: 1, text:"So, I was just walking along, until suddenly ____ came along and attacked me."}
# 987: {active: 1, play: 1, text:"Thanks to ____ for this week's theme song."}
# 988: {active: 1, play: 1, text:"This week on AHWU, ____."}
# 989: {active: 1, play: 1, text:"This week on Immersion, we are going to test ____."}
# 990: {active: 1, play: 1, text:"What are fire hydrants called in England?"}
# 991: {active: 1, play: 1, text:"What is Game Night?"}
# 992: {active: 1, play: 1, text:"What is the meaning of life?"}
# 993: {active: 1, play: 1, text:"What is the saddest thing you've ever seen?"}
# 994: {active: 1, play: 1, text:"What is the worst thing anyone could say in front of the police?"}
# 995: {active: 1, play: 1, text:"What is your biggest feature?"}
# 996: {active: 1, play: 1, text:"What is your favorite book?"}
# 997: {active: 1, play: 1, text:"What is your mating call?"}
# 998: {active: 1, play: 1, text:"What makes Caboose angry?"}
# 999: {active: 1, play: 1, text:"What would be your chosen catchphrase?"}
# 1000: {active: 1, play: 1, text:"Where are we going for lunch?"}
# 1001: {active: 1, play: 1, text:"Who has a fake Internet girlfriend?"}
# 1002: {active: 1, play: 1, text:"Why are we here?"}
# 1003: {active: 1, play: 1, text:"Would you guys still like me if my name was ____?"}
# 1004: {active: 1, play: 1, text:"You threw it against the wall like a ____!"}
# 1005: {active: 1, play: 2, text:"____ is ____ as dicks."}
# 1006: {active: 1, play: 2, text:"____ is the best ____ ever. Of all time."}
# 1007: {active: 1, play: 2, text:"____ wins! ____ is a horse!"}
# 1008: {active: 1, play: 2, text:"If you got $1,000,000 per week, would you ____, but in the next day, you'd have to ____?"}
# 1009: {active: 1, play: 2, text:"My name is ____, and I hate ____!"}
# 1010: {active: 1, play: 2, text:"No one in the office expected the bromance between ____ and ____."}
# 1011: {active: 1, play: 2, text:"Select two cards to create your team name."}
# 1012: {active: 1, play: 3, text:"This week on VS, ____ challenges ____ to a game of ____."}
# 1013: {active: 1, play: 3, text:"The war's over. We're holding a parade in ____'s honor. ____ drives the float, and ____ is in charge of confetti."}
# 1014: {active: 1, play: 1, text:"What's a paladin?"}
# 1015: {active: 1, play: 1, text:"One of these days i'm just gonna shit my ____."}
# 1016: {active: 1, play: 1, text:"You need to ____ your asshole, it's vital to this operation."}
# 1017: {active: 1, play: 1, text:"I'm sorry Timmy, but I must ____ you."}
# 1018: {active: 1, play: 1, text:"In this week's gauntlet, Tehsmarty challenges ChilledChaos to ____."}
# 1019: {active: 1, play: 1, text:"In this week's gauntlet, ChilledChaos challenges Tehsmarty to ____."}
# 1020: {active: 1, play: 1, text:"I AM THE ____ CZAR!!!"}
# 1021: {active: 1, play: 1, text:"ZeRoyalViking's up and coming game company, 'ZEA' accredits their success to ____."}
# 1022: {active: 1, play: 1, text:"Tehsmarty loves the smell of ____ in the morning."}
# 1023: {active: 1, play: 1, text:"The Creatures' next member is ____."}
# 1024: {active: 1, play: 1, text:"Come on and slam, and welcome to the ____."}
# 1025: {active: 1, play: 1, text:"____, the one you want to get DDoS'd"}
# 1026: {active: 1, play: 2, text:"Why are there six ____ when there are only four ____?"}
# 1027: {active: 1, play: 1, text:"GaLmHD is so pro at almost every game he plays yet he can`t play____!"}
# 1028: {active: 1, play: 1, text:"Smarty's darkest fear is ____."}
# 1029: {active: 1, play: 1, text:"Pewdiepie's going to play ____!?"}
# 1030: {active: 1, play: 1, text:"And here we have ____. Strike it's weakness for MASSIVE damage!"}
# 1031: {active: 1, play: 1, text:"But Beardman! Why do you think that ____?"}
# 1032: {active: 1, play: 1, text:"In the next episode of Press Heart to Continue: Dodger talks about ____."}
# 1033: {active: 1, play: 1, text:"What did Criken do this time to break ARMA III? "}
# 1034: {active: 1, play: 1, text:"What was the big prize this time around at the Thrown Controllers panel?"}
# 1035: {active: 1, play: 1, text:"What did Mitch or Bajan Canadian find in the fridge today?"}
# 1036: {active: 1, play: 1, text:"In ____ We Trust."}
# 1037: {active: 1, play: 1, text:"When Sp00n finally removed his horsemask on the livestream, we saw ____."}
# 1038: {active: 1, play: 1, text:"I give this game a rating of ____."}
# 1039: {active: 1, play: 1, text:"What did Pewdiepie overreact to on his channel today?"}
# 1040: {active: 1, play: 1, text:"This time on Brutalmoose's Top 10, his guest was ____."}
# 1041: {active: 1, play: 1, text:"Only Totalbiscuit would spend an hour long video discussing ____."}
# 1042: {active: 1, play: 1, text:"Last Thursday, Riorach was identified in public and she proceeded to ____."}
# 1043: {active: 1, play: 1, text:"On this episode of PKA Woody and Wings talk about ____."}
# 1044: {active: 1, play: 1, text:"Bro's Angels. We ____ hard."}
# 1045: {active: 1, play: 1, text:"TotalBiscuit's top hat is actually ____. "}
# 1046: {active: 1, play: 2, text:"GTA shenanigans would not be GTA shenanigans without Seananners dropping ____ on ____."}
# 1047: {active: 1, play: 2, text:"Knowing Chilled's knowledge with Minecraft, he'll probably use ____ on ____ in his next video."}
# 1048: {active: 1, play: 2, text:"Oh great, ____ is doing another ____ game LP."}
# 1049: {active: 1, play: 2, text:"In his new Co-op work SSoHPKC will be playing ____ with ____."}
# 1050: {active: 1, play: 2, text:"My name is-a ____ and i likea da ____."}
# 1051: {active: 1, play: 1, text:"In today's Driftor in-depth episode we shall look at ____."}
# 1052: {active: 1, play: 1, text:"The Xbox One's DRM policy isn't half as bad as ____."}
# 1053: {active: 1, play: 1, text:"What will YouTube add in its next unneeded update?"}
# 1054: {active: 1, play: 1, text:"Two Best Friends Play ____."}
# 1055: {active: 1, play: 1, text:"There was a riot at the Gearbox panel when they gave the attendees ____."}
# 1056: {active: 1, play: 1, text:"In the new DLC for Mass Effect, Shepard must save the galaxy from ____."}
# 1057: {active: 1, play: 1, text:"No Enforcer wants to manage the panel on ____."}
# 1058: {active: 1, play: 1, text:"What's fun until it gets weird?"}
# 1059: {active: 1, play: 1, text:"Wes Anderson's new film tells the story of a precocious child coming to terms with ____."}
# 1060: {active: 1, play: 1, text:"I'm sorry, sir, but we don't allow ____ at the country club."}
# 1061: {active: 1, play: 1, text:"How am I compensating for my tiny penis?"}
# 1062: {active: 1, play: 1, text:"You've seen the bearded lady! You've seen the ring of fire! Now, ladies and gentlemen, feast your eyes upon ____!"}
# 1063: {active: 1, play: 1, text:"She's up all night for good fun. I'm up all night for ____."}
# 1064: {active: 1, play: 1, text:"Dear Leader Kim Jong-un, our village praises your infinite wisdom with a humble offering of ____."}
# 1065: {active: 1, play: 1, text:"Man, this is bullshit. Fuck ____."}
# 1066: {active: 1, play: 3, text:"You guys, I saw this crazy movie last night. It opens on ____, and then there's some stuff about ____, and then it ends with ____."}
# 1067: {active: 1, play: 2, text:"In return for my soul, the Devil promised me ____, but all I got was ____."}
# 1068: {active: 1, play: 1, text:"The Japanese have developed a smaller, more efficient version of ____."}
# 1069: {active: 1, play: 1, text:"Alright, bros. Our frat house is condemned, and all the hot slampieces are over at Gamma Phi. The time has come to commence Operation ____."}
# 1070: {active: 1, play: 1, text:"This is the prime of my life. I'm young, hot, and full of ____."}
# 1071: {active: 1, play: 1, text:"I'm pretty sure I'm high right now, because I'm absolutely mesmerized by ____."}
# 1072: {active: 1, play: 1, text:"It lurks in the night. It hungers for flesh. This summer, no one is safe from ____."}
# 1073: {active: 1, play: 2, text:"If you can't handle ____, you'd better stay away from ____."}
# 1074: {active: 1, play: 2, text:"Forget everything you know about ____, because now we've supercharged it with ____!"}
# 1075: {active: 1, play: 2, text:"Honey, I have a new role-play I want to try tonight! You can be ____, and I'll be ____."}
# 1076: {active: 1, play: 2, text:"This year's hottest album is '____' by ____."}
# 1077: {active: 1, play: 2, text:"Every step towards ____ gets me a little closer to ____."}
# 1078: {active: 1, play: 1, text:"Do not fuck with me! I am literally ____ right now."}
# 1079: {active: 1, play: 1, text:"2 AM in the city that never sleeps. The door swings open and she walks in, legs up to here. Something in her eyes tells me she's looking for ____."}
# 1080: {active: 1, play: 1, text:"As king, how will I keep the peasants in line?"}
# 1081: {active: 1, play: 2, text:"I am become ____, destroyer of ____!"}
# 1082: {active: 1, play: 2, text:"In the beginning, there was ____. And the Lord said, 'Let there be ____.'"}
# 1083: {active: 1, play: 2, text:"____ will never be the same after ____."}
# 1084: {active: 1, play: 2, text:"We never did find ____, but along the way we sure learned a lot about ____."}
# 1085: {active: 1, play: 2, text:"____ may pass, but ____ will last forever."}
# 1086: {active: 1, play: 2, text:"Adventure. Romance. ____. From Paramount Pictures, '____.'"}
# 1087: {active: 1, play: 1, text:"The seldomly mentioned 4th little pig built his house out of ____."}
# 1088: {active: 1, play: 1, text:"Mom, I swear! Despite its name, ____ is NOT a porno!"}
# 1089: {active: 1, play: 2, text:"Oprah's book of the month is '____ For ____: A Story of Hope.'"}
# 1090: {active: 1, play: 2, text:"But wait, there's more! If you order ____ in the next 15 minutes, we'll throw in ____ absolutely free!"}
# 1091: {active: 1, play: 1, text:"Blessed are you, Lord our God, creator of the universe, who has granted us ____."}
# 1092: {active: 1, play: 2, text:"That fucking idiot ____ ragequit the fandom over ____."}
# 1093: {active: 1, play: 1, text:"Because they are forbidden from masturbating, Mormons channel their repressed sexual energy into ____."}
# 1094: {active: 1, play: 1, text:"I really hope my grandmother doesn't ask me to explain ____ again."}
# 1095: {active: 1, play: 1, text:"What's the one thing that makes an elf instantly ejaculate?"}
# 1096: {active: 1, play: 1, text:"GREETINGS HUMANS. I AM ____ BOT. EXECUTING PROGRAM"}
# 1097: {active: 1, play: 1, text:"Kids these days with their iPods and their Internet. In my day, all we needed to pass the time was ____."}
# 1098: {active: 1, play: 1, text:"I always ____ ass - razor1000."}
# 1099: {active: 1, play: 1, text:"____ for temperature. "}
# 1100: {active: 1, play: 1, text:"Not asking for upvotes but ____."}
# 1101: {active: 1, play: 1, text:"I got ____ to the frontpage "}
# 1102: {active: 1, play: 1, text:"I know this is going to get downvoted to hell but ____."}
# 1103: {active: 1, play: 1, text:"I know this is a selfie but ____."}
# 1104: {active: 1, play: 1, text:"Imgur: where the points don’t matter and the ____ is made up."}
# 1105: {active: 1, play: 1, text:"If you could stop ____, that’d be greeeeattt. "}
# 1106: {active: 1, play: 1, text:"ERMAGERD! ____."}
# 1107: {active: 1, play: 1, text:"Not sure if Imgur reference or ____."}
# 1108: {active: 1, play: 1, text:"Having a bit of fun with the new ____."}
# 1109: {active: 1, play: 1, text:"Press 0 twice for ____."}
# 1110: {active: 1, play: 1, text:"No, no, you leave ____. We no like you."}
# 1111: {active: 1, play: 1, text:"FOR ____!!!!"}
# 1112: {active: 1, play: 2, text:"If ____ happens because of ____, I will eat my socks."}
# 1113: {active: 1, play: 1, text:"Put that ____ back where it came from or so help me."}
# 1114: {active: 1, play: 1, text:"Yer a wizard ____"}
# 1115: {active: 1, play: 1, text:"Am I the only one around here who ____?"}
# 1116: {active: 1, play: 2, text:"Confession Bear: When I was 6, I ____ on my ____."}
# 1117: {active: 1, play: 1, text:"Actual Advice Mallard: Always ____."}
# 1118: {active: 1, play: 1, text:"For every upvote I will ____."}
# 1119: {active: 1, play: 1, text:"____. Awkward boner. "}
# 1120: {active: 1, play: 1, text:"____. Forever Alone."}
# 1121: {active: 1, play: 1, text:"____. TOO SAD AND TOO TINY!"}
# 1122: {active: 1, play: 2, text:"I’ve never seen anyone so ____ while ____."}
# 1123: {active: 1, play: 1, text:"OH MY GOD ____. ARE YOU FUCKING KIDDING ME!?"}
# 1124: {active: 1, play: 1, text:"You know nothing ____."}
# 1125: {active: 1, play: 1, text:"Most of the time you can only fit one____ in there."}
# 1126: {active: 1, play: 1, text:"That ____ tasted so bad, I needed a Jolly Rancher. "}
# 1127: {active: 1, play: 2, text:"I don’t always ____. But when I do____.."}
# 1128: {active: 1, play: 1, text:"+1 for ____."}
# 1129: {active: 1, play: 1, text:"SAY GOODBYE TO____."}
# 1130: {active: 1, play: 1, text:"When I found ____ in usersubmitted, I was flabbergasted. "}
# 1131: {active: 1, play: 1, text:"France is ____"}
# 1132: {active: 1, play: 2, text:"The ____ for this ____ is TOO DAMN HIGH. "}
# 1133: {active: 1, play: 1, text:"Any love for ____?"}
# 1134: {active: 1, play: 1, text:"In Japan, ____ is the new sexual trend."}
# 1135: {active: 1, play: 2, text:"I love bacon as much as ____ loves ____."}
# 1136: {active: 1, play: 2, text:"A hipster needs a ____ as much as a fish needs a ____."}
# 1137: {active: 1, play: 1, text:"Justin Bieber is a ____."}
# 1138: {active: 1, play: 1, text:"Are you my ____?"}
# 1139: {active: 1, play: 1, text:"Weasley is our ____."}
# 1140: {active: 1, play: 1, text:"I have a bad feeling about ____."}
# 1141: {active: 1, play: 1, text:"I am a leaf on the ____."}
# 1142: {active: 1, play: 1, text:"That was more awkward than ____."}
# 1143: {active: 1, play: 1, text:"Boardgame Online is more fun than ____."}
# 1144: {active: 1, play: 2, text:"I hate My Little Pony more than ____ hates ____."}
# 1145: {active: 1, play: 2, text:"I love My Little Pony more than ____ loves ____."}
# 1146: {active: 1, play: 1, text:"Cat gifs are cuter than ____. "}
# 1147: {active: 1, play: 1, text:"If it fits, I ____. "}
# 1148: {active: 1, play: 1, text:"____. My moon and my stars. "}
# 1149: {active: 1, play: 1, text:"A ____ always pays his debts. "}
# 1150: {active: 1, play: 1, text:"My ovaries just exploded because of ____. "}
# 1151: {active: 1, play: 1, text:"Chewie, ____ it!"}
# 1152: {active: 1, play: 1, text:"Steven Moffat has no ____. "}
# 1153: {active: 1, play: 1, text:"Dobby is ____!!"}
# 1154: {active: 1, play: 3, text:"The court finds the defendant, ____, guilty of ____, and sentences them to a lifetime of ____."}
# 1155: {active: 1, play: 3, text:"____ ____ Divided By ____."}
# 1156: {active: 1, play: 2, text:"____ adds a thread in the Anti-____ group, and everybody loses their fucking minds."}
# 1157: {active: 1, play: 1, text:"____ is Best Pony."}
# 1158: {active: 1, play: 2, text:"____ is the least autistic ____ on Fimfiction."}
# 1159: {active: 1, play: 2, text:"____ posted that they're not working on fics for a while, because ____."}
# 1160: {active: 1, play: 2, text:"____ signalled the end of the ____ Age of FiMfiction.net."}
# 1161: {active: 1, play: 1, text:"____ signalled the end of the Golden Age of FiMfiction.net."}
# 1162: {active: 1, play: 1, text:"____ was a strong stallion."}
# 1163: {active: 1, play: 3, text:"____, ____, and ____ in a sexy circlejerk."}
# 1164: {active: 1, play: 3, text:"A clopfic about ____ with ____, and ____ is a sexy orphan."}
# 1165: {active: 1, play: 2, text:"An alternate universe where ____ is instead ____."}
# 1166: {active: 1, play: 2, text:"Fallout Equestria is ____ and tends to overdramaticize its ____."}
# 1167: {active: 1, play: 1, text:"Hey, let's cross over ____ and MLP! Why the fuck not?"}
# 1168: {active: 1, play: 3, text:"I commissioned a picture of ____ violating ____ with ____'s dick."}
# 1169: {active: 1, play: 1, text:"I hope someone writes a fic about ____ because I am too fucking lazy to do it myself."}
# 1170: {active: 1, play: 2, text:"I just read a fic where ____ was fucking ____."}
# 1171: {active: 1, play: 1, text:"I just started the ____verse."}
# 1172: {active: 1, play: 1, text:"I swear I'm going to quit the fandom if ____ happens."}
# 1173: {active: 1, play: 1, text:"If only people bothered to read Ezn's ____ Guide!"}
# 1174: {active: 1, play: 1, text:"knighty's new blogpost is about ____"}
# 1175: {active: 1, play: 1, text:"My ____ Pony"}
# 1176: {active: 1, play: 1, text:"My Little Dashie? How about My Little ____?"}
# 1177: {active: 1, play: 2, text:"My OTP is ____ and ____."}
# 1178: {active: 1, play: 1, text:"Oh, fuck, someone made a group about ____."}
# 1179: {active: 1, play: 1, text:"Oh, look, ____ made a fan group for themselves."}
# 1180: {active: 1, play: 2, text:"RainbowBob's newest clopfic: ____ X ____"}
# 1181: {active: 1, play: 1, text:"Remember when ____ was on every page?"}
# 1182: {active: 1, play: 1, text:"Short Skirts and ____."}
# 1183: {active: 1, play: 3, text:"Someone should write a clopfic of ____ fucking ____, using ____ as lubricant."}
# 1184: {active: 1, play: 1, text:"The ____ Bureau."}
# 1185: {active: 1, play: 2, text:"The ____ Group of ____ Excellence."}
# 1186: {active: 1, play: 2, text:"The cardinal sin of FiMFic noobs: _____ without ______"}
# 1187: {active: 1, play: 2, text:"The Incredible ____ Of A Winning ____."}
# 1188: {active: 1, play: 2, text:"There's a crossover fic about ____ and ____ in the FB."}
# 1189: {active: 1, play: 3, text:"____: ____ in fiction, ____ on the tabletop."}
# 1190: {active: 1, play: 2, text:"I proxy ____ using a second-hand ____."}
# 1191: {active: 1, play: 1, text:"Next up: Lord Lysander's paints ____."}
# 1192: {active: 1, play: 1, text:"The citizens of Innsmouth are really ____!"}
# 1193: {active: 1, play: 1, text:"I am Angry, Angry about ____."}
# 1194: {active: 1, play: 2, text:"In respect to your chapter, the Blood Ravens have dedicated one of their____to ____."}
# 1195: {active: 1, play: 1, text:"Roll for ____."}
# 1196: {active: 1, play: 1, text:"I prepared ____ this morning."}
# 1197: {active: 1, play: 1, text:"The bard nearly got us killed when he rolled to seduce ____."}
# 1198: {active: 1, play: 1, text:"____ causes the Paladin to fall"}
# 1199: {active: 1, play: 2, text:"The door to the FLGS opens and a ____ walks in!"}
# 1200: {active: 1, play: 1, text:"GW stores no longer stock____"}
# 1201: {active: 1, play: 1, text:"The price on ____ Has doubled!"}
# 1202: {active: 1, play: 1, text:"____ falls, everyone dies."}
# 1203: {active: 1, play: 1, text:"My GM just made his girlfriend a ____ character. How fucked are we?"}
# 1204: {active: 1, play: 1, text:"If you buy a camel, Crazy Hassan is adding in free ____ this week only!"}
# 1205: {active: 1, play: 1, text:"Around elves, watch ____"}
# 1206: {active: 1, play: 2, text:"The only good ____ is a dead ____"}
# 1207: {active: 1, play: 1, text:"...And then he killed the Tarasque with a ____"}
# 1208: {active: 1, play: 1, text:"There is a ____ on the roof."}
# 1209: {active: 1, play: 1, text:"What are we going to argue about today?"}
# 1210: {active: 1, play: 1, text:"I got a box today. What's inside? ____"}
# 1211: {active: 1, play: 1, text:"Roll ____ circumference"}
# 1212: {active: 1, play: 3, text:"What I made: ____. What the Dungeon Master saw: ____. What I played: ____"}
# 1213: {active: 1, play: 2, text:"____ vs. ____: Critical Hit!"}
# 1214: {active: 1, play: 1, text:"Then the barbarian drank from the ____-filled fountain"}
# 1215: {active: 1, play: 1, text:"____: That was a thing."}
# 1216: {active: 1, play: 1, text:"preferring 3D women over ____"}
# 1217: {active: 1, play: 1, text:"Where we're going, we won't need ____ to see"}
# 1218: {active: 1, play: 1, text:"You encounter a Gazebo. You respond with ____"}
# 1219: {active: 1, play: 1, text:"D&D: 6th edition will feature ____ as a main race!"}
# 1220: {active: 1, play: 1, text:"Your Natural 1 summons ____."}
# 1221: {active: 1, play: 1, text:"It would have taken ____ to..... CREEEEEEEEEED!"}
# 1222: {active: 1, play: 1, text:"Can ____ bloom on the battlefield?"}
# 1223: {active: 1, play: 1, text:"____? That's ULTRA heretical"}
# 1224: {active: 1, play: 1, text:"So I made my chapter insignia ____"}
# 1225: {active: 1, play: 1, text:"In the grim darkness of the far future there is only ____"}
# 1226: {active: 1, play: 1, text:"2e or ____"}
# 1227: {active: 1, play: 2, text:"Blood for the blood god! ____ for the ____!"}
# 1228: {active: 1, play: 1, text:"____. we don't need other boards anymore!"}
# 1229: {active: 1, play: 1, text:"____ just fucked us"}
# 1230: {active: 1, play: 2, text:"The guard looks a troubled, uncomfortable glare, like a man who must explain to his ____, that's its dreams of becoming ____ will never happen."}
# 1231: {active: 1, play: 1, text:"Dwarf Fortress needs more ____"}
# 1232: {active: 1, play: 1, text:"My ____ are moving on their own"}
# 1233: {active: 1, play: 1, text:"Welcome to the ____ Quest Thread."}
# 1234: {active: 1, play: 1, text:"You should never let your bard ____."}
# 1235: {active: 1, play: 1, text:"That one guy in my group always rolls a chaotic neutral ____."}
# 1236: {active: 1, play: 1, text:"The lich's phylactery is a ____!"}
# 1237: {active: 1, play: 1, text:"Macha was dismayed to find out that ____."}
# 1238: {active: 1, play: 1, text:"Never fire ____ at the bulkhead!"}
# 1239: {active: 1, play: 1, text:"____ is the only way I can forget about 4e."}
# 1240: {active: 1, play: 1, text:"I sure hope no one notices that I inserted my ____ fetish into the game."}
# 1241: {active: 1, play: 2, text:"Behold! White Wolf's newest game: ____: the ____."}
# 1242: {active: 1, play: 1, text:"For our upcoming FATAL game, I've assigned ____ as your new character."}
# 1243: {active: 1, play: 2, text:"The GM has invited his new ____ to join the game. They'll be playing ____."}
# 1244: {active: 1, play: 1, text:"0/10 would not ____."}
# 1245: {active: 1, play: 1, text:"The ____ guides my blade."}
# 1246: {active: 1, play: 1, text:"Don't touch me ____!"}
# 1247: {active: 1, play: 1, text:"Mountain, Black lotus, sac, to cast ____."}
# 1248: {active: 1, play: 2, text:"____ followed by gratuitous ____ is how I got kicked out off my last group."}
# 1249: {active: 1, play: 1, text:"Everybody was surprised when the king's trusted adviser turned out to be ____."}
# 1250: {active: 1, play: 3, text:"You and ____ must stop ____ with the ancient artifact ____."}
# 1251: {active: 1, play: 1, text:"Elf ____ Wat do?"}
# 1252: {active: 1, play: 1, text:"Magic the Gathering's next set is themed around ____."}
# 1253: {active: 1, play: 1, text:"We knew the game was off to a good start when the GM didn't veto a player's decision to play as ____."}
# 1254: {active: 1, play: 1, text:"My Kriegers came in a box of ____!"}
# 1255: {active: 1, play: 1, text:"I had to kill a party member when wasted 2 hours by ____."}
# 1256: {active: 1, play: 1, text:"We found ____in the Dragon's hoard."}
# 1257: {active: 1, play: 1, text:"What's on today's agenda for the mage guild meeting?"}
# 1258: {active: 1, play: 1, text:"____ is the only way to fix 3.5."}
# 1259: {active: 1, play: 1, text:"What is the BBEG's secret weapon?"}
# 1260: {active: 1, play: 1, text:"Ach! Hans run! It's the ____!"}
# 1261: {active: 1, play: 1, text:"The enemy's ____ is down."}
# 1262: {active: 1, play: 1, text:"Only fags play mono____."}
# 1263: {active: 1, play: 1, text:"What is better than 3D women?"}
# 1264: {active: 1, play: 1, text:"I kept getting weird looks at FNM when I brought my new ____ card sleeves."}
# 1265: {active: 1, play: 1, text:"I like to dress up like ____ and hit people with foam swords."}
# 1266: {active: 1, play: 2, text:"You've been cursed by the witch! Your ____ has turned into a ____!"}
# 1267: {active: 1, play: 1, text:"The adventure was going fine until the BBEG put ____ in our path."}
# 1268: {active: 1, play: 1, text:"Your BBEG is actually ____!"}
# 1269: {active: 1, play: 1, text:"The last straw was the Chaotic Neutral buying a case of ____."}
# 1270: {active: 1, play: 1, text:"What won't the Bard fuck?."}
# 1271: {active: 1, play: 1, text:"____! what was that?"}
# 1272: {active: 1, play: 1, text:"You roll 00 for your magical mishap and turn into ____."}
# 1273: {active: 1, play: 1, text:"You fool! you fell victim to one of the classic blunders: ____."}
# 1274: {active: 1, play: 1, text:"...and then the bastard pulled out ____ and placed it on the table."}
# 1275: {active: 1, play: 3, text:"What is your OT3?"}
# 1276: {active: 1, play: 1, text:"I cast magic missile at ____."}
# 1277: {active: 1, play: 2, text:"Wait! I'm a ____! Let me tell you about my ____!"}
# 1278: {active: 1, play: 2, text:"Whenever we run ____, it's customary that ____ pays for the group's pizza."}
# 1279: {active: 1, play: 1, text:"My most shameful orgasm was the time I masturbated to ____."}
# 1280: {active: 1, play: 1, text:"I got an STD from ____."}
# 1281: {active: 1, play: 1, text:"____ is serious business."}
# 1282: {active: 1, play: 1, text:"If you don't pay your Comcast cable bill, they will send ____ after you."}
# 1283: {active: 1, play: 1, text:"Mewtwo achieved a utopian society when he eliminated ____ once and for all."}
# 1284: {active: 1, play: 1, text:"The only thing that caused more of a shitfit than Mewtwo's new form is ____."}
# 1285: {active: 1, play: 1, text:"The idiots in that one room at the Westin finally got kicked out of Anthrocon for ____."}
# 1286: {active: 1, play: 1, text:"Furaffinity went down for 48 hours because of ____."}
# 1287: {active: 1, play: 1, text:"Anthrocon was ruined by ____."}
# 1288: {active: 1, play: 1, text:"I unwatched his FurAffinity page because he kept posting ____."}
# 1289: {active: 1, play: 1, text:"You don't want to find ____ in your Furnando's Lasagna Wrap."}
# 1290: {active: 1, play: 2, text:"____ ruined the ____ fandom for all eternity."}
# 1291: {active: 1, play: 2, text:"I was fapping to ____, but ____ walked in on me."}
# 1292: {active: 1, play: 1, text:"In recent tech news, computers are now being ruined by ____."}
# 1293: {active: 1, play: 3, text:"Yu-Gi-Oh players were shocked when the win condition of holding 5 Exodia pieces was replaced by ____, ____, and ____. "}
# 1294: {active: 1, play: 3, text:"What are the worst 3 cards in your hand right now?"}
# 1295: {active: 1, play: 1, text:"____ makes the Homestuck fandom uncomfortable."}
# 1296: {active: 1, play: 2, text:"____ stays awake at night, crying over ____."}
# 1297: {active: 1, play: 1, text:"____. It keeps happening!"}
# 1298: {active: 1, play: 1, text:"'Sacred leggings' was a mistranslation. The Sufferer actually died in Sacred ____."}
# 1299: {active: 1, play: 1, text:"After throwing ____ at Karkat's head, Dave made the intriguing discover that troll horns are very sensitive."}
# 1300: {active: 1, play: 1, text:"AG: Who needs luck when you have ____?"}
# 1301: {active: 1, play: 1, text:"All ____. All of it!"}
# 1302: {active: 1, play: 1, text:"Alternia's political system was based upon ____."}
# 1303: {active: 1, play: 1, text:"Believe it or not, Kankri's biggest trigger is ____."}
# 1304: {active: 1, play: 1, text:"Dave Strider likes ____, but only ironically."}
# 1305: {active: 1, play: 1, text:"Equius beats up Eridan for ____."}
# 1306: {active: 1, play: 1, text:"Feferi secretly hates ____."}
# 1307: {active: 1, play: 1, text:"For Betty Crocker's latest ad campaign/brainwashing scheme, she is using ____ as inspiration."}
# 1308: {active: 1, play: 1, text:"For his birthday, Dave gave John ____."}
# 1309: {active: 1, play: 1, text:"Fuckin' ____. How do they work?"}
# 1310: {active: 1, play: 1, text:"Gamzee not only likes using his clubs for juggling and strifing, he also uses them for____."}
# 1311: {active: 1, play: 1, text:"Getting a friend to read Homestuck is like ____."}
# 1312: {active: 1, play: 1, text:"How do I live without ____?"}
# 1313: {active: 1, play: 2, text:"Hussie died on his quest bed and rose as the fully realized ____ of ____."}
# 1314: {active: 1, play: 2, text:"Hussie unintentionally revealed that Homestuck will end with ____ and ____ consummating their relationship at last."}
# 1315: {active: 1, play: 1, text:"I am ____. It's me."}
# 1316: {active: 1, play: 1, text:"I finally became Tumblr famous when I released a gifset of ____."}
# 1317: {active: 1, play: 1, text:"I just found ____ in my closet it is like fucking christmas up in here."}
# 1318: {active: 1, play: 1, text:"I warned you about ____, bro! I told you, dog!"}
# 1319: {active: 1, play: 1, text:"In the final battle, John distracts Lord English by showing him ____."}
# 1320: {active: 1, play: 1, text:"It's hard, being ____. It's hard and no one understands."}
# 1321: {active: 1, play: 1, text:"John is a good boy. And he loves ____."}
# 1322: {active: 1, play: 1, text:"John may not be a homosexual, but he has a serious thing for ____."}
# 1323: {active: 1, play: 1, text:"Kanaya reached into her dead lusus's stomach and retrieved ____."}
# 1324: {active: 1, play: 1, text:"Kanaya tells Karkat about ____ to cheer him up."}
# 1325: {active: 1, play: 1, text:"Karkat gave our universe ____."}
# 1326: {active: 1, play: 1, text:"Latula and Porrin have decided to teach Kankri about the wonders of ____."}
# 1327: {active: 1, play: 1, text:"Little did they know, the key to defeating Lord English was actually ____."}
# 1328: {active: 1, play: 1, text:"Little known fact: Kurloz's stitching is actually made out of ____."}
# 1329: {active: 1, play: 1, text:"Nanna baked a cake for John to commemorate ____."}
# 1330: {active: 1, play: 1, text:"Nepeta only likes Karkat for his ____."}
# 1331: {active: 1, play: 2, text:"Nepeta's secret OTP is ____ with ____."}
# 1332: {active: 1, play: 1, text:"The next thing Hussie will turn into a sex joke will be ____."}
# 1333: {active: 1, play: 2, text:"Nobody was surprised to find ____ under Jade's skirt. The surprise was she used it for/on ____."}
# 1334: {active: 1, play: 1, text:"The only way to beat Vriska in an eating contest is to put ____ on the table."}
# 1335: {active: 1, play: 1, text:"Porrim made Kankri a sweater to cover his ____."}
# 1336: {active: 1, play: 1, text:"Problem Sleuth had a hard time investigating ____."}
# 1337: {active: 1, play: 1, text:"The real reason Terezi stabbed Vriska was to punish her for ____."}
# 1338: {active: 1, play: 1, text:"Rose was rather disgusted when she started reading about ____."}
# 1339: {active: 1, play: 1, text:"The secret way to achieve God Tier is to die on top of ____."}
# 1340: {active: 1, play: 1, text:"Terezi can top anyone except ____."}
# 1341: {active: 1, play: 1, text:"The thing that made Kankri break his vow of celibacy was ____."}
# 1342: {active: 1, play: 1, text:"Turns out, pre-entry prototyping with ____ was not the best idea."}
# 1343: {active: 1, play: 1, text:"Vriska killed Spidermom with ____."}
# 1344: {active: 1, play: 2, text:"Vriska roleplays ____ with Terezi as ____."}
# 1345: {active: 1, play: 1, text:"Vriska's greatest regret is ____."}
# 1346: {active: 1, play: 2, text:"Wear ____. Be ____."}
# 1347: {active: 1, play: 1, text:"What did Jake get Dirk for his birthday?"}
# 1348: {active: 1, play: 1, text:"What is the worst thing that Terezi ever licked?"}
# 1349: {active: 1, play: 1, text:"What makes your kokoro go 'doki doki'?"}
# 1350: {active: 1, play: 1, text:"What's in the box, Jack?"}
# 1351: {active: 1, play: 1, text:"When a bucket is unavailable, trolls with use ____."}
# 1352: {active: 1, play: 1, text:"When Dave received ____ from his Bro for his 9th birthday, be felt a little warm inside."}
# 1353: {active: 1, play: 1, text:"The hole in Kanaya's stomach is so large, she can fit ____ in it."}
# 1354: {active: 1, play: 1, text:"where doing it man. where MAKING ____ HAPEN!"}
# 1355: {active: 1, play: 1, text:"Your name is JOHN EGBERT and boy do you love ____!"}
# 1356: {active: 1, play: 1, text:"____. On the roof. Now."}
# 1357: {active: 1, play: 1, text:"____ totally makes me question my sexuality."}
# 1358: {active: 1, play: 1, text:"Whenever I see ____ on MSPARP, I disconnect immediately."}
# 1359: {active: 1, play: 1, text:"Calliborn wants you to draw pornography of ____."}
# 1360: {active: 1, play: 1, text:"They found some more last episodes! They were found in ____."}
# 1361: {active: 1, play: 1, text:"The Doctor did it! He saved the world again! This time using a ____."}
# 1362: {active: 1, play: 1, text:"I'd give up ____ to travel with The Doctor."}
# 1363: {active: 1, play: 1, text:"The next Doctor Who spin-off is going to be called ____."}
# 1364: {active: 1, play: 1, text:"Who should be the 13th Doctor?"}
# 1365: {active: 1, play: 1, text:"The Chameleon circuit is working again...somewhat. Instead of a phone booth, the TARDIS is now a ____."}
# 1366: {active: 1, play: 1, text:"Originally, the 50th special was going to have ____ appear, but the BBC decided against it in the end."}
# 1367: {active: 1, play: 1, text:"After we watch an episode, I've got some ____-flavored Jelly Babies to hand out."}
# 1368: {active: 1, play: 1, text:"Wibbly-wobbly, timey-wimey ____."}
# 1369: {active: 1, play: 1, text:"What's going to be The Doctor's new catchphrase?"}
# 1370: {active: 1, play: 1, text:"Bowties are ____."}
# 1371: {active: 1, play: 1, text:"Old and busted: EXTERMINATE! New hotness: ____."}
# 1372: {active: 1, play: 1, text:"There's a new dance on Gallifrey. It's called the ____."}
# 1373: {active: 1, play: 1, text:"They announced a new LEGO Doctor Who game! Rumor has it that ____ is an unlockable character."}
# 1374: {active: 1, play: 1, text:"FUN FACT: The Daleks were originally shaped to look like ____."}
# 1375: {active: 1, play: 1, text:"At this new Doctor Who themed restaurant, you can get a free ____ if you can eat a plate of bangers and mash in under 3 minutes."}
# 1376: {active: 1, play: 1, text:"Who is going to be The Doctor's next companion?"}
# 1377: {active: 1, play: 1, text:"I think the BBC is losing it. They just released a Doctor Who themed ____."}
# 1378: {active: 1, play: 1, text:"It's a little known fact that if you send a ____ to the BBC, they will send you a picture of The Doctor."}
# 1379: {active: 1, play: 1, text:"I was ok with all the BAD WOLF graffiti, until someone wrote it on ____."}
# 1380: {active: 1, play: 1, text:"Jack Harkness, I can't leave you alone for a minute! I turn around and you're trying to seduce ____."}
# 1381: {active: 1, play: 1, text:"In all of space and time you decide that ____ is a good choice?!"}
# 1382: {active: 1, play: 1, text:"Adipose were thought to be made of fat, but are really made of ____."}
# 1383: {active: 1, play: 1, text:"I hear the next thing that will cause The Doctor to regenerate is ____."}
# 1384: {active: 1, play: 1, text:"Honey badger don't give a ____!"}
# 1385: {active: 1, play: 1, text:"My next video turorial covers ____."}
# 1386: {active: 1, play: 1, text:"We found a map Charlie! A map to ____ Mountain!"}
# 1387: {active: 1, play: 1, text:"For the love of GOD, and all that is HOLY, ____!!"}
# 1388: {active: 1, play: 1, text:"The new Operating System will be called ____."}
# 1389: {active: 1, play: 2, text:"I used to be an adventurer like you, then I took a/an ____ in the ____."}
# 1390: {active: 1, play: 1, text:"You've got to check out ____ Fluxx!"}
# 1391: {active: 1, play: 1, text:"Call of Duty Modern Warfare 37: War of ____!"}
# 1392: {active: 1, play: 1, text:"In brightest day, in blackest night, no ____ shall escape my sight."}
# 1393: {active: 1, play: 1, text:"Yes, Mr. Death... I'll play you a game! But not chess! My game is ____."}
# 1394: {active: 1, play: 1, text:"I cannot preach hate and warfare when I am a disciple of ____."}
# 1395: {active: 1, play: 1, text:"With great power comes great ____."}
# 1396: {active: 1, play: 1, text:"Don't make me ____. You wouldn't like me when I'm ____."}
# 1397: {active: 1, play: 1, text:"Fighting a never-ending battle for truth, justice, and the American ____!"}
# 1398: {active: 1, play: 2, text:"Faster than a speeding ____! More powerful than a ____!"}
# 1399: {active: 1, play: 1, text:"Able to leap ____ in a single bound! "}
# 1400: {active: 1, play: 2, text:"Disguised as ____, mild-mannered ____. "}
# 1401: {active: 1, play: 1, text:"Patriotism doesn't automatically equal ____."}
# 1402: {active: 1, play: 1, text:"I'm loyal to nothing, General - except the ____."}
# 1403: {active: 1, play: 1, text:"Alright you Primitive Screwheads, listen up! You see this? This... is my ____!"}
# 1404: {active: 1, play: 1, text:"Shop smart. Shop ____."}
# 1405: {active: 1, play: 1, text:"Hail to the ____, baby."}
# 1406: {active: 1, play: 1, text:"Good. Bad. I'm the guy with the ____."}
# 1407: {active: 1, play: 1, text:"How will we stop an army of the dead at our castle walls?"}
# 1408: {active: 1, play: 1, text:"I seek The Holy ____."}
# 1409: {active: 1, play: 1, text:"I see you have the machine that goes ____."}
# 1410: {active: 1, play: 1, text:"Every sperm is ____."}
# 1411: {active: 1, play: 1, text:"An African or European ____?"}
# 1412: {active: 1, play: 1, text:"Well you can't expect to wield supreme executive power just 'cause some watery tart threw a ____ at you!"}
# 1413: {active: 1, play: 1, text:"'____!' 'It's only a model.'"}
# 1414: {active: 1, play: 1, text:"Good night. Sleep well. I'll most likely ____ you in the morning."}
# 1415: {active: 1, play: 1, text:"I am The Dread Pirate ____."}
# 1416: {active: 1, play: 2, text:"Do you want me to send you back to where you were, ____ in ____?"}
# 1417: {active: 1, play: 1, text:"I see ____ people"}
# 1418: {active: 1, play: 1, text:"____? We don't need no stinking ____!"}
# 1419: {active: 1, play: 1, text:"These aren't the ____ you're looking for."}
# 1420: {active: 1, play: 1, text:"We're gonna need a bigger ____."}
# 1421: {active: 1, play: 1, text:"Beavis and Butthead Do ____."}
# 1422: {active: 1, play: 1, text:"I, for one, welcome our new ____ overlords."}
# 1423: {active: 1, play: 2, text:"You know, there's a million fine looking women in the world, dude. But they don't all bring you ____ at work. Most of 'em just ____."}
# 1424: {active: 1, play: 1, text:"Teenage Mutant Ninja ____."}
# 1425: {active: 1, play: 1, text:"Achy Breaky ____."}
# 1426: {active: 1, play: 1, text:"I'm not a ____, but I play one on TV"}
# 1427: {active: 1, play: 3, text:"____'s latest music video features a dozen ____ on ____."}
# 1428: {active: 1, play: 1, text:"____. Like a boss!"}
# 1429: {active: 1, play: 3, text:"In Soviet ____, ____ ____s you."}
# 1430: {active: 1, play: 1, text:"____. It's not just for breakfast anymore."}
# 1431: {active: 1, play: 1, text:"____. It's what's for dinner!"}
# 1432: {active: 1, play: 1, text:"____. Part of this nutritious breakfast."}
# 1433: {active: 1, play: 1, text:"____. Breakfast of champions!"}
# 1434: {active: 1, play: 1, text:"Where's the beef?"}
# 1435: {active: 1, play: 1, text:"Oh my god! They killed ____!"}
# 1436: {active: 1, play: 1, text:"I am not fat! I'm just ____."}
# 1437: {active: 1, play: 1, text:"Two by two, hands of ____."}
# 1438: {active: 1, play: 2, text:"____ was sent to save ____."}
# 1439: {active: 1, play: 1, text:"The anxiously awaited new season of Firefly is rumoured to kick off with an action packed scene, featuring River Tam's amazing feats of ____!"}
# 1440: {active: 1, play: 2, text:"I swear by my pretty floral ____, I will ____ you."}
# 1441: {active: 1, play: 1, text:"Wendy's ____ & Juicy."}
# 1442: {active: 1, play: 2, text:"I HATE it when ____(s) crawl(s) up my ____!"}
# 1443: {active: 1, play: 2, text:"At ____, where every day is ____ day!"}
# 1444: {active: 1, play: 1, text:"____ at last! ____ at last! Thank God almighty, I'm ____ at last! "}
# 1445: {active: 1, play: 1, text:"I have a dream that one day this nation will rise up and live out the true meaning of its creed:"}
# 1446: {active: 1, play: 2, text:"This year's ____ guest of honour is ____."}
# 1447: {active: 1, play: 1, text:"This will be the greatest ____con ever!"}
# 1448: {active: 1, play: 2, text:"____ is the new ____."}
# 1449: {active: 1, play: 1, text:"Bitches LOVE ____!"}
# 1450: {active: 1, play: 1, text:"The only good ____ is a dead ____."}
# 1451: {active: 1, play: 2, text:"A vote for ____ is a vote for ____."}
# 1452: {active: 1, play: 1, text:"Thou shalt not____."}
# 1453: {active: 1, play: 1, text:"I am the King of ____!"}
# 1454: {active: 1, play: 1, text:"Team ____!"}
# 1455: {active: 1, play: 1, text:"We went to a workshop on tantric ____."}
# 1456: {active: 1, play: 1, text:"My safeword is ____."}
# 1457: {active: 1, play: 2, text:"I like ____, but ____ is a hard limit!"}
# 1458: {active: 1, play: 2, text:"I ____, therefore I ____."}
# 1459: {active: 1, play: 1, text:"Welcome to my secret lair. I call it The Fortress of ____."}
# 1460: {active: 1, play: 1, text:"These are my minions of ____!"}
# 1461: {active: 1, play: 1, text:"____ doesn't need to be judged right now."}
# 1462: {active: 1, play: 2, text:"____ is a terrible thing to do to the ____!"}
# 1463: {active: 1, play: 2, text:"____ & ____: Worst mods ever."}
# 1464: {active: 1, play: 1, text:"/____ all over this post."}
# 1465: {active: 1, play: 1, text:"/____ delicately from the butt."}
# 1466: {active: 1, play: 1, text:"/slides hand up your ____."}
# 1467: {active: 1, play: 1, text:"____ is not an island."}
# 1468: {active: 1, play: 1, text:"____ runs into the forest, screaming."}
# 1469: {active: 1, play: 1, text:"____ was better before the anon meme."}
# 1470: {active: 1, play: 1, text:"We'd love to have you at ____ Island!"}
# 1471: {active: 1, play: 1, text:"Bad news guys, my parents found that thread involving ____."}
# 1472: {active: 1, play: 1, text:"But what are your thoughts on ____?"}
# 1473: {active: 1, play: 1, text:"Chaos ensued when Wankgate banned ____."}
# 1474: {active: 1, play: 1, text:"Cute, fun and ____."}
# 1475: {active: 1, play: 1, text:"Does anyone ____? I feel like the only one."}
# 1476: {active: 1, play: 1, text:"Excuse me, but I identify as ____."}
# 1477: {active: 1, play: 1, text:"Great, another ____ event."}
# 1478: {active: 1, play: 1, text:"How can there be a group of people more ____ than us?"}
# 1479: {active: 1, play: 1, text:"How's my driving?"}
# 1480: {active: 1, play: 1, text:"I can only ____ if I feel a deep emotional connection."}
# 1481: {active: 1, play: 1, text:"I can't believe we just spent a whole page wanking about ____."}
# 1482: {active: 1, play: 1, text:"I have a PHD in ____."}
# 1483: {active: 1, play: 1, text:"I just benchpressed, like, 14 ____."}
# 1484: {active: 1, play: 1, text:"I predict ____ will close by the end of the year."}
# 1485: {active: 1, play: 2, text:"I randomly began to ____ and ____ came galloping up the stairs."}
# 1486: {active: 1, play: 1, text:"I see Wankgate's bitching about ____ again."}
# 1487: {active: 1, play: 1, text:"I'm literally shaking and ____ right now."}
# 1488: {active: 1, play: 1, text:"I'm married to ____ on the astral plane."}
# 1489: {active: 1, play: 1, text:"I'm really into ____, so please don't kinkshame."}
# 1490: {active: 1, play: 1, text:"I'm sad we lost ____ in the exodus from LJ to DW."}
# 1491: {active: 1, play: 1, text:"I'm starting a game where the characters are stuck in ____."}
# 1492: {active: 1, play: 1, text:"I'm taking commissions for ____!"}
# 1493: {active: 1, play: 1, text:"How dare you not warn for ____! Don't you know how triggering that is?"}
# 1494: {active: 1, play: 3, text:"In this world, sexual roles are divided into three categories: the ____, the ____, and the ____"}
# 1495: {active: 1, play: 1, text:"It's ____ o'clock."}
# 1496: {active: 1, play: 1, text:"ITT: ____."}
# 1497: {active: 1, play: 1, text:"Join my new game about ____!"}
# 1498: {active: 1, play: 1, text:"Keep fucking that ____."}
# 1499: {active: 1, play: 1, text:"Let me tell you about ____."}
# 1500: {active: 1, play: 1, text:"Log in and ____."}
# 1501: {active: 1, play: 2, text:"My favorite thread is the one where ____ has kinky sex with ____."}
# 1502: {active: 1, play: 2, text:"My headcanon is that ____ is ____."}
# 1503: {active: 1, play: 2, text:"My OTP: ____ x ____."}
# 1504: {active: 1, play: 2, text:"New game idea! You're kidnapped by ____ and forced into ____."}
# 1505: {active: 1, play: 1, text:"no actually i don't care at all, i don't even ____. :))))"}
# 1506: {active: 1, play: 1, text:"OMG you guys I have so many feels about ____!"}
# 1507: {active: 1, play: 2, text:"Only ____ would play from ____."}
# 1508: {active: 1, play: 1, text:"Raising money for ____! Please replurk!"}
# 1509: {active: 1, play: 1, text:"RPAnons made me ____."}
# 1510: {active: 1, play: 1, text:"SHUT UP ABOUT YOUR ____."}
# 1511: {active: 1, play: 1, text:"Signal boosting for ____!"}
# 1512: {active: 1, play: 2, text:"Since ____ is on hiatus, fans have migrated to ____."}
# 1513: {active: 1, play: 1, text:"Someone just stuck their head out of the window and screamed '____'s UP!'"}
# 1514: {active: 1, play: 1, text:"Someone left a ____ out in the rain."}
# 1515: {active: 1, play: 1, text:"That ____. You know, *that* one."}
# 1516: {active: 1, play: 1, text:"The ____ is happy."}
# 1517: {active: 1, play: 1, text:"The perfect username for my next character: ____."}
# 1518: {active: 1, play: 1, text:"The thing I hate most about RP is ____."}
# 1519: {active: 1, play: 1, text:"Their ____ are of age."}
# 1520: {active: 1, play: 1, text:"There are too many memes about ____."}
# 1521: {active: 1, play: 1, text:"There is no ____ in Holly Heights."}
# 1522: {active: 1, play: 1, text:"We need a new post. This one smells like ____."}
# 1523: {active: 1, play: 1, text:"Why was I asked for app revisions?"}
# 1524: {active: 1, play: 1, text:"Why was I banned?"}
# 1525: {active: 1, play: 1, text:"Who apps ____ to a sex game?"}
# 1526: {active: 1, play: 1, text:"Who should I play next?"}
# 1527: {active: 1, play: 1, text:"You can't fist ____."}
# 1528: {active: 1, play: 1, text:"You sound ____, tbh."}
# 1529: {active: 1, play: 1, text:"Azerbaijan, Land of ____."}
# 1530: {active: 1, play: 1, text:"There's rumours of a country buying votes with ____."}
# 1531: {active: 1, play: 3, text:"Your ideal interval act."}
# 1532: {active: 1, play: 2, text:"This performance contains flashing images, ____ and ____."}
# 1533: {active: 1, play: 2, text:"Serbia entered magical girls. How horribly will their contract end?"}
# 1534: {active: 1, play: 2, text:"HELLO EUROPE, ____ CALLING! 12 POINTS GO TO ____!"}
# 1535: {active: 1, play: 1, text:"____. As guaranteed as Cyprus giving Greece 12 points."}
# 1536: {active: 1, play: 1, text:"Women kissing each other on stage, men kissing each other on stage, what next?"}
# 1537: {active: 1, play: 1, text:"Lena goes from Eurovision winner, to participant, to score reader. Her next job is ____."}
# 1538: {active: 1, play: 2, text:"The correct procedure for listening to Fairytale is:"}
# 1539: {active: 1, play: 1, text:"Nothing can bring down Ruslana's chippy mood,, not even ____."}
# 1540: {active: 1, play: 1, text:"Krista Siegfrids' chronic marrying spree added ____ to her victims list."}
# 1541: {active: 1, play: 1, text:"The BBC have decided to dig up another old relic and send ____ to represent the UK."}
# 1542: {active: 1, play: 1, text:"A (few) word(s) synonymous with Eurovision fans: ____"}
# 1543: {active: 1, play: 1, text:"Johnny Logan is a man of many talents; he wins Eurovisions and ____."}
# 1544: {active: 1, play: 1, text:"Misheard lyrics of Verjamem resulted in people thinking Eva Boto screeched ____."}
# 1545: {active: 1, play: 1, text:"This country has declined to participate due to ____."}
# 1546: {active: 1, play: 1, text:"I'm in loooooooove with a fairytaaaale, even thouuugh it ____."}
# 1547: {active: 1, play: 2, text:"In an attempt to foster friendly attitudes between ESC entrants, the host country made them ____ and ____."}
# 1548: {active: 1, play: 3, text:"The winning act had ____ and ____ as the singer belted out lyrics about ____."}
# 1549: {active: 1, play: 3, text:"Everybody out of the god damn way. You've got a heart full of ____, a soul full of ____, and a body full of ____."}
# 1550: {active: 1, play: 1, text:"____ would be a good name for a band."}
# 1551: {active: 1, play: 1, text:"____ wouldn't be funny if not for the irony."}
# 1552: {active: 1, play: 1, text:"Help, I'm trapped in a ____ factory!"}
# 1553: {active: 1, play: 1, text:"None of the places I floated to had ____."}
# 1554: {active: 1, play: 1, text:"____. My normal method is useless here."}
# 1555: {active: 1, play: 1, text:"We had a ____ party, but it turned out not to be very much fun."}
# 1556: {active: 1, play: 1, text:"My hobby: ____."}
# 1557: {active: 1, play: 1, text:"____ makes terrible pillow talk."}
# 1558: {active: 1, play: 1, text:"What is the best way to protect yourself from Velociraptors?"}
# 1559: {active: 1, play: 1, text:"I'm pretty sure you can't send ____ through the mail."}
# 1560: {active: 1, play: 1, text:"I'm like ____, except with love."}
# 1561: {active: 1, play: 3, text:"Spoiler Alert! ____ kills ____ with ____!"}
# 1562: {active: 1, play: 2, text:"I didn't actually want you to be ____; I just wanted you to be ____."}
# 1563: {active: 1, play: 1, text:"Do you really expect ____? No, Mister Bond. I expect you to die!"}
# 1564: {active: 1, play: 1, text:"What do we miss most from the internet in 1998?"}
# 1565: {active: 1, play: 1, text:"All of my algorithms were really just disguised ____."}
# 1566: {active: 1, play: 1, text:"Waking up would be a lot easier if ____ didn't look so much like you."}
# 1567: {active: 1, play: 1, text:"____? No, I'm not really into Pokémon."}
# 1568: {active: 1, play: 2, text:"I got a lot more interested in ____ when I made the connection to ____."}
# 1569: {active: 1, play: 1, text:"Dreaming about ____ in Cirque du Soleil."}
# 1570: {active: 1, play: 1, text:"When I eat ____, I like to pretend I'm a Turing machine."}
# 1571: {active: 1, play: 1, text:"Freestyle rapping is really just ____."}
# 1572: {active: 1, play: 1, text:"It turns out God created the universe using ____."}
# 1573: {active: 1, play: 1, text:"Human intelligence decreases with increasing proximity to ____."}
# 1574: {active: 1, play: 2, text:"If I could rearrange the alphabet, I'd put ____ and ____ together."}
# 1575: {active: 1, play: 1, text:"The #1 Programmer's excuse for legitimately slacking off: ____."}
# 1576: {active: 1, play: 2, text:"I like alter songs by replacing ____ with ____."}
# 1577: {active: 1, play: 2, text:"Ebay review: Instead of ____, package contained ____. Would not buy again."}
# 1578: {active: 1, play: 1, text:"Social rule 99.1: If friends spend more than 60 minutes deciding what to do, they must default to ____."}
# 1579: {active: 1, play: 1, text:"____ linked to Acne! 95% confidence."}
# 1580: {active: 1, play: 1, text:"How many Google results are there for 'Died in a ____ accident?'"}
# 1581: {active: 1, play: 1, text:"Real Programmers use ____."}
# 1582: {active: 1, play: 1, text:"After finding Higgs-Boson, I can always use the LHC for ____."}
# 1583: {active: 1, play: 1, text:"My health declined when I realized I could eat ____ whenever I wanted."}
# 1584: {active: 1, play: 2, text:"____ is just applied ____."}
# 1585: {active: 1, play: 1, text:"What's my favorite unit of measurement?"}
# 1586: {active: 1, play: 1, text:"In the extended base metaphor, shortstop is ____."}
# 1587: {active: 1, play: 2, text:"I don't actually care about ____, I just like ____."}
# 1588: {active: 1, play: 1, text:"Why do you have a crossbow in your desk?"}
# 1589: {active: 1, play: 3, text:"I set up script to buy things on ebay for $1, but then it bought ____, ____, and ____."}
# 1590: {active: 1, play: 1, text:"I can extrude ____, but I can't retract it."}
# 1591: {active: 1, play: 2, text:"____'s fetish: ____."}
# 1592: {active: 1, play: 1, text:"Now I have to live my whole life pretending ____ never happened. It's going to be a fun 70 years."}
# 1593: {active: 1, play: 1, text:"My new favorite game is Strip ____."}
# 1594: {active: 1, play: 1, text:"Did you know you can just buy ____?"}
# 1595: {active: 1, play: 3, text:"Take me down to the ____, where the ____ is green and the ____ are pretty."}
# 1596: {active: 1, play: 1, text:"____. That's right. Shit just got REAL."}
# 1597: {active: 1, play: 1, text:"Just because I have ____ doesn't mean you could milk me now. I'd have to be lactating."}
# 1598: {active: 1, play: 1, text:"2009 called? Did you warn them about ____?"}
# 1599: {active: 1, play: 1, text:"I'm going to name my child ____."}
# 1600: {active: 1, play: 1, text:"3D printers sound great until you receive spam containing actual ____."}
# 1601: {active: 1, play: 2, text:"Until I see more data, I'm going to assume ____ causes ____."}
# 1602: {active: 1, play: 1, text:"Did you know November is ____ Awareness Month?"}
# 1603: {active: 1, play: 1, text:"University Researchers create life in lab! ____ blamed!"}
# 1604: {active: 1, play: 1, text:"If you really hate someone, teach them to recognize ____."}
# 1605: {active: 1, play: 1, text:"____. So it has come to this."}
# 1606: {active: 1, play: 1, text:"Hey baby, wanna come back to my sex ____?"}
# 1607: {active: 1, play: 2, text:"The past is a foreign country... with ____ and ____!"}
# 1608: {active: 1, play: 2, text:"What role has social media played in ____? Well, it's certainly made ____ stupider."}
# 1609: {active: 1, play: 1, text:"____. It works in Kerbal Space Program."}
# 1610: {active: 1, play: 1, text:"____ is too big for small talk."}
# 1611: {active: 1, play: 1, text:"What did I suggest to the IAU for a new planet name?"}
# 1612: {active: 1, play: 2, text:"By 2019, ____ will be outnumbered by ____."}
# 1613: {active: 1, play: 1, text:"New movie this summer: ____ beats up everyone."}
# 1614: {active: 1, play: 1, text:"Revealed: Why He Really Resigned! Pope Benedict's Secret Struggle with ____!"}
# 1615: {active: 1, play: 2, text:"Here's what you can expect for the new year. Out: ____. In: ____."}
# 1616: {active: 1, play: 2, text:"According to the Daleks, ____ is better at ____."}
# 1617: {active: 1, play: 1, text:"I can't believe Netflix is using ____ to promote House of Cards."}
# 1618: {active: 1, play: 1, text:"I'm not going to lie. I despise ____. There, I said it."}
# 1619: {active: 1, play: 1, text:"A wise man said, 'Everything is about sex. Except sex. Sex is about ____.'"}
# 1620: {active: 1, play: 1, text:"Our relationship is strictly professional. Let's not complicate things with ____."}
# 1621: {active: 1, play: 2, text:"Because you enjoyed ____, we thought you'd like ____."}
# 1622: {active: 1, play: 1, text:"We're not like other news organizations. Here at Slugline, we welcome ____ in the office. "}
# 1623: {active: 1, play: 1, text:"Cancel all my meetings. We've got a situation with ____ that requires my immediate attention."}
# 1624: {active: 1, play: 1, text:"If you need him to, Remy Danton can pull some strings and get you ____, but it'll cost you."}
# 1625: {active: 1, play: 2, text:"Corruption. Betrayal. ____. Coming soon to Netflix, 'House of ____.'"}
# 1626: {active: 1, play: 1, text:"I filled my apartment with ____."}
# 1627: {active: 1, play: 2, text:"It's fun to mentally replace the word ____ with ____."}
# 1628: {active: 1, play: 1, text:"Next on GSN: 'The $100,000 ____.'"}
# 1629: {active: 1, play: 2, text:"Much ____. So ____. Wow."}
# 1630: {active: 1, play: 1, text:"Siskel and Ebert have panned ____ as 'poorly conceived' and 'sloppily executed.'"}
# 1631: {active: 1, play: 1, text:"Up next on Nickelodeon: 'Clarissa Explains ____.'"}
# 1632: {active: 1, play: 1, text:"How did Stella get her groove back?"}
# 1633: {active: 1, play: 1, text:"Believe it or not, Jim Carrey can do a dead-on impression of ____."}
# 1634: {active: 1, play: 1, text:"It's Morphin' Time! Mastadon! Pterodactyl! Triceratops! Sabertooth Tiger! ____!"}
# 1635: {active: 1, play: 1, text:"Tonight on SNICK: 'Are You Afraid of ____?'"}
# 1636: {active: 1, play: 1, text:"What the hell?! They added a 6/6 with flying, trample, and ____."}
# 1637: {active: 1, play: 1, text:"I'm a bitch, I'm a lover, I'm a child, I'm ____."}
# 1638: {active: 1, play: 1, text:"____ was totally worth the trauma."}
# 1639: {active: 1, play: 2, text:"Let me tell you about my new startup. It's basically ____, but for ____."}
# 1640: {active: 1, play: 1, text:"Unfortunately, Neo, no one can be told what ____ is. You have to see it for yourself."}
# 1641: {active: 1, play: 1, text:"(Heavy breathing) Luke, I am ____."}
# 1642: {active: 1, play: 1, text:"You think you have defeated me? Well, let's see how you handle ____!"}
# 1643: {active: 1, play: 2, text:"____ is way better in ____ mode."}
# 1644: {active: 1, play: 2, text:"Nickelodeon's next kids' game show is '____', hosted by ____."}
# 1645: {active: 1, play: 1, text:"____ probably tastes better than Quiznos."}
# 1646: {active: 1, play: 1, text:"The Discovery Channel presents: ____ week."}
# 1647: {active: 1, play: 1, text:"Like ____, State Farm is there."}
# 1648: {active: 1, play: 1, text:"The Discovery Channel presents: ____ week."}
# 1649: {active: 1, play: 1, text:"Like ____, State Farm is there."}
# 1650: {active: 1, play: 1, text:"Bob Ross's little-known first show was called 'The Joy of ____.'"}
# 1651: {active: 1, play: 1, text:"During my first game of D&D, I accidentally summoned ____."}
# 1652: {active: 1, play: 2, text:"In M. Night Shyamalan's new movie, Bruce Willis discovers that ____ had really been ____ all along."}
# 1653: {active: 1, play: 1, text:"After Hurricane Katrina, Sean Penn brought ____ to all the people of New Orleans."}
# 1654: {active: 1, play: 2, text:"Michael Bay's new three-hour action epic pits ____ against ____."}
# 1655: {active: 1, play: 1, text:"Keith Richards enjoys ____ on his food."}
# 1656: {active: 1, play: 1, text:"My new favorite porn star is Joey '____' McGee."}
# 1657: {active: 1, play: 1, text:"In his newest and most difficult stunt, David Blaine must escape from ____."}
# 1658: {active: 1, play: 1, text:"Little Miss Muffet Sat on a tuffet, Eating her curds and ____."}
# 1659: {active: 1, play: 1, text:"My country, 'tis of thee, sweet land of ____."}
# 1660: {active: 1, play: 1, text:"Charades was ruined for me forever when my mom had to act out ____."}
# 1661: {active: 1, play: 1, text:"After the earthquake, Sean Penn brought ____ to the people of Haiti."}
# 1662: {active: 1, play: 1, text:"This holiday season, Tim Allen must overcome his fear of ____ to save Christmas."}
# 1663: {active: 1, play: 1, text:"Jesus is ____."}
# 1664: {active: 1, play: 1, text:"Dogimo would give up ____ to type a six sentence paragraph in a thread."}
# 1665: {active: 1, play: 1, text:"We need to talk about your whole gallon of ____."}
# 1666: {active: 1, play: 2, text:"A mod war about ____ occurred during ____."}
# 1667: {active: 1, play: 2, text:"____ was banned from tinychat because of ____."}
# 1668: {active: 1, play: 1, text:"Roses and her hammer collection defeated an entire squadron of ____."}
# 1669: {active: 1, play: 1, text:"Yaar's mother is ____."}
# 1670: {active: 1, play: 1, text:"VS: Where the ____ happens!"}
# 1671: {active: 1, play: 1, text:"____? FRY. EYES."}
# 1672: {active: 1, play: 1, text:"I'm under the ____."}
# 1673: {active: 1, play: 1, text:"Alcoholic games of Clue® lead to ____."}
# 1674: {active: 1, play: 1, text:"In the final round of this year's Omegathon, Omeganauts must face off in a game of ____."}
# 1675: {active: 1, play: 1, text:"I don't know exactly how I got the PAX plague, but I suspect it had something to do with ____."}
# 1676: {active: 1, play: 1, text:"Call the law offices of Goldstein & Goldstein, because no one should have to tolerate ____ in the workplace."}
# 1677: {active: 1, play: 1, text:"To prepare for his upcoming role, Daniel Day-Lewis immersed himself in the world of ____."}
# 1678: {active: 1, play: 1, text:"As part of his daily regimen, Anderson Cooper sets aside 15 minutes for ____."}
# 1679: {active: 1, play: 1, text:"As part of his contract, Prince won't perform without ____ in his dressing room."}
# 1680: {active: 1, play: 1, text:"____ caused Northernlion to take stupid damage."}
# 1681: {active: 1, play: 1, text:"____ Is the best item in The Binding of Isaac."}
# 1682: {active: 1, play: 1, text:"____ is the worst item in The Binding of Isaac."}
# 1683: {active: 1, play: 1, text:"____ is/are Northernlion's worst nightmare."}
# 1684: {active: 1, play: 1, text:"____: The Northernlion Story."}
# 1685: {active: 1, play: 1, text:"As always, I will ____ you next time!"}
# 1686: {active: 1, play: 2, text:"Lifetime® presents ____, the story of ____."}
# 1687: {active: 1, play: 1, text:"Dear Abby, I'm having some trouble with ____ and would like your advice."}
# 1688: {active: 1, play: 1, text:"Even ____ is/are better at video games than Northernlion."}
# 1689: {active: 1, play: 1, text:"Everything's coming up ____."}
# 1690: {active: 1, play: 1, text:"Finding something like ____ would turn this run around."}
# 1691: {active: 1, play: 1, text:"I don't even see ____ anymore; all I see are blondes, brunettes, redheads..."}
# 1692: {active: 1, play: 1, text:"I'm in the permanent ____ state."}
# 1693: {active: 1, play: 1, text:"If sloth ____ are wrong I don’t want to be right."}
# 1694: {active: 1, play: 1, text:"JSmithOTI: Total ____."}
# 1695: {active: 1, play: 1, text:"Northernlion's latest novelty Twitter account is @____."}
# 1696: {active: 1, play: 1, text:"Northernlion has been facing ridicule for calling ____ a rogue-like."}
# 1697: {active: 1, play: 1, text:"Northernlion always forgets the name of ____."}
# 1698: {active: 1, play: 1, text:"Northernlion's refusal to Let's Play ____ was probably a good call."}
# 1699: {active: 1, play: 1, text:"Of all the things that Ryan and Josh have in common, they bond together through their mutual love of ____."}
# 1700: {active: 1, play: 1, text:"Oh god, I can't believe we ate ____ at PAX."}
# 1701: {active: 1, play: 1, text:"One thing Northernlion was right about was ____."}
# 1702: {active: 1, play: 1, text:"Recently, Northernlion has felt woefully insecure due to ____."}
# 1703: {active: 1, play: 1, text:"The stream was going well until ____."}
# 1704: {active: 1, play: 1, text:"The Youtube chat proved ineffective, so instead we had to communicate via ____."}
# 1705: {active: 1, play: 1, text:"Whenever I ___, take a drink."}
# 1706: {active: 1, play: 1, text:"The only way NL is ever going to make it to Hell in Spelunky is by using ____."}
# 1707: {active: 1, play: 1, text:"Welcome back to The Binding of Isaac. Today's challenge run will be based on ____."}
# 1708: {active: 1, play: 1, text:"Fox would still be here if not for ____."}
# 1709: {active: 1, play: 3, text:"I wasn't even that drunk! I just had some ____, ____, and ____."}
# 1710: {active: 1, play: 1, text:"What does Alucard have nightmares about?"}
# 1711: {active: 1, play: 2, text:"I beat Blue Baby with only ____ and ____!"}
# 1712: {active: 1, play: 2, text:"Northernlion has alienated fans of ____ by calling them ____."}
# 1713: {active: 1, play: 2, text:"Northernlion was fired from his teaching job and had to flee South Korea after an incident involving ____ and ____."}
# 1714: {active: 1, play: 3, text:"My original species combines ____ and ____. It's called ____."}
# 1715: {active: 1, play: 1, text:"Don't slow down in East Cleveland or ____."}
# 1716: {active: 1, play: 1, text:"Grand Theft Auto™: ____."}
# 1717: {active: 1, play: 2, text:"____ and ____ are the new hot couple."}
# 1718: {active: 1, play: 1, text:"What will Xyzzy take over the world with?"}
# 1719: {active: 1, play: 1, text:"Who is GLaDOS's next test subject?"}
# 1720: {active: 1, play: 1, text:"The next Assassin's Creed game will take place in ____."}
# 1721: {active: 1, play: 2, text:"I wouldn't fuck ____ with ____'s dick."}
# 1722: {active: 1, play: 1, text:"In the next Punch Out!!, ____ will be the secret final boss."}
# 1723: {active: 1, play: 1, text:"Dustin Browder demands more ____ in StarCraft®."}
# 1724: {active: 1, play: 1, text:"To top One More Day, future comic writers will use ____ to break up a relationship."}
# 1725: active: 1, {play: 1, text:"The real reason MAGFest was ruined was ____."}
# 1726: {active: 1, play: 2, text:"For the next Anniversary event, the TGWTG producers must battle ____ to get ____."}
# 1727: {active: 1, play: 2, text:"I write slash fanfiction pairing ____ with ____."}
# 1728: {active: 1, play: 2, text:"Next time on Obscurus Lupa Presents: ' ____ IV: The Return of ____'."}
# 1729: {active: 1, play: 2, text:"Todd in the Shadows broke the Not a Rhyme button when the singer tried to rhyme ____ with ____."}
# 1730: {active: 1, play: 2, text:"Welshy is to ____ as Sad Panda is to ____."}
# 1731: {active: 1, play: 1, text:"What is hidden in Linkara's hat?"}
# 1732: {active: 1, play: 1, text:"What was the first sign that Linkara was turning evil?"}
# 1733: {active: 1, play: 1, text:"When interviewing Linkara, be sure to ask him about ____!"}
# 1734: {active: 1, play: 3, text:"Write Linkara's next storyline as a haiku."}
# 1735: {active: 1, play: 1, text:"The reason Linkara doesn't like milk in his cereal is ____."}
# 1736: {active: 1, play: 1, text:"The secret of Linkara's magic gun is ____."}
# 1737: {active: 1, play: 2, text:"I asked Linkara to retweet ____, but instead, he retweeted ____."}
# 1738: {active: 1, play: 2, text:"Linkara's next story arc will involve him defeating ____ with the power of ____."}
# 1739: {active: 1, play: 1, text:"Being fed up with reviewing lamps, what obscure topic did Linkara review next?"}
# 1740: {active: 1, play: 1, text:"Why does Linkara have all of those Cybermats?"}
# 1741: {active: 1, play: 1, text:"At his next con appearance, Linkara will cosplay as ____."}
# 1742: {active: 1, play: 1, text:"What does Linkara eat with his chicken strips?"}
# 1743: {active: 1, play: 2, text:"____ and ____ are in the worst comic Linkara ever read."}
# 1744: {active: 1, play: 1, text:"____ is the reason Linkara doesn't like to swear."}
# 1745: {active: 1, play: 1, text:"The only thing Linkara would sell his soul for is ____."}
# 1746: {active: 1, play: 1, text:"In a surprise twist, the villain of Linkara's next story arc turned out to be ____."}
# 1747: {active: 1, play: 1, text:"Linkara now prefers to say ____ in lieu of 'fuck'."}
# 1748: {active: 1, play: 1, text:"____ will be Linkara's next cosplay."}
# 1749: {active: 1, play: 1, text:"An intervention was staged for Linkara after ____ was discovered in his hat."}
# 1750: {active: 1, play: 1, text:"Linkara was shocked when he found out Insano was secretly ____."}
# 1751: {active: 1, play: 1, text:"Linkara's Yu-Gi-Oh deck is built up with nothing but ____."}
# 1752: {active: 1, play: 1, text:"Why was Radio Dead Air shut down this time?"}
# 1753: {active: 1, play: 1, text:"During his childhood, Salvador Dalí produced hundreds of paintings of ____."}
# 1754: {active: 1, play: 2, text:"Rumor has it that Vladimir Putin's favorite delicacy is ____ stuffed with ____."}
# 1755: {active: 1, play: 1, text:"____, by Bad Dragon™."}
# 1756: {active: 1, play: 2, text:"Arlo P. Arlo's newest weapon combines ____ and ____!"}
# 1757: {active: 1, play: 1, text:"____ is something else Diamanda Hagan has to live with every day."}
# 1758: {active: 1, play: 1, text:"As part of a recent promotion, Japanese KFCs are now dressing their Colonel Sanders statues up as ____."}
# 1759: {active: 1, play: 1, text:"Brad Tries ____."}
# 1760: {active: 1, play: 1, text:"Enemies of Diamanda Hagan have been known to receive strange packages filled with ____."}
# 1761: {active: 1, play: 1, text:"What else does Diamanda Hagan have to live with every day?"}
# 1762: {active: 1, play: 1, text:"What's the real reason nobody has ever played the TGWTG Panel Drinking Game?"}
# 1763: {active: 1, play: 1, text:"When Barta isn't talking he's ____."}
# 1764: {active: 1, play: 1, text:"Hayao Miyazaki's latest family film is about a young boy befriending ____."}
# 1765: {active: 1, play: 1, text:"What is moé?"}
# 1766: {active: 1, play: 2, text:"Make a yaoi shipping."}
# 1767: {active: 1, play: 3, text:"On a night out, Golby will traditionally get into a fight with a ____ then have sex with a ____ before complaining about a hangover from too much ____."}
# 1768: {active: 1, play: 1, text:"At the last PAX, Paul and Storm had ____ thrown at them during 'Opening Band'."}
# 1769: {active: 1, play: 1, text:"What did the commenters bitch about next to Doug?"}
# 1770: {active: 1, play: 1, text:"The RDA chat knew Nash was trolling them when he played ____."}
# 1771: {active: 1, play: 3, text:"Every weekend, Golby likes to ____ then ____ before finally ____."}
# 1772: {active: 1, play: 3, text:"Every weekend, Golby enjoys drinking ____ before getting into a fight with ____ and having sex with ____."}
# 1773: {active: 1, play: 1, text:"Connie the Condor often doesn't talk on skype because of ____."}
# 1774: {active: 1, play: 1, text:"Jorgi the Corgi most definitely enjoys ____."}
# 1775: {active: 1, play: 1, text:"It's DJ Manny in the hizouse, playing ____ all night long!"}
# 1776: {active: 1, play: 2, text:"____ + ____ = Golby."}
# 1777: {active: 1, play: 1, text:"____ was the first thing to go when Hagan took over the world."}
# 1778: {active: 1, play: 1, text:"What broke Nash this week?"}
# 1779: {active: 1, play: 1, text:"In his latest review, Phelous was killed by ____."}
# 1780: {active: 1, play: 1, text:"This weekend, the nation of Haganistan will once again commence its annual celebration of ____. "}
# 1781: {active: 1, play: 1, text:"What is the real reason Demo Reel failed?"}
# 1782: {active: 1, play: 1, text:"To troll the RDA chat this time, Todd requested a song by ____."}
# 1783: {active: 1, play: 1, text:"Todd knew he didn't have a chance after trying to seduce Lupa with ____."}
# 1784: {active: 1, play: 1, text:"Turns out, that wasn't tea in MikeJ's cup, it was ____."}
# 1785: {active: 1, play: 1, text:"Viewers were shocked when Paw declared ____ the best song of the movie."}
# 1786: {active: 1, play: 1, text:"Well, I've read enough fanfic about ____ and Lupa to last a lifetime."}
# 1787: {active: 1, play: 1, text:"What does Nash like to sing about?"}
# 1788: {active: 1, play: 1, text:"What does Todd look like under his mask?"}
# 1789: {active: 1, play: 1, text:"What will Tara name her next hippo?"}
# 1790: {active: 1, play: 1, text:"Cindi suddenly turned into Steven after ____."}
# 1791: {active: 1, play: 1, text:"In the latest chapter of Toriko, our hero hunts down, kills, and eats a creature made entirely of ____."}
# 1792: {active: 1, play: 1, text:"The rarest Pokémon in my collection is ____."}
# 1793: {active: 1, play: 1, text:"Mamoru Oshii's latest film is a slow-paced, two hour-long cerebral piece about the horrors of ____."}
# 1794: {active: 1, play: 1, text:"The next big Tokusatsu show: 'Super Sentai ____ Ranger!'"}
# 1795: {active: 1, play: 1, text:"In the latest chapter of Golgo 13, he kills his target with ____."}
# 1796: {active: 1, play: 3, text:"In the latest episode of Case Closed, Conan deduces that it was ____ who killed ____ because of ____."}
# 1797: {active: 1, play: 1, text:"Behold the name of my Zanpakuto, ____!"}
# 1798: {active: 1, play: 1, text:"What do Brad and Floyd like to do after a long day?"}
# 1799: {active: 1, play: 1, text:"Yoko Kanno's latest musical score features a song sung entirely by ____."}
# 1800: {active: 1, play: 1, text:"Who placed first in the most recent Shonen Jump popularity poll?"}
# 1801: {active: 1, play: 3, text:"In this episode of Master Keaton, Keaton builds ____ out of ____ and ____."}
# 1802: {active: 1, play: 1, text:"So just who is this Henry Goto fellow, anyway?"}
# 1803: {active: 1, play: 1, text:"When Henry Goto is alone and thinks that no one's looking, he secretly enjoys ____."}
# 1804: {active: 1, play: 1, text:"In her newest review, Diamanda Hagan finds herself in the body of ____."}
# 1805: {active: 1, play: 1, text:"Madoka Kyouno's nickname for Muginami's older brother is ____."}
# 1806: {active: 1, play: 2, text:"____ has won the national Equestrian award for ____."}
# 1807: {active: 1, play: 1, text:"Every Morning, Princess Celestia Rises ____."}
# 1808: {active: 1, play: 1, text:"Lauren Faust was shocked to find ____ in her mailbox."}
# 1809: {active: 1, play: 1, text:"Luna didn't help in the fight against Chrysalis because she was too busy with ____."}
# 1810: {active: 1, play: 1, text:"Not many people know that Tara Strong is also the voice of ____."}
# 1811: {active: 1, play: 1, text:"Everypony was shocked to discover that Scootaloo's cutie mark was ____."}
# 1812: {active: 1, play: 3, text:"In a fit of rage, Princess Celestia sent ____ to the ____ for ____."}
# 1813: {active: 1, play: 1, text:"Ponyville was shocked to discover ____ in Fluttershy's shed."}
# 1814: {active: 1, play: 1, text:"Prince Blueblood's cutie mark represents ____."}
# 1815: {active: 1, play: 1, text:"Rainbow Dash has always wanted ____."}
# 1816: {active: 1, play: 1, text:"Rainbow Dash is the only pony in all of Equestria who can ____."}
# 1817: {active: 1, play: 1, text:"Rainbow Dash received a concussion after flying into ____."}
# 1818: {active: 1, play: 1, text:"Super Speedy ____ Squeezy 5000."}
# 1819: {active: 1, play: 1, text:"Surprisingly, Canterlot has a museum of ____."}
# 1820: {active: 1, play: 1, text:"The Everfree forest is full of ____."}
# 1821: {active: 1, play: 1, text:"The national anthem of Equestria is ____."}
# 1822: {active: 1, play: 1, text:"The only way to get Opal in the bath is with ____."}
# 1823: {active: 1, play: 2, text:"The worst mishap caused by Princess Cadance was when she made ____ and ____ fall in love."}
# 1824: {active: 1, play: 1, text:"To much controversy, Princess Celestia made ____ illegal."}
# 1825: {active: 1, play: 2, text:"Today, Mayor Mare announced her official campaign position on ____ and ____. No pony was the least bit surprised."}
# 1826: {active: 1, play: 1, text:"Twilight got bored with the magic of friendship, and now studies the magic of ____."}
# 1827: {active: 1, play: 1, text:"Twilight Sparkle owns far more books on ____ than she'd like to admit."}
# 1828: {active: 1, play: 1, text:"If Gordon Freeman spoke, what would he talk about?"}
# 1829: {active: 1, play: 1, text:"Wake up, Mr. Freeman. Wake up and ____."}
# 1830: {active: 1, play: 1, text:"Without any warning, Pinkie Pie burst into a song about ____."}
# 1831: {active: 1, play: 1, text:"You're a human transported to Equestria! The first thing you'd look for is ____."}
# 1832: {active: 1, play: 1, text:"As a way of apologizing for a poorly received episode, E Rod promised to review ____."}
# 1833: {active: 1, play: 1, text:"E Rod has a new dance move called ____."}
# 1834: {active: 1, play: 1, text:"Even Kyle thinks ____ is pretentious."}
# 1835: {active: 1, play: 1, text:"Here There Be ____."}
# 1836: {active: 1, play: 1, text:"Hey kids, I'm Nash, and I couldn't make ____ up if I tried."}
# 1837: {active: 1, play: 1, text:"Hey Nash, whatcha playin'?"}
# 1838: {active: 1, play: 1, text:"How is Bennett going to creep out Ask That Guy this time? "}
# 1839: {active: 1, play: 1, text:"In his most recent Avatar vlog, Doug's favorite thing about the episode was ____."}
# 1840: {active: 1, play: 1, text:"In the newest Cheap Damage, CR looks at the trading card game version of ____."}
# 1841: {active: 1, play: 1, text:"Leon Thomas almost named his show Renegade ____."}
# 1842: {active: 1, play: 1, text:"Luke Mochrie proved he was still part of the site by____."}
# 1843: {active: 1, play: 1, text:"On the next WTFIWWY, Nash will give us a brief history of ____."}
# 1844: {active: 1, play: 1, text:"The last time Welshy and Film Brain were in a room together, they ended up ____."}
# 1845: {active: 1, play: 1, text:"This week, Nash's beer is made with ____."}
# 1846: {active: 1, play: 1, text:"What did Doug bring to the set of To Boldly Flee?"}
# 1847: {active: 1, play: 1, text:"What does Ven have to do now?"}
# 1848: {active: 1, play: 1, text:"What hot, trendy new dance will feature in Paw's next Dance Spectacular?"}
# 1849: {active: 1, play: 1, text:"What is Snowflame's only known weakness?"}
# 1850: {active: 1, play: 1, text:"What new upgrade did Nash give Laura?"}
# 1851: {active: 1, play: 1, text:"What will Nash try to kill next with his hammer?"}
# 1852: {active: 1, play: 1, text:"When Arlo The Orc turns into a werewolf, he likes to snack on ____."}
# 1853: {active: 1, play: 1, text:"When not reviewing or ruling Haganistan with an iron fist, Hagan's hobby is ____."}
# 1854: {active: 1, play: 1, text:"Who REALLY called Oancitizen to help him snap out of his ennui?"}
# 1855: {active: 1, play: 1, text:"Whose ass did Zodann kick this time?"}
# 1856: {active: 1, play: 1, text:"Why did Nash go to Chicago?"}
# 1857: {active: 1, play: 1, text:"Why doesn't Doug ever attend MAGFest?"}
# 1858: {active: 1, play: 1, text:"Why doesn't Film Brain have an actual reviewer costume?"}
# 1859: {active: 1, play: 2, text:"The MAGFest Nerf War took a dark turn when ____ was waylaid by ____."}
# 1860: {active: 1, play: 2, text:"For a late night snack, Nash made a sandwich of ____ and ____."}
# 1861: {active: 1, play: 2, text:"At ConBravo, ____ will be hosting a panel on ____."}
# 1862: {active: 1, play: 2, text:"Sad Panda is actually ____ and ____."}
# 1863: {active: 1, play: 2, text:"After ____, Phelous regenerated into ____. "}
# 1864: {active: 1, play: 1, text:"The stream broke when Ryuka stepped on the ____ key."}
# 1865: {active: 1, play: 1, text:"Krazy Mike lost to ____!"}
# 1866: {active: 1, play: 1, text:"What would you do if Ohm really did just die?"}
# 1867: {active: 1, play: 1, text:"JSmithOTI is referred to as a Scumlord, but his friends call him ____."}
# 1868: {active: 1, play: 1, text:"Follow MichaelALFox on Twitter and you can see pictures of ____."}
# 1869: {active: 1, play: 1, text:"After Mars, ____ is the next furthest planet from the sun."}
# 1870: {active: 1, play: 1, text:"What would Ohm do?"}
# 1871: {active: 1, play: 1, text:"Northernlion's cat Ryuka is known for ____ while he records."}
# 1872: {active: 1, play: 1, text:"What gave Ohmwrecker his gaming powers?"}
# 1873: {active: 1, play: 2, text:"It's true that Green9090 is ____, but we must all admit that Ohm is better at ____"}
# 1874: {active: 1, play: 2, text:"Today on Crusader Kings 2, NL plays King ____ the ____."}
# 1875: {active: 1, play: 2, text:"After winning yet another race, Josh made ____ tweet about ____."}
# 1876: {active: 1, play: 1, text:"What can be found in Arin's chins?"}
# 1877: {active: 1, play: 1, text:"What do Mumbo's magic words mean?"}
# 1878: {active: 1, play: 1, text:"What's better than Skyward Sword?"}
# 1879: {active: 1, play: 1, text:"What's the real reason Jon left?"}
# 1880: {active: 1, play: 1, text:"Who replaced Jon when he left GameGrumps?"}
# 1881: {active: 1, play: 1, text:"Why is Steam Train so controversial?"}
# 1882: {active: 1, play: 1, text:"This time on Guest Grumps, we have ____."}
# 1883: {active: 1, play: 1, text:"Top five games, go! 1? Mega Man X. 2-5? ____."}
# 1884: {active: 1, play: 1, text:"Next time on Game Grumps, ____!"}
# 1885: {active: 1, play: 1, text:"Jon and Arin suck at ____."}
# 1886: {active: 1, play: 1, text:"Jon and Arin win! They realize ____ is more important."}
# 1887: {active: 1, play: 1, text:"How many ____ does Mega Man get?"}
# 1888: {active: 1, play: 1, text:"Game Grumps: sponsored by ____."}
# 1889: {active: 1, play: 1, text:"____. Put that in, Barry."}
# 1890: {active: 1, play: 1, text:"'These new ____ t-shirts are gonna change some lives, Arin.'"}
# 1891: {active: 1, play: 1, text:"____ Grumps!"}
# 1892: {active: 1, play: 1, text:"____ is Jon's favorite video game of all time."}
# 1893: {active: 1, play: 1, text:"____ is not Jon's strong suit."}
# 1894: {active: 1, play: 2, text:"The Grumps' latest silly player names are ____ and ____."}
# 1895: {active: 1, play: 2, text:"In this corner, ____; in the other corner, ____; it's Game Grumps VS!"}
# 1896: {active: 1, play: 1, text:"____ is probably a Venusaur kind of guy."}
# 1897: {active: 1, play: 1, text:"If Jack was frog and you kissed him, what would he turn into?"}
# 1898: {active: 1, play: 1, text:"The next RvB cameo will be voiced by ____."}
# 1899: {active: 1, play: 1, text:"They questioned Ryan's sanity after finding ____ in his house."}
# 1900: {active: 1, play: 1, text:"What does Ryan's kid listen to?"}
# 1901: {active: 1, play: 1, text:"What makes Michael the angriest?"}
# 1902: {active: 1, play: 1, text:"What mysteries lie beyond Jack's beard? "}
# 1903: {active: 1, play: 1, text:"What's in Gavin's desk?"}
# 1904: {active: 1, play: 1, text:"Where does Ray belong?"}
# 1905: {active: 1, play: 1, text:"Why is Geoff cool?"}
# 1906: {active: 1, play: 1, text:"Why was Michael screaming at Gavin?"}
# 1907: {active: 1, play: 2, text:"Buzzfeed presents: 10 pictures of ____ that look like ____."}
}
| 1748 | exports.numcards = !->
return Object.keys(exports.cards()).length
exports.getCard = (id) !->
return exports.cards()[id]
# New cards should be added/uncommented *after* the last uncommented card. That way, the
# plugin will automatically add the new cards to existing games.
exports.cards = !->
return {
1: {active: 1, play: 1, text:"Who stole the cookies from the cookie jar?"}
2: {active: 1, play: 1, text:"What is the next great Kickstarter project?"}
3: {active: 1, play: 1, text:"What's the next superhero?"}
4: {active: 1, play: 1, text:"____ 2012."}
5: {active: 1, play: 1, text:"____."}
6: {active: 1, play: 2, text:"Personals ad: Seeking a female who doesn't mind ____, might also be willing to try a male if they're ____."}
7: {active: 1, play: 1, text:"Why can't I sleep at night?"}
8: {active: 1, play: 1, text:"What's that smell?"}
9: {active: 1, play: 1, text:"What's that sound?"}
10: {active: 1, play: 1, text:"What ended my last relationship?"}
11: {active: 1, play: 1, text:"What is <NAME>'s guilty pleasure?"}
12: {active: 1, play: 1, text:"What's a girl's best friend?"}
13: {active: 1, play: 1, text:"What does <NAME> prefer?"}
14: {active: 1, play: 1, text:"What's the most emo?"}
15: {active: 1, play: 1, text:"What are my parents hiding from me?"}
16: {active: 1, play: 1, text:"What will always get you laid?"}
17: {active: 1, play: 1, text:"What did I bring back from Mexico?"}
18: {active: 1, play: 1, text:"What don't you want to find in your Chinese food?"}
19: {active: 1, play: 1, text:"What will I bring back in time to convince people that I am a powerful wizard?"}
20: {active: 1, play: 1, text:"How am I maintaining my relationship status?"}
21: {active: 1, play: 1, text:"What gives me uncontrollable gas?"}
22: {active: 1, play: 1, text:"What do old people smell like? "}
23: {active: 1, play: 1, text:"What's my secret power?"}
24: {active: 1, play: 1, text:"What's there a ton of in heaven?"}
25: {active: 1, play: 1, text:"What would grandma find disturbing, yet oddly charming?"}
26: {active: 1, play: 1, text:"What did the U.S. airdrop to the children of Afghanistan?"}
27: {active: 1, play: 1, text:"What helps Obama unwind?"}
28: {active: 1, play: 1, text:"What did Vin Diesel eat for dinner?"}
29: {active: 1, play: 1, text:"Why am I sticky?"}
30: {active: 1, play: 1, text:"What gets better with age?"}
31: {active: 1, play: 1, text:"What's the crustiest?"}
32: {active: 1, play: 1, text:"What's Teach for America using to inspire inner city students to succeed?"}
33: {active: 1, play: 3, text:"Make a haiku."}
34: {active: 1, play: 1, text:"Why do I hurt all over?"}
35: {active: 1, play: 1, text:"What's my anti-drug?"}
36: {active: 1, play: 1, text:"What never fails to liven up the party?"}
37: {active: 1, play: 1, text:"What's the new fad diet?"}
38: {active: 1, play: 1, text:"I got 99 problems but ____ ain't one."}
39: {active: 1, play: 1, text:"TSA guidelines now prohibit ____ on airplanes."}
40: {active: 1, play: 1, text:"MTV's new reality show features eight washed-up celebrities living with ____."}
41: {active: 1, play: 1, text:"I drink to forget ____."}
42: {active: 1, play: 1, text:"I'm sorry, <NAME>, but I couldn't complete my homework because of ____."}
43: {active: 1, play: 1, text:"During Picasso's often-overlooked Brown Period, he produced hundreds of paintings of ____."}
44: {active: 1, play: 1, text:"Alternative medicine is now embracing the curative powers of ____."}
45: {active: 1, play: 1, text:"Anthropologists have recently discovered a primitive tribe that worships ____."}
46: {active: 1, play: 1, text:"It's a pity that kids these days are all getting involved with ____."}
47: {active: 1, play: 1, text:"____. That's how I want to die."}
48: {active: 1, play: 1, text:"In the new Disney Channel Original Movie, <NAME>ana struggles with ____ for the first time."}
49: {active: 1, play: 1, text:"I wish I hadn't lost the instruction manual for ____."}
50: {active: 1, play: 1, text:"Instead of coal, Santa now gives the bad children ____."}
51: {active: 1, play: 1, text:"In 1,000 years, when paper money is but a distant memory, ____ will be our currency."}
52: {active: 1, play: 1, text:"A romantic, candlelit dinner would be incomplete without ____."}
53: {active: 1, play: 1, text:"Next from <NAME>: <NAME> and the Chamber of ____."}
54: {active: 1, play: 1, text:"____. Betcha can't have just one!"}
55: {active: 1, play: 1, text:"White people like ____."}
56: {active: 1, play: 1, text:"____. High five, bro."}
57: {active: 1, play: 1, text:"During sex, I like to think about ____."}
58: {active: 1, play: 1, text:"When I'm in prison, I'll have ____ smuggled in."}
59: {active: 1, play: 1, text:"When I am the President of the United States, I will create the Department of ____."}
60: {active: 1, play: 1, text:"Major League Baseball has banned ____ for giving players an unfair advantage."}
61: {active: 1, play: 1, text:"When I am a billionare, I shall erect a 50-foot statue to commemorate ____."}
62: {active: 1, play: 1, text:"____. It's a trap!"}
63: {active: 1, play: 1, text:"Coming to Broadway this season, ____: The Musical."}
64: {active: 1, play: 1, text:"Due to a PR fiasco, Walmart no longer offers ____."}
65: {active: 1, play: 1, text:"But before I kill you, Mr. <NAME>, I must show you ____."}
66: {active: 1, play: 1, text:"When Pharaoh remained unmoved, <NAME> called down a plague of ____."}
67: {active: 1, play: 1, text:"The class field trip was completely ruined by ____."}
68: {active: 1, play: 1, text:"In <NAME>'s final moments, he thought about ____."}
69: {active: 1, play: 1, text:"In an attempt to reach a wider audience, the Smithsonian Museum of Natural History has opened an interactive exhibit on ____."}
70: {active: 1, play: 1, text:"Studies show that lab rats navigate mazes 50% faster after being exposed to ____."}
71: {active: 1, play: 1, text:"I do not know with which weapons World War III will be fought, but World War IV will be fought with ____."}
72: {active: 1, play: 1, text:"Life was difficult for cavemen before ____."}
73: {active: 1, play: 1, text:"____: Good to the last drop."}
74: {active: 1, play: 1, text:"____: kid-tested, mother-approved."}
75: {active: 1, play: 2, text:"And the Academy Award for ____ goes to ____."}
76: {active: 1, play: 2, text:"For my next trick, I will pull ____ out of ____."}
77: {active: 1, play: 2, text:"____ is a slippery slope that leads to ____."}
78: {active: 1, play: 2, text:"In a world ravaged by ____, our only solace is ____."}
79: {active: 1, play: 2, text:"In his new summer comedy, <NAME> is ____ trapped in the body of ____."}
80: {active: 1, play: 2, text:"I never truly understood ____ until I encountered ____."}
81: {active: 1, play: 2, text:"When I was tripping on acid, ____ turned into ____."}
82: {active: 1, play: 2, text:"That's right, I killed ____. How, you ask? ____."}
83: {active: 1, play: 3, text:"____ + ____ = ____."}
84: {active: 1, play: 1, text:"What is <NAME> so curious about?"}
85: {active: 1, play: 1, text:"O Canada, we stand on guard for ____."}
86: {active: 1, play: 1, text:"Air Canada guidelines now prohibit ____ on airplanes."}
87: {active: 1, play: 1, text:"In an attempt to reach a wider audience, the Royal Ontario Museum has opened an interactive exhibit on ____."}
88: {active: 1, play: 2, text:"CTV presents ____, the story of ____."}
89: {active: 1, play: 1, text:"What's the Canadian government using to inspire rural students to succeed?"}
90: {active: 1, play: 1, text:"He who controls ____ controls the world."}
91: {active: 1, play: 1, text:"The CIA now interrogates enemy agents by repeatedly subjecting them to ____."}
92: {active: 1, play: 2, text:"Dear Sir or <NAME>, We regret to inform you that the Office of ____ has denied your request for ____."}
93: {active: 1, play: 1, text:"In Rome, there are whisperings that the Vatican has a secret room devoted to ____."}
94: {active: 1, play: 1, text:"Science will never explain the origin of ____."}
95: {active: 1, play: 1, text:"When all else fails, I can always masturbate to ____."}
96: {active: 1, play: 1, text:"I learned the hard way that you can't cheer up a grieving friend with ____."}
97: {active: 1, play: 1, text:"In its new tourism campaign, <NAME>roit proudly proclaims that it has finally eliminated ____."}
98: {active: 1, play: 2, text:"An international tribunal has found ____ guilty of ____."}
99: {active: 1, play: 1, text:"The socialist governments of Scandinavia have declared that access to ____ is a basic human right."}
100: {active: 1, play: 1, text:"In his new self-produced album, Kanye West raps over the sounds of ____."}
101: {active: 1, play: 1, text:"What's the gift that keeps on giving?"}
102: {active: 1, play: 1, text:"This season on Man vs. Wild, Bear Grylls must survive in the depths of the Amazon with only ____ and his wits."}
103: {active: 1, play: 1, text:"When I pooped, what came out of my butt?"}
104: {active: 1, play: 1, text:"In the distant future, historians will agree that ____ marked the beginning of America's decline."}
105: {active: 1, play: 2, text:"In a pinch, ____ can be a suitable substitute for ____."}
106: {active: 1, play: 1, text:"What has been making life difficult at the nudist colony?"}
107: {active: 1, play: 1, text:"What is the next big sideshow attraction?"}
108: {active: 1, play: 1, text:"Praise ____!"}
109: {active: 1, play: 2, text:"What's the next superhero/sidekick duo?"}
110: {active: 1, play: 1, text:"<NAME>, why is <NAME> crying?"}
111: {active: 1, play: 1, text:"And I would have gotten away with it, too, if it hadn't been for ____!"}
112: {active: 1, play: 1, text:"What brought the orgy to a grinding halt?"}
113: {active: 1, play: 1, text:"During his midlife crisis, my dad got really into ____."}
114: {active: 1, play: 2, text:"____ would be woefully incomplete without ____."}
115: {active: 1, play: 1, text:"Before I run for president, I must destroy all evidence of my involvement with ____."}
116: {active: 1, play: 1, text:"This is your captain speaking. Fasten your seatbelts and prepare for ____."}
117: {active: 1, play: 1, text:"The Five Stages of Grief: denial, anger, bargaining, ____, acceptance."}
118: {active: 1, play: 2, text:"My mom freaked out when she looked at my browser history and found ____.com/____."}
119: {active: 1, play: 3, text:"I went from ____ to ____, all thanks to ____."}
120: {active: 1, play: 1, text:"Members of New York's social elite are paying thousands of dollars just to experience ____."}
121: {active: 1, play: 1, text:"This month's Cosmo: 'Spice up your sex life by bringing ____ into the bedroom.'"}
122: {active: 1, play: 2, text:"If God didn't want us to enjoy ____, he wouldn't have given us ____."}
123: {active: 1, play: 1, text:"After months of debate, the Occupy Wall Street General Assembly could only agree on 'More ____!'"}
124: {active: 1, play: 2, text:"I spent my whole life working toward ____, only to have it ruined by ____."}
125: {active: 1, play: 1, text:"Next time on Dr. <NAME>: How to talk to your child about ____."}
126: {active: 1, play: 1, text:"Only two things in life are certain: death and ____."}
127: {active: 1, play: 1, text:"Everyone down on the ground! We don't want to hurt anyone. We're just here for ____."}
128: {active: 1, play: 1, text:"The healing process began when I joined a support group for victims of ____."}
129: {active: 1, play: 1, text:"The votes are in, and the new high school mascot is ____."}
130: {active: 1, play: 2, text:"Before ____, all we had was ____."}
131: {active: 1, play: 1, text:"Tonight on 20/20: What you don't know about ____ could kill you."}
132: {active: 1, play: 2, text:"You haven't truly lived until you've experienced ____ and ____ at the same time."}
133: {active: 1, play: 1, text:"____? There's an app for that."}
134: {active: 1, play: 1, text:"Maybe she's born with it. Maybe it's ____."}
135: {active: 1, play: 1, text:"In L.A. County Jail, word is you can trade 200 cigarettes for ____."}
136: {active: 1, play: 1, text:"Next on ESPN2, the World Series of ____."}
137: {active: 1, play: 2, text:"Step 1: ____. Step 2: ____. Step 3: Profit."}
138: {active: 1, play: 1, text:"Life for American Indians was forever changed when the White Man introduced them to ____."}
139: {active: 1, play: 1, text:"On the third day of Christmas, my true love gave to me: three French hens, two turtle doves, and ____."}
140: {active: 1, play: 1, text:"Wake up, America. Christmas is under attack by secular liberals and their ____."}
141: {active: 1, play: 1, text:"Every Christmas, my uncle gets drunk and tells the story about ____."}
142: {active: 1, play: 1, text:"What keeps me warm during the cold, cold winter?"}
143: {active: 1, play: 1, text:"After blacking out during New Year's Eve, I was awoken by ____."}
144: {active: 1, play: 2, text:"____ Jesus is the Jesus of ____."}
145: {active: 1, play: 2, text:"____ ALL THE ____."}
146: {active: 1, play: 2, text:"There were A LOT of ____ doing ____."}
147: {active: 1, play: 1, text:"Simple dog ate and vomited ____."}
148: {active: 1, play: 1, text:"When I was 25, I won an award for ____."}
149: {active: 1, play: 1, text:"I'm more awesome than a T-rex because of ____."}
150: {active: 1, play: 1, text:"____ in my pants."}
151: {active: 1, play: 1, text:"Clean ALL the ____."}
152: {active: 1, play: 1, text:"The first rule of Jade Club is ____."}
153: {active: 1, play: 2, text:"The forum nearly broke when ____ posted ____ in The Dead Thread."}
154: {active: 1, play: 1, text:"No one likes me after I posted ____ in the TMI thread."}
155: {active: 1, play: 1, text:"____ for president!"}
156: {active: 1, play: 1, text:"I did ____, like a fucking adult."}
157: {active: 1, play: 2, text:"Domo travelled across ____ to win the prize of ____."}
158: {active: 1, play: 1, text:"After Blue posted ____ in chat, I never trusted his links again."}
159: {active: 1, play: 1, text:"Fuck you, I'm a ____."}
160: {active: 1, play: 1, text:"Cunnilungus and psychiatry brought us to ____."}
161: {active: 1, play: 2, text:"I CAN ____ ACROSS THE ____."}
162: {active: 1, play: 1, text:"____ is the only thing that matters."}
163: {active: 1, play: 1, text:"I'm an expert on ____."}
164: {active: 1, play: 1, text:"What can you always find in between the couch cushions?"}
165: {active: 1, play: 1, text:"I want ____ in my mouflon RIGHT MEOW."}
166: {active: 1, play: 1, text:"Don't get mad, get ____."}
167: {active: 1, play: 1, text:"Have fun, don't be ____."}
168: {active: 1, play: 1, text:"It's the end of ____ as we know it."}
169: {active: 1, play: 1, text:"____ is my worst habit."}
170: {active: 1, play: 1, text:"Everything's better with ____."}
171: {active: 1, play: 1, text:"What would you taste like?"}
172: {active: 1, play: 1, text:"What have you accomplished today?"}
173: {active: 1, play: 1, text:"What made you happy today?"}
174: {active: 1, play: 1, text:"Why are you frothing with rage?"}
175: {active: 1, play: 1, text:"What mildy annoyed you today?"}
176: {active: 1, play: 1, text:"We'll always have ____."}
177: {active: 1, play: 2, text:"____ uses ____. It is SUPER EFFECTIVE!"}
178: {active: 1, play: 1, text:"Let's all rock out to the sounds of ____."}
179: {active: 1, play: 1, text:"Take ____, it will last longer."}
180: {active: 1, play: 1, text:"You have my bow. AND MY ____."}
181: {active: 1, play: 2, text:"A wild ____ appeared! It used ____!"}
182: {active: 1, play: 2, text:"I thought being a ____ was the best thing ever, until I became a ____."}
183: {active: 1, play: 1, text:"Live long and ____."}
184: {active: 1, play: 1, text:"The victim was found with ____."}
185: {active: 1, play: 2, text:"If life gives you ____, make ____."}
186: {active: 1, play: 1, text:"Who needs a bidet when you have ____?"}
187: {active: 1, play: 1, text:"Kill it with ____!"}
188: {active: 1, play: 1, text:"My ____ is too big!"}
189: {active: 1, play: 3, text:"Best drink ever: One part ____, three parts ____, and a splash of ____."}
190: {active: 1, play: 1, text:"____ makes me uncomfortable."}
191: {active: 1, play: 1, text:"Stop, drop, and ____."}
192: {active: 1, play: 1, text:"Think before you ____."}
193: {active: 1, play: 2, text:"The hills are alive with ____ of ____."}
194: {active: 1, play: 1, text:"What is love without ____?"}
195: {active: 1, play: 2, text:"____ is the name of my ____ cover band."}
196: {active: 1, play: 1, text:"I have an idea even better than Kickstarter, and it's called ____starter."}
197: {active: 1, play: 1, text:"You have been waylaid by ____ and must defend yourself."}
198: {active: 1, play: 1, text:"Action stations! Action stations! Set condition one throughout the fleet and brace for ____!"}
199: {active: 1, play: 2, text:"____: Hours of fun. Easy to use. Perfect for ____!"}
200: {active: 1, play: 1, text:"Turns out that ____-Man was neither the hero we needed nor wanted."}
201: {active: 1, play: 1, text:"What left this stain on my couch?"}
202: {active: 1, play: 1, text:"A successful job interview begins with a firm handshake and ends with ____."}
203: {active: 1, play: 1, text:"Lovin' you is easy 'cause you're ____."}
204: {active: 1, play: 1, text:"Money can't buy me love, but it can buy me ____."}
205: {active: 1, play: 2, text:"Listen, son. If you want to get involved with ____, I won't stop you. Just steer clear of ____."}
206: {active: 1, play: 1, text:"During high school, I never really fit in until I found ____ club."}
207: {active: 1, play: 1, text:"Hey baby, come back to my place and I'll show you ____."}
208: {active: 1, play: 1, text:"Finally! A service that delivers ____ right to your door."}
209: {active: 1, play: 1, text:"My gym teacher got fired for adding ____ to the obstacle course."}
210: {active: 1, play: 2, text:"When you get right down to it, ____ is just ____."}
211: {active: 1, play: 1, text:"In the seventh circle of Hell, sinners must endure ____ for all eternity."}
212: {active: 1, play: 2, text:"After months of practice with ____, I think I'm finally ready for ____."}
213: {active: 1, play: 1, text:"The blind date was going horribly until we discovered our shared interest in ____."}
214: {active: 1, play: 1, text:"____. Awesome in theory, kind of a mess in practice."}
215: {active: 1, play: 2, text:"With enough time and pressure, ____ will turn into ____."}
216: {active: 1, play: 1, text:"I'm not like the rest of you. I'm too rich and busy for ____."}
217: {active: 1, play: 1, text:"And what did you bring for show and tell?"}
218: {active: 1, play: 2, text:"Having problems with ____? Try ____!"}
219: {active: 1, play: 1, text:"____.tumblr.com"}
220: {active: 1, play: 1, text:"What's the next Happy Meal toy?"}
221: {active: 1, play: 2, text:"My life is ruled by a vicious cycle of ____ and ____."}
222: {active: 1, play: 2, text:"After I saw ____, I needed ____."}
223: {active: 1, play: 1, text:"There's ____ in my soup."}
224: {active: 1, play: 1, text:"____ sounds like a great alternative rock band."}
225: {active: 1, play: 1, text:"____? Well, I won't look a gift horse in the mouth on that one."}
226: {active: 1, play: 1, text:"____. Everything else is uncivilized."}
227: {active: 1, play: 1, text:"'Hey everybody and welcome to Let's Look At ____!'"}
228: {active: 1, play: 1, text:"Best game of 2013? ____, of course."}
229: {active: 1, play: 1, text:"But that ____ has sailed."}
230: {active: 1, play: 1, text:"Fuck the haters, this is ____."}
231: {active: 1, play: 1, text:"Get in my ____ zone."}
232: {active: 1, play: 1, text:"How do you get your dog to stop humping your leg?"}
233: {active: 1, play: 1, text:"I can do ____ and die immediately afterward."}
234: {active: 1, play: 1, text:"Invaded the world of ____."}
235: {active: 1, play: 1, text:"It's ____, ya dangus!"}
236: {active: 1, play: 1, text:"Legend has it, the Thug of Porn was arrested for ____."}
237: {active: 1, play: 1, text:"Let's Look At: ____."}
238: {active: 1, play: 1, text:"More like the Duke of ____, right?"}
239: {active: 1, play: 1, text:"No one man should have all that ____."}
240: {active: 1, play: 1, text:"Only in Korea can you see ____."}
241: {active: 1, play: 1, text:"Praise the ____!"}
242: {active: 1, play: 1, text:"Roguelike? How about ___-like."}
243: {active: 1, play: 1, text:"Sometimes, a man's just gotta ____."}
244: {active: 1, play: 1, text:"The hero of the stream was ____."}
245: {active: 1, play: 1, text:"____? It's a DLC item."}
246: {active: 1, play: 1, text:"This new game is an interesting ____-like-like."}
247: {active: 1, play: 1, text:"We're rolling in ____!"}
248: {active: 1, play: 1, text:"Today's trivia topic is ____."}
249: {active: 1, play: 1, text:"What do you give to the CEO of Youtube as a gift?"}
250: {active: 1, play: 1, text:"Well there's nothing wrong with ____ by any stretch of the imagination."}
251: {active: 1, play: 1, text:"I'd sacrifice ____ at the Altar."}
252: {active: 1, play: 3, text:"The Holy Trinity: ____, ____, and ____!"}
253: {active: 1, play: 2, text:"____ was indicted on account of ____."}
254: {active: 1, play: 2, text:"____: The ____ Story."}
255: {active: 1, play: 2, text:"Hello everybody, welcome to a new episode of ____ plays ____."}
256: {active: 1, play: 1, text:"I've always wanted to become a voice actor, so I could play the role of ____."}
257: {active: 1, play: 1, text:"____. And now I'm bleeding."}
258: {active: 1, play: 1, text:"While the United States raced the Soviet Union to the moon, the Mexican government funneled millions of pesos into research on ____."}
259: {active: 1, play: 1, text:"My life for ____!"}
260: {active: 1, play: 1, text:"Who let the dogs out?"}
261: {active: 1, play: 1, text:"In his next movie, <NAME> saves the world from ____."}
262: {active: 1, play: 1, text:"<NAME> has revealed her new dress will be made of ____."}
263: {active: 1, play: 1, text:"<NAME>'s new song is all about ____."}
264: {active: 1, play: 2, text:"The new fad diet is all about making people do ____ and eat ____."}
265: {active: 1, play: 1, text:"I whip my ____ back and forth."}
266: {active: 1, play: 1, text:"When North Korea gets ____, it will be the end of the world."}
267: {active: 1, play: 3, text:"Plan a three course meal."}
268: {active: 1, play: 1, text:"Tastes like ____."}
269: {active: 1, play: 1, text:"What is literally worse than Hitler?"}
270: {active: 1, play: 1, text:"____ ruined many people's childhood."}
271: {active: 1, play: 1, text:"Who needs college when you have ____."}
272: {active: 1, play: 1, text:"When short on money, you can always ____."}
273: {active: 1, play: 2, text:"The next pokemon will combine ____ and ____."}
274: {active: 1, play: 1, text:"Instead of playing Cards Against Humanity, you could be ____."}
275: {active: 1, play: 1, text:"One does not simply walk into ____."}
276: {active: 1, play: 1, text:"Welcome to my secret lair on ____."}
277: {active: 1, play: 1, text:"What is the answer to life's question?"}
278: {active: 1, play: 1, text:"I've got the whole world in my ____."}
279: {active: 1, play: 1, text:"I never thought ____ would be so enjoyable."}
280: {active: 1, play: 1, text:"In his second term, Obama will rid America of ____."}
281: {active: 1, play: 1, text:"What is Japan's national pastime?"}
282: {active: 1, play: 1, text:"Suck my ____."}
283: {active: 1, play: 1, text:"In the future, ____ will fuel our cars."}
284: {active: 1, play: 1, text:"The lion, the witch, and ____."}
285: {active: 1, play: 1, text:"In the next episode, <NAME> gets introduced to ____. "}
286: {active: 1, play: 1, text:"____ Game of the Year Edition."}
287: {active: 1, play: 1, text:"What was going through Osama Bin Laden's head before he died?"}
288: {active: 1, play: 1, text:"In a news conference, Obama pulled out ____, to everyone's surprise."}
289: {active: 1, play: 1, text:"Nights filled with ____."}
290: {active: 1, play: 1, text:"If the anime industry is dying, what will be the final nail in it's coffin?"}
291: {active: 1, play: 2, text:"If a dog and a dolphin can get along, why not ____ and ____?"}
292: {active: 1, play: 2, text:"If I wanted to see ____, I'll stick with ____, thank you very much."}
293: {active: 1, play: 1, text:"Ladies and gentlemen, I give you ____... COVERED IN BEES!!!"}
294: {active: 1, play: 1, text:"Don't stand behind him, if you value your ____."}
295: {active: 1, play: 2, text:"Rock and Roll is nothing but ____ and the rage of ____!"}#
# 296: {active: 1, play: 1, text:"What the hell is 'Juvijuvibro'?!"}
# 297: {active: 1, play: 2, text:"When I was a kid, all we had in Lunchables were three ____ and ____."}
# 298: {active: 1, play: 2, text:"On its last dying breath, ____ sent out a cry for help. A bunch of ____ heard the cry."}
# 299: {active: 1, play: 1, text:"I also take ____ as payment for commissions."}
# 300: {active: 1, play: 1, text:"____ looks pretty in all the art, but have you seen one in real life?"}
# 301: {active: 1, play: 1, text:"How did I lose my virginity?"}
# 302: {active: 1, play: 1, text:"Here is the church, here is the steeple, open the doors, and there is ____."}
# 303: {active: 1, play: 1, text:"This is the way the world ends \ This is the way the world ends \ Not with a bang but with ____."}
# 304: {active: 1, play: 1, text:"In 1,000 years, when paper money is a distant memory, how will we pay for goods and services?"}
# 305: {active: 1, play: 1, text:"War! What is it good for?"}
# 306: {active: 1, play: 1, text:"What don't you want to find in your Kung Pao chicken?"}
# 307: {active: 1, play: 1, text:"The Smithsonian Museum of Natural History has just opened an exhibit on ____."}
# 308: {active: 1, play: 1, text:"At first I couldn't understand ____, but now it's my biggest kink."}
# 309: {active: 1, play: 1, text:"Long story short, I ended up with ____ in my ass."}
# 310: {active: 1, play: 1, text:"Don't knock ____ until you've tried it."}
# 311: {active: 1, play: 1, text:"Who knew I'd be able to make a living off of ____?"}
# 312: {active: 1, play: 1, text:"It's difficult to explain to friends and family why I know so much about ____."}
# 313: {active: 1, play: 1, text:"Once I started roleplaying ____, it was all downhill from there."}
# 314: {active: 1, play: 1, text:"____ are so goddamn cool."}
# 315: {active: 1, play: 1, text:"No, look, you don't understand. I REALLY like ____."}
# 316: {active: 1, play: 1, text:"I don't think my parents will ever accept that the real me is ____."}
# 317: {active: 1, play: 1, text:"I can't believe I spent most of my paycheck on ____."}
# 318: {active: 1, play: 2, text:"You can try to justify ____ all you want, but you don't have to be ____ to realize it's just plain wrong."}
# 319: {active: 1, play: 1, text:"I've been waiting all year for ____."}
# 320: {active: 1, play: 1, text:"I can't wait to meet up with my internet friends for ____."}
# 321: {active: 1, play: 3, text:"The next crossover will have ____ and ____ review ____."}
# 322: {active: 1, play: 1, text:"We all made a mistake when we ate ____ at MAGFest."}
# 323: {active: 1, play: 1, text:"<NAME>'s next student film will focus on ____."}
# 324: {active: 1, play: 1, text:"____ will be the subject of the next TGWTG panel at MAGFest."}
# 325: {active: 1, play: 1, text:"WAIT! I have an idea! It involves using ____!"}
# 326: {active: 1, play: 1, text:"If you value your life, never mention ____ around Oancitizen."}
# 327: {active: 1, play: 2, text:"____ is only on the site because of ____."}
# 328: {active: 1, play: 2, text:"The newest fanfic trend is turning ____ into ____."}
# 329: {active: 1, play: 1, text:"Tom is good, but he's not ____ good."}
# 330: {active: 1, play: 1, text:"BENCH ALL THE ____."}
# 331: {active: 1, play: 1, text:"Hey guys, check out my ____ montage!"}
# 332: {active: 1, play: 1, text:"____ was completely avoidable!"}
# 333: {active: 1, play: 1, text:"____ will live!"}
# 334: {active: 1, play: 1, text:"____ should be on TGWTG."}
# 335: {active: 1, play: 1, text:"____! What are you doing here?"}
# 336: {active: 1, play: 1, text:"____! You know, for kids."}
# 337: {active: 1, play: 1, text:"I love ____. It's so bad."}
# 338: {active: 1, play: 1, text:"____. With onions."}
# 339: {active: 1, play: 1, text:"____ is the theme of this year's anniversary crossover."}
# 340: {active: 1, play: 1, text:"A ____ Credit Card!?"}
# 341: {active: 1, play: 3, text:"Fighting ____ by moonlight! Winning ____ by daylight! Never running from a real fight! She is the one named ____!"}
# 342: {active: 1, play: 1, text:"It's no secret. Deep down, everybody wants to fuck ____."}
# 343: {active: 1, play: 1, text:"Behold! My trap card, ____!"}
# 344: {active: 1, play: 1, text:"Blip checks are way smaller in January so I'll spend the month riffing on ____ to gain more views."}
# 345: {active: 1, play: 1, text:"<NAME> still regrets the day he decided to do a Let's Play video for '<NAME>'s ____ Adventure'."}
# 346: {active: 1, play: 1, text:"High and away on a wing and a prayer, who could it be? Believe it or not, it's just ____."}
# 347: {active: 1, play: 1, text:"I ____ so you don't have to."}
# 348: {active: 1, play: 1, text:"I AM THE VOICELESS. THE NEVER SHOULD. I AM ____."}
# 349: {active: 1, play: 1, text:"I prefer for MY exploitation films to have ____, thank you very much."}
# 350: {active: 1, play: 1, text:"I watch movies just to see if I can find a Big Lipped ____ Moment."}
# 351: {active: 1, play: 1, text:"I'm looking forward to Jesuotaku's playthrough of Fire Emblem: ____."}
# 352: {active: 1, play: 1, text:"After eating a Devil Fruit, I now have the power of ____."}
# 353: {active: 1, play: 1, text:"It was all going well until they found ____."}
# 354: {active: 1, play: 1, text:"JW confirms, you can play ____,"}
# 355: {active: 1, play: 1, text:"Next January, the Nostalgia Critic is doing ____ Month."}
# 356: {active: 1, play: 1, text:"No one wants to see your ____."}
# 357: {active: 1, play: 1, text:"Of Course! Don't you know anything about ____?"}
# 358: {active: 1, play: 1, text:"OH MY GOD THIS IS THE GREATEST ____ I'VE EVER SEEN IN MY LIFE!"}
# 359: {active: 1, play: 1, text:"On the other side of the Plot Hole, the Nostalgia Critic found ____."}
# 360: {active: 1, play: 1, text:"Reactions were mixed when ____ joined TGWTG."}
# 361: {active: 1, play: 1, text:"Sage has presented JO with the new ecchi series ____."}
# 362: {active: 1, play: 1, text:"Sean got his head stuck in ____."}
# 363: {active: 1, play: 1, text:"STOP OR I WILL ____."}
# 364: {active: 1, play: 1, text:"The invasion of Molassia was tragically thwarted by ____."}
# 365: {active: 1, play: 1, text:"The newest reviewer addition to the site specializes in ____."}
# 366: {active: 1, play: 1, text:"The next person to leave Channel Awesome will announce their departure via ____."}
# 367: {active: 1, play: 1, text:"The next Renegade Cut is about ____ in a beloved children's movie."}
# 368: {active: 1, play: 1, text:"The Nostalgia Critic will NEVER review ____."}
# 369: {active: 1, play: 1, text:"By far, the most mind-bogglingly awesome thing I've ever seen in anime is ____."}
# 370: {active: 1, play: 1, text:"My Little Sister Can't Be ____!"}
# 371: {active: 1, play: 1, text:"WE WERE FIGHTING LIKE ____."}
# 372: {active: 1, play: 1, text:"What doesn't go there?"}
# 373: {active: 1, play: 1, text:"What doesn't work that way?"}
# 374: {active: 1, play: 1, text:"What is in Sci Fi Guy's vest?"}
# 375: {active: 1, play: 1, text:"What the fuck is wrong with you?"}
# 376: {active: 1, play: 1, text:"What's holding up the site redesign?"}
# 377: {active: 1, play: 1, text:"What's really inside the Plot Hole?"}
# 378: {active: 1, play: 1, text:"What's up next on WTFIWWY?"}
# 379: {active: 1, play: 1, text:"When the JesuOtaku stream got to the 'awful part of the night,' the GreatSG video featured ____."}
# 380: {active: 1, play: 1, text:"Why can't Film Brain stop extending his final vowels?"}
# 381: {active: 1, play: 1, text:"90's Kid's favorite comic is ____."}
# 382: {active: 1, play: 1, text:"Because poor literacy is ____."}
# 383: {active: 1, play: 1, text:"He is a glitch. He is missing. He is ____."}
# 384: {active: 1, play: 1, text:"Of course! Don't you know anything about ___?"}
# 385: {active: 1, play: 1, text:"Snowflame feels no ____."}
# 386: {active: 1, play: 1, text:"Snowflame found a new love besides cocaine. What is it?"}
# 387: {active: 1, play: 1, text:"So let's dig into ____ #1."}
# 388: {active: 1, play: 1, text:"Where'd he purchase that?"}
# 389: {active: 1, play: 1, text:"When is the next History of Power Rangers coming out?"}
# 390: {active: 1, play: 1, text:"What is as low as the standards of the 90's Kid?"}
# 391: {active: 1, play: 1, text:"What delayed the next History of Power Rangers?"}
# 392: {active: 1, play: 1, text:"____ has the 'mount' keyword."}
# 393: {active: 1, play: 1, text:"You're so _____ I'll have to delete you."}
# 394: {active: 1, play: 1, text:"I got a new tattoo, it looks a bit like ____."}
# 395: {active: 1, play: 1, text:"What strange Korean delicacy will Mark enjoy today?"}
# 396: {active: 1, play: 1, text:"____ is camping my lane."}
# 397: {active: 1, play: 1, text:"The OGN was fun, but there was far too much ____ cosplay."}
# 398: {active: 1, play: 1, text:"'What are you thinking?' 'You know, ____ and stuff.'"}
# 399: {active: 1, play: 2, text:"Drunken games of Pretend You're Xyzzy lead to ____ and ____."}
# 400: {active: 1, play: 1, text:"Vegeta, what does the scouter say?"}
# 401: {active: 1, play: 1, text:"____. BELIEVE IT!"}
# 402: {active: 1, play: 1, text:"Make a contract with me, and become ____!"}
# 403: {active: 1, play: 1, text:"You guys are so wrong. Obviously, ____ is best waifu."}
# 404: {active: 1, play: 1, text:"THIS ____ HAS BEEN PASSED DOWN THE ARMSTRONG FAMILY LINE FOR GENERATIONS!!!"}
# 405: {active: 1, play: 2, text:"My favorite episode of ____ is the one with ____."}
# 406: {active: 1, play: 2, text:"This doujinshi I just bought has ____ and ____ getting it on, hardcore."}
# 407: {active: 1, play: 2, text:"On the next episode of Dragon Ball Z, ____ is forced to do the fusion dance with ____."}
# 408: {active: 1, play: 1, text:"You are already ____."}
# 409: {active: 1, play: 1, text:"Who the hell do you think I am?!"}
# 410: {active: 1, play: 1, text:"On the next episode of Dragon Ball Z, Goku has a fierce battle with ____."}
# 411: {active: 1, play: 1, text:"____. YOU SHOULD BE WATCHING."}
# 412: {active: 1, play: 1, text:"Most cats are ____."}
# 413: {active: 1, play: 2, text:"Fresh from Japan: The new smash hit single by ____ titled ____."}
# 414: {active: 1, play: 2, text:"____ vs. ____. BEST. FIGHT. EVER."}
# 415: {active: 1, play: 2, text:"So wait, ____ was actually ____? Wow, I didn't see that one coming!"}
# 416: {active: 1, play: 1, text:"Real men watch ____."}
# 417: {active: 1, play: 1, text:"When it comes to hentai, nothing gets me hotter than ____."}
# 418: {active: 1, play: 1, text:"Whenever I'm splashed with cold water, I turn into ____."}
# 419: {active: 1, play: 2, text:"No matter how you look at it, ultimately ____ is responsible for ____."}
# 420: {active: 1, play: 1, text:"S-Shut up!! I-It's not like I'm ____ or anything."}
# 421: {active: 1, play: 2, text:"The English dub of ____ sucks worse than ____."}
# 422: {active: 1, play: 1, text:"Congratulations, ____."}
# 423: {active: 1, play: 1, text:"By far the best panel at any anime convention is the one for ____."}
# 424: {active: 1, play: 1, text:"One thing you almost never see in anime is ____."}
# 425: {active: 1, play: 1, text:"What do I hate most about anime?"}
# 426: {active: 1, play: 1, text:"What do I love most about anime?"}
# 427: {active: 1, play: 1, text:"This morning, hundreds of Japanese otaku lined up outside their favorite store to buy the limited collector's edition of ____."}
# 428: {active: 1, play: 1, text:"Every now and then, I like to participate in the time-honored Japanese tradition of ____."}
# 429: {active: 1, play: 1, text:"There are guilty pleasures. And then there's ____."}
# 430: {active: 1, play: 1, text:"Watch it! Or I'll take your ____."}
# 431: {active: 1, play: 1, text:"New from Studio GAINAX: ____ the Animation."}
# 432: {active: 1, play: 1, text:"Using my power of Geass, I command you to do... THIS!"}
# 433: {active: 1, play: 1, text:"Chicks. Dig. ____. Nice."}
# 434: {active: 1, play: 1, text:"When it comes to Japanese cuisine, there's simply nothing better than ____."}
# 435: {active: 1, play: 1, text:"In the name of the moon, I will punish ____!"}
# 436: {active: 1, play: 3, text:"Just announced: The brand new anime adaptation of ____, starring ____ as the voice of ____."}
# 437: {active: 1, play: 1, text:"Don't worry, he's okay! He survived thanks to ____."}
# 438: {active: 1, play: 1, text:"____. Goddammit, Japan."}
# 439: {active: 1, play: 1, text:"Welcome home, <NAME>! Is there anything your servant girl can bring you today?"}
# 440: {active: 1, play: 1, text:"I have never in my life laughed harder than the first time I watched ____."}
# 441: {active: 1, play: 1, text:"Take this! My love, my anger, and all of my ____!"}
# 442: {active: 1, play: 1, text:"Karaoke night! I'm totally gonna sing my favorite song, ____."}
# 443: {active: 1, play: 1, text:"Digimon! Digivolve to: ____-mon!"}
# 444: {active: 1, play: 1, text:"Now! Face my ultimate attack!"}
# 445: {active: 1, play: 3, text:"From the twisted mind of Nabeshin: An anime about ____, ____, and ____."}
# 446: {active: 1, play: 1, text:"____. Only on Toonami"}
# 447: {active: 1, play: 1, text:"I am in despair! ____ has left me in despair!"}
# 448: {active: 1, play: 2, text:"The new manga from ____ is about a highschool girl discovering ____."}
# 449: {active: 1, play: 1, text:"To save the world, you must collect all 7 ____."}
# 450: {active: 1, play: 1, text:"Sasuke has ____ implants."}
# 451: {active: 1, play: 1, text:"In truth, the EVA units are actually powered by the souls of ____."}
# 452: {active: 1, play: 3, text:"Dreaming! Don't give it up ____! Dreaming! Don't give it up ____! Dreaming! Don't give it up ____!"}
# 453: {active: 1, play: 1, text:"Lupin the III's latest caper involves him trying to steal ____."}
# 454: {active: 1, play: 1, text:"A piece of ____ is missing."}
# 455: {active: 1, play: 1, text:"At least he didn't fuck ____."}
# 456: {active: 1, play: 2, text:"Hello, and welcome to Atop ____, where ____ burns."}
# 457: {active: 1, play: 1, text:"No matter how I look at it, it's your fault I'm not ____!"}
# 458: {active: 1, play: 1, text:"Hello, I'm the Nostalgia Critic. I remember ____ so you don't have to!"}
# 459: {active: 1, play: 1, text:"Taking pride in one's collection of ____."}
# 460: {active: 1, play: 3, text:"If you are able to deflect ____ with ____, we refer to it as 'Frying ____'."}
# 461: {active: 1, play: 1, text:"They are the prey, and we are the ____."}
# 462: {active: 1, play: 1, text:"Did you hear about the guy that smuggled ____ into the hotel?"}
# 463: {active: 1, play: 1, text:"The new Gurren Lagann blurays from Aniplex will literally cost you ____."}
# 464: {active: 1, play: 1, text:"The most overused anime cliche is ____."}
# 465: {active: 1, play: 1, text:"The inspiration behind the latest hit show is ____."}
# 466: {active: 1, play: 1, text:"While writing Dragon Ball, <NAME>ama would occasionally take a break from working to enjoy ____."}
# 467: {active: 1, play: 1, text:"The show was great, until ____ showed up."}
# 468: {active: 1, play: 1, text:"Nothing ruins a good anime faster than ____."}
# 469: {active: 1, play: 1, text:"People die when they are ____."}
# 470: {active: 1, play: 2, text:"I want to be the very best, like no one ever was! ____ is my real test, ____ is my cause!"}
# 471: {active: 1, play: 1, text:"Okay, I'll admit it. I would totally go gay for ____."}
# 472: {active: 1, play: 2, text:"Who are you callin' ____ so short he can't see over his own ____?!?!"}
# 473: {active: 1, play: 1, text:"If you ask me, there need to be more shows about ____."}
# 474: {active: 1, play: 1, text:"____. That is the kind of man I was."}
# 475: {active: 1, play: 1, text:"I'm sorry! I'm sorry! I didn't mean to accidentally walk in on you while you were ____!"}
# 476: {active: 1, play: 2, text:"After a long, arduous battle, ____ finally met their end by ____."}
# 477: {active: 1, play: 1, text:"This is our final battle. Mark my words, I will defeat you, ____!"}
# 478: {active: 1, play: 1, text:"You used ____. It's super effective!"}
# 479: {active: 1, play: 1, text:"The best English dub I've ever heard is the one for ____."}
# 480: {active: 1, play: 1, text:"I know of opinions and all that, but I just don't understand how anyone could actually enjoy ____."}
# 481: {active: 1, play: 1, text:"____. HE DEDD."}
# 482: {active: 1, play: 1, text:"She'll thaw out if you try ____."}
# 483: {active: 1, play: 1, text:"You see, I'm simply ____."}
# 484: {active: 1, play: 1, text:"Truly and without question, ____ is the manliest of all men."}
# 485: {active: 1, play: 1, text:"WANTED: $50,000,000,000 reward for the apprehension of____."}
# 486: {active: 1, play: 1, text:"This year, I totally lucked out and found ____ in the dealer's room."}
# 487: {active: 1, play: 1, text:"How did I avoid your attack? Simple. By ____."}
# 488: {active: 1, play: 1, text:"If I was a magical girl, my cute mascot sidekick would be ____."}
# 489: {active: 1, play: 2, text:"From the creators of Tiger & Bunny: ____ & ____!!"}
# 490: {active: 1, play: 1, text:"In the future of 199X, the barrier between our world and the demon world is broken, and thousands of monsters invade our realm to feed upon ____."}
# 491: {active: 1, play: 2, text:"Animation studio ____ is perhaps best known for ____."}
# 492: {active: 1, play: 1, text:"____. So kawaii!! <3 <3"}
# 493: {active: 1, play: 1, text:"The most annoying kind of anime fans are ____."}
# 494: {active: 1, play: 1, text:"Cooking is so fun! Cooking is so fun! Now it's time to take a break and see what we have done! ____. YAY! IT'S READY!!"}
# 495: {active: 1, play: 2, text:"My favorite hentai is the one where ____ is held down and violated by ____."}
# 496: {active: 1, play: 1, text:"The government of Japan recently passed a law that effectively forbids all forms of ____."}
# 497: {active: 1, play: 1, text:"This year, I'm totally gonna cosplay as ____."}
# 498: {active: 1, play: 1, text:"Coming to Neon Alley: ____, completely UNCUT & UNCENSORED."}
# 499: {active: 1, play: 1, text:"No matter how many times I see it, ____ always brings a tear to my eye."}
# 500: {active: 1, play: 1, text:"Of my entire collection, my most prized possession is ____."}
# 501: {active: 1, play: 1, text:"Someday when I have kids, I want to share with them the joys of ____."}
# 502: {active: 1, play: 1, text:"So, what have you learned from all of this?"}
# 503: {active: 1, play: 1, text:"The World Line was changed when I sent a D-mail to myself about ____."}
# 504: {active: 1, play: 1, text:"After years of searching, the crew of the Thousand Sunny finally found out that the One Piece is actually ____."}
# 505: {active: 1, play: 1, text:"When I found all 7 Dragon Balls, Shenron granted me my wish for ____."}
# 506: {active: 1, play: 2, text:"The best part of my ____ costume is ____."}
# 507: {active: 1, play: 1, text:"Cards Against Anime: It's more fun than ____!"}
# 508: {active: 1, play: 2, text:"On the mean streets of Tokyo, everyone knows that ____ is the leader of the ________ Gang."}
# 509: {active: 1, play: 1, text:"He might just save the universe, if he only had some ____!"}
# 510: {active: 1, play: 5, text:"Make a harem."}
# 511: {active: 1, play: 6, text:"Make a dub cast. ____ as ____, ____ as ____, & ____ as ____."}
# 512: {active: 1, play: 1, text:"Dr. <NAME>, please hurry! The patient is suffering from a terminal case of ____!"}
# 513: {active: 1, play: 1, text:"I'M-A FIRIN' MAH ____!"}
# 514: {active: 1, play: 3, text:"Make a love triangle."}
# 515: {active: 1, play: 2, text:"This ____ of mine glows with an awesome power! Its ____ tells me to defeat you!"}
# 516: {active: 1, play: 1, text:"Yo-Ho-Ho! He took a bite of ____."}
# 517: {active: 1, play: 1, text:"Scientists have reverse engineered alien technology that unlocks the secrets of ____."}
# 518: {active: 1, play: 1, text:"It is often argued that our ancestors would have never evolved without the aid of ____."}
# 519: {active: 1, play: 1, text:"The sad truth is, that at the edge of the universe, there is nothing but ____."}
# 520: {active: 1, play: 1, text:"The 1930's is often regarded as the golden age of ____."}
# 521: {active: 1, play: 2, text:"____ a day keeps ____ away."}
# 522: {active: 1, play: 1, text:"There is a time for peace, a time for war, and a time for ____."}
# 523: {active: 1, play: 1, text:"If a pot of gold is at one end of the rainbow, what is at the other?"}
# 524: {active: 1, play: 1, text:"A fortune teller told me I will live a life filled with ____."}
# 525: {active: 1, play: 1, text:"The Himalayas are filled with many perils, such as ____."}
# 526: {active: 1, play: 1, text:"The road to success is paved with ____."}
# 527: {active: 1, play: 1, text:"I work out so I can look good when I'm ____."}
# 528: {active: 1, play: 1, text:"And on his farm he had ____, E-I-E-I-O!"}
# 529: {active: 1, play: 1, text:"Genius is 10% inspiration and 90% ____."}
# 530: {active: 1, play: 1, text:"I will not eat them Sam-I-Am. I will not eat ____."}
# 531: {active: 1, play: 1, text:"What's the time? ____ time!"}
# 532: {active: 1, play: 1, text:"____ is the root of all evil."}
# 533: {active: 1, play: 1, text:"The primitive villagers were both shocked and amazed when I showed them ____."}
# 534: {active: 1, play: 1, text:"And it is said his ghost still wanders these halls, forever searching for his lost ____."}
# 535: {active: 1, play: 1, text:"<NAME>ney presents ____, on ice!"}
# 536: {active: 1, play: 1, text:"The best part of waking up is ____ in your cup."}
# 537: {active: 1, play: 1, text:"Though <NAME> invented the lightbulb, he is also known for giving us ____."}
# 538: {active: 1, play: 2, text:"<NAME> sat on her tuffet, eating her ____ and ____."}
# 539: {active: 1, play: 1, text:"What do I keep hidden in the crawlspace?"}
# 540: {active: 1, play: 1, text:"Go-Go-Gadget, ____!"}
# 541: {active: 1, play: 1, text:"I qualify for this job because I have several years experience in the field of ____."}
# 542: {active: 1, play: 1, text:"We just adopted ____ from the pound."}
# 543: {active: 1, play: 1, text:"It was the happiest day of my life when I became the proud parent of ____."}
# 544: {active: 1, play: 1, text:"I finally realized I hit rock bottom when I started digging through dumpsters for ____."}
# 545: {active: 1, play: 1, text:"With a million times the destructive force of all our nuclear weapons combined, no one was able to survive ____."}
# 546: {active: 1, play: 2, text:"You have been found guilty of 5 counts of ____, and 13 counts of ____."}
# 547: {active: 1, play: 1, text:"And the award for the filthiest scene in an adult film goes to '5 women and ____.'"}
# 548: {active: 1, play: 1, text:"'Why <NAME>', said Little Red Riding Hood, 'What big ____ you have!'"}
# 549: {active: 1, play: 1, text:"Pay no attention to ____ behind the curtain!"}
# 550: {active: 1, play: 1, text:"Who would have guessed that the alien invasion would be easily thwarted by ____."}
# 551: {active: 1, play: 1, text:"With Democrats and Republicans in a dead heat, the election was snatched by ____ party."}
# 552: {active: 1, play: 1, text:"Mama always said life was like ____."}
# 553: {active: 1, play: 1, text:"Who could have guessed that the alien invasion would be easily thwarted by ____."}
# 554: {active: 1, play: 1, text:"With the Democrats and Republicans in a dead heat, the election was snatched by the ____ party."}
# 555: {active: 1, play: 1, text:"The panel I'm looking forward to most at AC this year is..."}
# 556: {active: 1, play: 1, text:"My Original Character's name is ____."}
# 557: {active: 1, play: 1, text:"My secret tumblr account where I post nothing but ____."}
# 558: {active: 1, play: 1, text:"Only my internet friends know that I fantasize about ____."}
# 559: {active: 1, play: 1, text:"Everyone really just goes to the cons for ____."}
# 560: {active: 1, play: 1, text:"It all started with ____."}
# 561: {active: 1, play: 2, text:"I'll roleplay ____, you can be ____."}
# 562: {active: 1, play: 2, text:"I'm no longer allowed near ____ after the incident with ____."}
# 563: {active: 1, play: 1, text:"I've been into ____ since before I hit puberty, I just didn't know what it meant."}
# 564: {active: 1, play: 1, text:"Realizing, too late, the implications of your interest in ____ as a child."}
# 565: {active: 1, play: 1, text:"Whoa, I might fantasize about ____, but I'd never actually go that far in real life."}
# 566: {active: 1, play: 1, text:"I realized they were a furry when they mentioned ____."}
# 567: {active: 1, play: 1, text:"Everyone on this site has such strong opinions about ____."}
# 568: {active: 1, play: 1, text:"My landlord had a lot of uncomfortable questions for me when when he found ____ in my bedroom while I was at work."}
# 569: {active: 1, play: 2, text:"I'm not even aroused by normal porn anymore, I can only get off to ____ or ____."}
# 570: {active: 1, play: 1, text:"____? Oh, yeah, I could get my mouth around that."}
# 571: {active: 1, play: 1, text:"What wouldn't I fuck?"}
# 572: {active: 1, play: 1, text:"When I thought I couldn't go any lower, I realized I would probably fuck ____."}
# 573: {active: 1, play: 1, text:"I knew my boyfriend was a keeper when he said he'd try ____, just for me."}
# 574: {active: 1, play: 2, text:"Fuck ____, get ____."}
# 575: {active: 1, play: 1, text:"I would bend over for ____."}
# 576: {active: 1, play: 1, text:"I think having horns would make ____ complicated."}
# 577: {active: 1, play: 1, text:"In my past life, I was ____."}
# 578: {active: 1, play: 1, text:"____ is my spirit animal."}
# 579: {active: 1, play: 1, text:"____. This is what my life has come to."}
# 580: {active: 1, play: 1, text:"I'm not even sad that I devote at least six hours of each day to ____."}
# 581: {active: 1, play: 1, text:"I never felt more accomplished than when I realized I could fit ____ into my ass."}
# 582: {active: 1, play: 1, text:"Yeah, I know I have a lot of ____ in my favorites, but I'm just here for the art."}
# 583: {active: 1, play: 1, text:"I'm not a 'furry,' I prefer to be called ____."}
# 584: {active: 1, play: 1, text:"Okay, ____? Pretty much the cutest thing ever."}
# 585: {active: 1, play: 1, text:"____. Yeah, that's a pretty interesting way to die."}
# 586: {active: 1, play: 1, text:"I didn't believe the rumors about ____, until I saw the videos."}
# 587: {active: 1, play: 1, text:"I knew I needed to leave the fandom when I realized I was ____."}
# 588: {active: 1, play: 1, text:"After being a furry for so long, I can never see ____ without getting a little aroused."}
# 589: {active: 1, play: 1, text:"It's really hard not to laugh at ____."}
# 590: {active: 1, play: 1, text:"If my parents ever found ____, I'd probably be disowned."}
# 591: {active: 1, play: 1, text:"____ ruined the fandom."}
# 592: {active: 1, play: 1, text:"The most recent item in my search history."}
# 593: {active: 1, play: 1, text:"Is it weird that I want to rub my face on ____?"}
# 594: {active: 1, play: 1, text:"My love for you is like ____. BERSERKER!"}
# 595: {active: 1, play: 2, text:"Last time I took bath salts, I ended up ____ in ____."}
# 596: {active: 1, play: 2, text:"Tara taught me that if you're going to engage in ____, then ____ isn't a good idea."}
# 597: {active: 1, play: 1, text:"The website was almost called 'thatguywith____.com'."}
# 598: {active: 1, play: 1, text:"They even took ____! Who does that?!"}
# 599: {active: 1, play: 1, text:"You may be a robot, but I AM ____!"}
# 600: {active: 1, play: 2, text:"Northernlion's doctor diagnosed him today with ____, an unfortunate condition that would lead to ____."}
# 601: {active: 1, play: 2, text:"And now we're going to be fighting ____ on ____."}
# 602: {active: 1, play: 2, text:"The comment section was nothing but ____ arguing about ____."}
# 603: {active: 1, play: 1, text:"IT'S ____ TIME!"}
# 604: {active: 1, play: 2, text:"It has been said... That there are entire forests of ____, made from the sweetest ____."}
# 605: {active: 1, play: 1, text:"Attention, duelists: My hair is ____."}
# 606: {active: 1, play: 1, text:"What do otaku smell like?"}
# 607: {active: 1, play: 1, text:"And from Kyoto Animation, a show about cute girls doing ____."}
# 608: {active: 1, play: 1, text:"Anime has taught me that classic literature can always be improved by adding ____."}
# 609: {active: 1, play: 1, text:"The moé debate was surprisingly civil until someone mentioned ____."}
# 610: {active: 1, play: 1, text:"That's not a squid! It's ____!"}
# 611: {active: 1, play: 2, text:"The Chocolate Underground stopped the Good For You Party by capturing their ____ and exposing their leader as ____."}
# 612: {active: 1, play: 1, text:"Who cares about the printing press, did that medieval peasant girl just invent ____?!"}
# 613: {active: 1, play: 2, text:"Eating ____ gave me ____."}
# 614: {active: 1, play: 1, text:"The reason I go to church is to learn about ____."}
# 615: {active: 1, play: 2, text:"Show me on ____, where he ____."}
# 616: {active: 1, play: 2, text:"I wouldn't ____ you with ____."}
# 617: {active: 1, play: 1, text:"All attempts at ____, have met with failure and crippling economic sanctions."}
# 618: {active: 1, play: 1, text:"Despite our Administration's best efforts, we are still incapable of ____."}
# 619: {active: 1, play: 1, text:"Technology improves every day. One day soon, surfing the web will be replaced by ____."}
# 620: {active: 1, play: 1, text:"Choosy Moms Choose ____."}
# 621: {active: 1, play: 1, text:"At camp, we'd scare each other by telling stories about ____ around the fire."}
# 622: {active: 1, play: 1, text:"Big Mac sleeps soundly whenever ____ is with him."}
# 623: {active: 1, play: 1, text:"____ is best pony."}
# 624: {active: 1, play: 3, text:"____ should ____ ____."}
# 625: {active: 1, play: 1, text:"____? That's future Spike's problem."}
# 626: {active: 1, play: 1, text:"After a wild night of crus<NAME>, <NAME>bloom learned that ____ was her super special talent."}
# 627: {active: 1, play: 1, text:"After a wild night of partying, Fluttershy awakens to find ____ in her bed."}
# 628: {active: 1, play: 1, text:"After living for thousands of years Celestia can only find pleasure in ____."}
# 629: {active: 1, play: 1, text:"Aloe and Lotus have been experimenting with a radical treatment that utilizes the therapeutic properties of ____."}
# 630: {active: 1, play: 1, text:"BUY SOME ____!"}
# 631: {active: 1, play: 1, text:"CUTIE MARK CRUSADERS; ____! YAY!"}
# 632: {active: 1, play: 1, text:"Daring Do and the quest for ____."}
# 633: {active: 1, play: 1, text:"Dear <NAME>, Today I learned about ____. "}
# 634: {active: 1, play: 1, text:"Despite everypony's expectations, <NAME>'s cutie mark ended up being ____."}
# 635: {active: 1, play: 1, text:"Equestrian researchers have discovered that ____ is The 7th Element of Harmony."}
# 636: {active: 1, play: 2, text:"In a stroke of unparalleled evil, Discord turned ____ into ____."}
# 637: {active: 1, play: 1, text:"In a world without humans, saddles are actually made for ____."}
# 638: {active: 1, play: 1, text:"Inexplicably, the only thing the parasprites wouldn't eat was ____."}
# 639: {active: 1, play: 1, text:"It turns out Hitler's favorite pony was ____."}
# 640: {active: 1, play: 1, text:"It's not a boulder! It's ____!"}
# 641: {active: 1, play: 1, text:"My cutie mark would be ____."}
# 642: {active: 1, play: 1, text:"Nothing makes Pinkie smile more than ____."}
# 643: {active: 1, play: 1, text:"Giggle at ____!"}
# 644: {active: 1, play: 2, text:"I never knew what ____ could be, until you all shared its ____ with me."}
# 645: {active: 1, play: 1, text:"I'd like to be ____."}
# 646: {active: 1, play: 2, text:"Once upon a time, the land of Equestria was ruled by ____ and ____."}
# 647: {active: 1, play: 1, text:"Ponyville is widely known for ____."}
# 648: {active: 1, play: 1, text:"Rarity has a long forgotten line of clothing inspired by ____."}
# 649: {active: 1, play: 1, text:"Rarity was supposed to have a song about ____, but it was cut."}
# 650: {active: 1, play: 1, text:"Rarity's latest dress design was inspired by ____."}
# 651: {active: 1, play: 1, text:"Should the Elements of Harmony fail, ____ is to be used as a last resort."}
# 652: {active: 1, play: 1, text:"____. That is my fetish."}
# 653: {active: 1, play: 1, text:"The Elements of Harmony were originally the Elements of ____."}
# 654: {active: 1, play: 1, text:"When Luna got to the moon, she was greeted with ____."}
# 655: {active: 1, play: 1, text:"____? Oh murr."}
# 656: {active: 1, play: 3, text:"Who dunnit? ____ with ____ in ____."}
# 657: {active: 1, play: 1, text:"When Spike is asleep, Twilight likes to read books about ____."}
# 658: {active: 1, play: 1, text:"Why are you making chocolate pudding at 4 in the morning?"}
# 659: {active: 1, play: 1, text:"The newest feature of the Xbox One is ____."}
# 660: {active: 1, play: 1, text:"PS3: It only does ____."}
# 661: {active: 1, play: 1, text:"The new TF2 promo items are based on ____."}
# 662: {active: 1, play: 1, text:"All you had to do was follow the damn ____, CJ!"}
# 663: {active: 1, play: 1, text:"Liquid! How can you still be alive?"}
# 664: {active: 1, play: 1, text:"What can change the nature of a man?"}
# 665: {active: 1, play: 1, text:" Microsoft revealed that the Xbox One's demos had actually been running on ____ "}
# 666: {active: 1, play: 1, text:"What if ____ was a girl?"}
# 667: {active: 1, play: 1, text:"What did I preorder at gamestop?"}
# 668: {active: 1, play: 1, text:"____ confirmed for Super Smash Bros!"}
# 669: {active: 1, play: 1, text:"Based ____."}
# 670: {active: 1, play: 1, text:"The newest IP from Nintendo, Super ____ Bros. "}
# 671: {active: 1, play: 1, text:"____ only, no items, Final Destination. "}
# 672: {active: 1, play: 1, text:"Enjoy ____ while you play your Xbox one!"}
# 673: {active: 1, play: 1, text:"The future of gaming lies with the ____."}
# 674: {active: 1, play: 1, text:"The best way to be comfy when playing video games is with ____."}
# 675: {active: 1, play: 1, text:"____ has no games."}
# 676: {active: 1, play: 1, text:"PC gamers have made a petition to get ____ on their platform."}
# 677: {active: 1, play: 1, text:"The new Nintendo ____ is a big gimmick. "}
# 678: {active: 1, play: 1, text:"implying you aren't ____"}
# 679: {active: 1, play: 1, text:"WHAT IS A MAN?"}
# 680: {active: 1, play: 2, text:"What is a ___ but a ____?"}
# 681: {active: 1, play: 1, text:"WE WILL DRAG THIS ___ INTO THE 21ST CENTURY."}
# 682: {active: 1, play: 1, text:"All your ____ are belong to us"}
# 683: {active: 1, play: 1, text:"I'm in ur base, ____"}
# 684: {active: 1, play: 1, text:"Pop Quiz: Beatles Song- ___ terday."}
# 685: {active: 1, play: 1, text:" ___ would like to play."}
# 686: {active: 1, play: 1, text:"A mod of doom was made that was based off of ____."}
# 687: {active: 1, play: 1, text:"I really didn't like what they did with the ____ Movie adaption."}
# 688: {active: 1, play: 1, text:"'HEY, GOLLEN PALACE? HOW U SAY ____ IN CHINESE?'"}
# 689: {active: 1, play: 1, text:"Pumpkin doesn't want this."}
# 690: {active: 1, play: 1, text:"NEXT TIME ON GAME GRUMPS: ____."}
# 691: {active: 1, play: 1, text:"I used to be an adventurer like you, until ____."}
# 692: {active: 1, play: 1, text:"Yeah, well, my dad works for ____."}
# 693: {active: 1, play: 1, text:"Kotaku addresses sexism in ____ in their latest article."}
# 694: {active: 1, play: 1, text:"Get double XP for Halo 3 with purchase of ____."}
# 695: {active: 1, play: 1, text:"Sorry <NAME>, but ____ is in another castle."}
# 696: {active: 1, play: 1, text:"LoL stole their new character design off of ____."}
# 697: {active: 1, play: 1, text:"____ is the cancer killing video games."}
# 698: {active: 1, play: 1, text:"Suffer, like ____ did."}
# 699: {active: 1, play: 1, text:"It's like ____ with guns!"}
# 700: {active: 1, play: 1, text:"Is a man not entitiled to ____?"}
# 701: {active: 1, play: 1, text:"____ has changed."}
# 702: {active: 1, play: 1, text:"But you can call me ____ the ____. Has a nice ring to it dontcha think?"}
# 703: {active: 1, play: 1, text:"Objective: ____"}
# 704: {active: 1, play: 1, text:"EA Sports! It's ____."}
# 705: {active: 1, play: 1, text:"____ is waiting for your challenge!"}
# 706: {active: 1, play: 1, text:"____ sappin' my sentry. "}
# 707: {active: 1, play: 1, text:"I'm here to ____ and chew bubble gum, and I'm all out of gum."}
# 708: {active: 1, play: 1, text:"I've covered ____, you know."}
# 709: {active: 1, play: 1, text:"It's dangerous to go alone! Take this:"}
# 710: {active: 1, play: 1, text:"You were almost a ____ sandwich!"}
# 711: {active: 1, play: 1, text:"That's the second biggest ____ I've ever seen!"}
# 712: {active: 1, play: 1, text:"____. ____ never changes."}
# 713: {active: 1, play: 1, text:"____ has changed. "}
# 714: {active: 1, play: 1, text:"You have been banned. Reason: ____."}
# 715: {active: 1, play: 1, text:"The newest trope against women in video games: ____."}
# 716: {active: 1, play: 1, text:"Fans started a kickstarter for a new ____ game. "}
# 717: {active: 1, play: 1, text:"Huh? What was that noise?"}
# 718: {active: 1, play: 1, text:"Viral marketers are trying to push the new ____."}
# 719: {active: 1, play: 1, text:"I wouldn't call it a Battlestation, more like a ____."}
# 720: {active: 1, play: 1, text:"____: Gotta go fast!"}
# 721: {active: 1, play: 1, text:"The best final fantasy game was ____."}
# 722: {active: 1, play: 1, text:"I love the ____, it's so bad"}
# 723: {active: 1, play: 1, text:"Valve is going to make ____ 2 before they release Half Life 3."}
# 724: {active: 1, play: 1, text:"____ is a pretty cool guy"}
# 725: {active: 1, play: 1, text:"Ah! Your rival! What was his name again?"}
# 726: {active: 1, play: 2, text:"Why is the ____ fandom the worst?"}
# 727: {active: 1, play: 1, text:"Achievement Unlocked: ____ !"}
# 728: {active: 1, play: 1, text:"I'm ____ under the table right now!"}
# 729: {active: 1, play: 1, text:"brb guys, ____ break"}
# 730: {active: 1, play: 1, text:"OH MY GOD JC, A ____"}
# 731: {active: 1, play: 1, text:"wooooooow, it took all 3 of you to ____"}
# 732: {active: 1, play: 1, text:"Rev up those ____, because I am sure hungry for one- HELP! HELP!"}
# 733: {active: 1, play: 1, text:"____ is 2deep and edgy for you."}
# 734: {active: 1, play: 1, text:"Only casuals like ____."}
# 735: {active: 1, play: 1, text:"The princess is in another ____"}
# 736: {active: 1, play: 1, text:"I have the bigger ____."}
# 737: {active: 1, play: 1, text:"____ TEAM RULES!!"}
# 738: {active: 1, play: 1, text:"When you see it... you don't see ____."}
# 739: {active: 1, play: 1, text:"HEY, GOLLEN PALACE? HOW U SAY ____ IN CHINESE?"}
# 740: {active: 1, play: 1, text:"WHAT THE FUCK DID YOU SAY ABOUT ME YOU ____?"}
# 741: {active: 1, play: 1, text:"This will be the 6th time we've posted ____; we've become increasingly efficient at it."}
# 742: {active: 1, play: 1, text:"appealing to a larger audience"}
# 743: {active: 1, play: 1, text:"we must embrace ____ and burn it as fuel for out journey."}
# 744: {active: 1, play: 1, text:"In Kingdom Hearts, D<NAME>d Duck will be replaced with ____ ."}
# 745: {active: 1, play: 1, text:"____ is a lie."}
# 746: {active: 1, play: 1, text:"Because of the lastest school shooting, ____ is being blamed for making kids too violent."}
# 747: {active: 1, play: 1, text:"Here lies ____: peperony and chease"}
# 748: {active: 1, play: 1, text:"Throwaway round: Get rid of those shit cards you don't want. Thanks for all the suggestions, /v/"}
# 749: {active: 1, play: 1, text:"The president has been kidnapped by ____. Are you a bad enough dude to rescue the president?"}
# 750: {active: 1, play: 1, text:"We ____ now."}
# 751: {active: 1, play: 1, text:"What is the new mustard paste?"}
# 752: {active: 1, play: 2, text:"All you had to do was ____ the damn ____!"}
# 753: {active: 1, play: 2, text:"The new ititeration in the Call of Duty franchise has players fighting off ____ deep in the jungles of ____ "}
# 754: {active: 1, play: 2, text:"Check your privilege, you ____ ____."}
# 755: {active: 1, play: 2, text:"Jill, here's a ____. It might come in handy if you, the master of ____, take it with you. "}
# 756: {active: 1, play: 2, text:"____ is a pretty cool guy, eh ____ and doesn't afraid of anything."}
# 757: {active: 1, play: 2, text:"It's like ____with ____!"}
# 758: {active: 1, play: 1, text:"I never thought I'd be comfortable with ____, but now it's pretty much the only thing I masturbate to."}
# 759: {active: 1, play: 1, text:"My next fursuit will have ____."}
# 760: {active: 1, play: 2, text:"I'm writing a porn comic about ____ and ____. "}
# 761: {active: 1, play: 1, text:"I tell everyone that I make my money off 'illustration,' when really, I just draw ____."}
# 762: {active: 1, play: 1, text:"Oh, you're an artist? Could you draw ____ for me?"}
# 763: {active: 1, play: 1, text:"Everyone thinks they're so great, but the only thing they're good at drawing is ____."}
# 764: {active: 1, play: 1, text:"They're just going to spend all that money on ____."}
# 765: {active: 1, play: 1, text:"While everyone else seems to have a deep, instinctual fear of ____, it just turns me on."}
# 766: {active: 1, play: 2, text:"Lying about having ____ to get donations, which you spend on ____."}
# 767: {active: 1, play: 1, text:"It's not bestiality, it's ____."}
# 768: {active: 1, play: 1, text:"Everyone thinks that because I'm a furry, I'm into ____. Unfortunately, they're right."}
# 769: {active: 1, play: 1, text:"I'm only gay for ____."}
# 770: {active: 1, play: 1, text:"Excuse you, I'm a were-____."}
# 771: {active: 1, play: 1, text:"If you like it, then you should put ____ on it."}
# 772: {active: 1, play: 1, text:"My girlfriend won't let me do ____."}
# 773: {active: 1, play: 1, text:"The most pleasant surprise I've had this year."}
# 774: {active: 1, play: 2, text:"I knew I had a problem when I had to sell ____ to pay for ____."}
# 775: {active: 1, play: 1, text:"I'm about 50% ____."}
# 776: {active: 1, play: 1, text:"____: Horrible tragedy, or sexual opportunity?"}
# 777: {active: 1, play: 1, text:"It's a little worrying that I have to compare the size of ____ to beverage containers."}
# 778: {active: 1, play: 2, text:"Hey, you guys wanna come back to my place? I've got ____ and ____."}
# 779: {active: 1, play: 1, text:"Jizzing all over ____."}
# 780: {active: 1, play: 1, text:"It's just that much creepier when 40-year-old men are into ____."}
# 781: {active: 1, play: 1, text:"____ is no substitute for social skills, but it's a start."}
# 782: {active: 1, play: 1, text:"The real reason I got into the fandom? ____."}
# 783: {active: 1, play: 1, text:"____ are definitely the new huskies."}
# 784: {active: 1, play: 1, text:"I remember when ____ was just getting started."}
# 785: {active: 1, play: 1, text:"When no one else is around, sometimes I consider doing things with ____."}
# 786: {active: 1, play: 1, text:"Actually coming inside ____."}
# 787: {active: 1, play: 1, text:"I don't know how we got on the subject of dragon cocks, but it probably started with ____."}
# 788: {active: 1, play: 1, text:"____ is a shining example of what those with autism can really do."}
# 789: {active: 1, play: 1, text:"It is my dream to be covered with ____."}
# 790: {active: 1, play: 2, text:"____ fucking ____. Now that's hot."}
# 791: {active: 1, play: 2, text:"Would you rather suck ____, or get dicked by ____?"}
# 792: {active: 1, play: 2, text:"It never fails to liven up the workplace when you ask your coworkers if they'd rather have sex with ____ or ____."}
# 793: {active: 1, play: 1, text:"HELLO F<NAME>RIEND, HOWL ARE YOU DOING?"}
# 794: {active: 1, play: 2, text:"What are the two worst cards in your hand right now?"}
# 795: {active: 1, play: 1, text:"Nobody believes me when I tell that one story about walking in on ____."}
# 796: {active: 1, play: 2, text:"You don't know who ____ is? They're the one that draws ____."}
# 797: {active: 1, play: 1, text:"You sometimes wish you'd encounter ____ while all alone, in the woods. With a bottle of lube."}
# 798: {active: 1, play: 1, text:"I used to avoid talking about ____, but now it's just a part of normal conversation with my friends."}
# 799: {active: 1, play: 1, text:"The most controversial game at PAX this year is an 8-bit indie platformer about ____. (38/44)"}
# 800: {active: 1, play: 2, text:"Zecora is a well known supplier of ____ and ____."}
# 801: {active: 1, play: 1, text:"There was a riot at the Gearbox panel when they gave the attendees ____. (41/44)"}
# 802: {active: 1, play: 1, text:"The most controversial game at PAX this year is an 8-bit indie platformer about ____."}
# 803: {active: 1, play: 1, text:"What made Spock cry?"}
# 804: {active: 1, play: 1, text:"____: Achievement unlocked."}
# 805: {active: 1, play: 1, text:"What's the latest bullshit that's troubling this quaint fantasy town?"}
# 806: {active: 1, play: 1, text:"____ didn't make it onto the first AT4W DVD."}
# 807: {active: 1, play: 1, text:"____ is part of the WTFIWWY wheelhouse."}
# 808: {active: 1, play: 1, text:"____ is the subject of the Critic's newest review."}
# 809: {active: 1, play: 1, text:"____ is the subject of the missing short from The Uncanny Valley."}
# 810: {active: 1, play: 1, text:"____ needs more gay."}
# 811: {active: 1, play: 1, text:"____ wound up in this week's top WTFIWWY story."}
# 812: {active: 1, play: 1, text:"After getting snowed in at MAGfest, the reviewers were stuck with ____."}
# 813: {active: 1, play: 1, text:"ALL OF ____."}
# 814: {active: 1, play: 1, text:"Being done with My Little Pony, 8-Bit Mickey has moved onto ____."}
# 815: {active: 1, play: 1, text:"Birdemic 3: ____"}
# 816: {active: 1, play: 1, text:"Florida's new crazy is about ____."}
# 817: {active: 1, play: 1, text:"Hello, I'm a ____."}
# 818: {active: 1, play: 1, text:"IT'S NOT ____!"}
# 819: {active: 1, play: 1, text:"It's not nudity if there's ____."}
# 820: {active: 1, play: 1, text:"<NAME>'s next sexual conquest is ____."}
# 821: {active: 1, play: 1, text:"<NAME> had a long day at work, so tonight he'll stream ____."}
# 822: {active: 1, play: 1, text:"<NAME> rejected yet another RDA request for ____."}
# 823: {active: 1, play: 1, text:"<NAME>'s recent rant about Microsoft led to ____."}
# 824: {active: 1, play: 1, text:"<NAME>'s Reviewer Spotlight featured ____."}
# 825: {active: 1, play: 1, text:"New rule in the RDA Drinking Game: Every time ____ happens, take a shot!"}
# 826: {active: 1, play: 1, text:"The best Bad Movie Beatdown sketch is where Film Brain ropes Lordhebe into ____."}
# 827: {active: 1, play: 1, text:"The controversy over ad-blocking could be easily solved by ____."}
# 828: {active: 1, play: 1, text:"The easiest way to counteract a DMCA takedown notice is with ____."}
# 829: {active: 1, play: 1, text:"The new site that will overtake TGWTG is ____."}
# 830: {active: 1, play: 1, text:"The newest Rap Libs makes extensive use of the phrase '____.'"}
# 831: {active: 1, play: 1, text:"The theme of this week's WTFIWWY is ____."}
# 832: {active: 1, play: 1, text:"What is literally the only thing tastier than a dragon's soul?"}
# 833: {active: 1, play: 1, text:"What is the name of the next new Channel Awesome contributor?"}
# 834: {active: 1, play: 1, text:"What killed <NAME>'s son?"}
# 835: {active: 1, play: 1, text:"What made Dodger ban someone from the RDA chat this week?"}
# 836: {active: 1, play: 2, text:"The next TGWTG porn spoof? ____ with ____!"}
# 837: {active: 1, play: 2, text:"Putting ____ in ____? That doesn't go there!"}
# 838: {active: 1, play: 2, text:"In trying to ban ____, Florida accidentally banned ____."}
# 839: {active: 1, play: 2, text:"If ____ got to direct an Uncanny Valley short, it would have featured ____."}
# 840: {active: 1, play: 2, text:"At MAGFest, ____ will host a panel focusing on ____."}
# 841: {active: 1, play: 2, text:"'Greetings, dear listeners. Won't you join ____ for ____?'"}
# 842: {active: 1, play: 2, text:"I'm going to die watching ____ review ____."}
# 843: {active: 1, play: 2, text:"In a new latest announcement video, ____ has announced an appearance at ____."}
# 844: {active: 1, play: 2, text:"____ and ____ would make awesome siblings."}
# 845: {active: 1, play: 2, text:"Some fangirls lay awake all night thinking of ____ and ____ together."}
# 846: {active: 1, play: 2, text:"In my new show, I review ____ while dressed like ____."}
# 847: {active: 1, play: 2, text:"Luke's newest character is ____, the Inner ____."}
# 848: {active: 1, play: 2, text:"Good evening! I am ____ of ____."}
# 849: {active: 1, play: 2, text:"____ is the reason that ____ picked 'AIDS.'"}
# 850: {active: 1, play: 3, text:"Nash's newest made-up curse word is ____-____-____! "}
# 851: {active: 1, play: 3, text:"Using alchemy, combine ____ and ____ to make ____! "}
# 852: {active: 1, play: 3, text:"Nash will build his next contraption with just ____, ____, and ____."}
# 853: {active: 1, play: 3, text:" ____ did ____ to avoid ____."}
# 854: {active: 1, play: 3, text:"Make a WTFIWWY story."}
# 855: {active: 1, play: 1, text:"Dang it, ____!"}
# 856: {active: 1, play: 1, text:"____ was full of leeches."}
# 857: {active: 1, play: 1, text:"Pimp your ___!"}
# 858: {active: 1, play: 1, text:"My apologies to the ____ estate."}
# 859: {active: 1, play: 1, text:"What interrupted the #NLSS?"}
# 860: {active: 1, play: 1, text:"Travel by ____."}
# 861: {active: 1, play: 1, text:"Say that to my face one more time and I'll start ____."}
# 862: {active: 1, play: 1, text:"Oh my god, he's using ____ magic!"}
# 863: {active: 1, play: 1, text:"____ has invaded!"}
# 864: {active: 1, play: 1, text:"We're having technical difficulties due to ____."}
# 865: {active: 1, play: 1, text:"<NAME> is known for his MLG online play. What people don't know is that he's also MLG at ____."}
# 866: {active: 1, play: 1, text:"The next movie reading will be of ____."}
# 867: {active: 1, play: 1, text:"How did Northernlion unite Scotland?"}
# 868: {active: 1, play: 1, text:"Green loves the new Paranautical Activity item ____, but keeps comparing it to the crossbow."}
# 869: {active: 1, play: 1, text:"____ is really essential to completing the game."}
# 870: {active: 1, play: 1, text:"My channel is youtube.com/____."}
# 871: {active: 1, play: 1, text:"Hello anybody, I am ____Patrol."}
# 872: {active: 1, play: 2, text:"I have ____, can you ____ me?"}
# 873: {active: 1, play: 2, text:"____! Get off the ____!"}
# 874: {active: 1, play: 2, text:"My name is ____ and today we'll be checking out ____."}
# 875: {active: 1, play: 2, text:"That's the way ____ did it, that's the way ____ does it, and it''s worked out pretty well so far."}
# 876: {active: 1, play: 3, text:"This time on ____ vs. ____, we're playing ____."}
# 877: {active: 1, play: 1, text:"Welcome back to ____."}
# 878: {active: 1, play: 1, text:"Welcome to Sonic Team! We make ____, I think!"}
# 879: {active: 1, play: 1, text:"What am I willing to put up with today?"}
# 880: {active: 1, play: 1, text:"What is the boopinest shit?"}
# 881: {active: 1, play: 1, text:"WHAT THE FUCK IS A ____?!"}
# 882: {active: 1, play: 1, text:"When I look in the mirror I see ____."}
# 883: {active: 1, play: 1, text:"Who's an asshole?"}
# 884: {active: 1, play: 1, text:"WOOP WOOP WOOP I'M A ____!"}
# 885: {active: 1, play: 1, text:"You know what fan mail makes me the happiest every time I see it? It's the ones where people are like, '____.' "}
# 886: {active: 1, play: 1, text:"You're ruining my integrity! ____ won't hire me now!"}
# 887: {active: 1, play: 1, text:"I've been ____ again!"}
# 888: {active: 1, play: 1, text:"Rolling around at the speed of ____!"}
# 889: {active: 1, play: 1, text:"Use your ____!"}
# 890: {active: 1, play: 1, text:"Look at this guy, he's like ____."}
# 891: {active: 1, play: 1, text:"Look, it's ____!"}
# 892: {active: 1, play: 1, text:"Nightshade: The Claws of ____."}
# 893: {active: 1, play: 1, text:"Number one! With a bullet! Zoom in on the ____!"}
# 894: {active: 1, play: 1, text:"Oh, it's ____!"}
# 895: {active: 1, play: 1, text:"One slice of ____ please."}
# 896: {active: 1, play: 1, text:"Pikachu, use your ____ attack!"}
# 897: {active: 1, play: 1, text:"Put a hole in that ____!"}
# 898: {active: 1, play: 1, text:"Real talk? ____."}
# 899: {active: 1, play: 1, text:"<NAME>'s mom called him to tell him about ____."}
# 900: {active: 1, play: 1, text:"Kirby has two iconic abilities: suck and ____."}
# 901: {active: 1, play: 1, text:"Listen to the ____ on this shit."}
# 902: {active: 1, play: 1, text:"<NAME> believes that the most important part of any video game is ____."}
# 903: {active: 1, play: 1, text:"<NAME> can't get enough of ____."}
# 904: {active: 1, play: 1, text:"<NAME> can't survive air travel without ____."}
# 905: {active: 1, play: 1, text:"<NAME> just wants to touch ____."}
# 906: {active: 1, play: 1, text:"Is there anything to gain from this?"}
# 907: {active: 1, play: 1, text:"It's no use! Take ____!"}
# 908: {active: 1, play: 1, text:"If the ____ wasn't there, I would do. But it's there, so it's not."}
# 909: {active: 1, play: 1, text:"How many nose hairs does ____ have?"}
# 910: {active: 1, play: 1, text:"I certainly can't do it without you, and I know you can't do it without ____!"}
# 911: {active: 1, play: 1, text:"I tell you once, I tell you twice! ____ is good for economy!"}
# 912: {active: 1, play: 1, text:"I wanna put my ____ in her!"}
# 913: {active: 1, play: 1, text:"I'm not even SELLING ____!"}
# 914: {active: 1, play: 1, text:"Do you remember the episode where <NAME> caught a ____?"}
# 915: {active: 1, play: 1, text:"Don't throw ____! It's expensive to somebody!"}
# 916: {active: 1, play: 1, text:"Dude, real talk? ____."}
# 917: {active: 1, play: 1, text:"Eat your ____, son."}
# 918: {active: 1, play: 1, text:"Egoraptor's fiancee is actually a ____."}
# 919: {active: 1, play: 1, text:"Everybody wants to know about me, but they don't know about my ____."}
# 920: {active: 1, play: 1, text:"Fool me once, I'm mad. Fool me twice? How could you. Fool me three times, you're officially ____."}
# 921: {active: 1, play: 1, text:"For my first attack, I will juggle ____ to impress you."}
# 922: {active: 1, play: 1, text:"Fuck, I found a ____."}
# 923: {active: 1, play: 1, text:"Give ____ a chance! He'll grow on you!"}
# 924: {active: 1, play: 1, text:"____? Ten-outta-ten!"}
# 925: {active: 1, play: 1, text:"____. I AAAAAAIN’T HAVIN’ THAT SHIT!"}
# 926: {active: 1, play: 1, text:"____. It's no use!"}
# 927: {active: 1, play: 1, text:"____. MILLIONS ARE DEAD!!!"}
# 928: {active: 1, play: 1, text:"____. This is like one of my Japanese animes!"}
# 929: {active: 1, play: 1, text:"...What the bloody hell are you two talking about?!"}
# 930: {active: 1, play: 1, text:"'You want cheese pizza?' 'No. ____.'"}
# 931: {active: 1, play: 1, text:"And then, as a fuckin' goof, I'd put a hole in ____."}
# 932: {active: 1, play: 1, text:"And there it was...Kirby had finally met the ____ of the lost city."}
# 933: {active: 1, play: 1, text:"It took hours to edit ____ into the video."}
# 934: {active: 1, play: 1, text:"Arin believes that the most important part of any video game is ____."}
# 935: {active: 1, play: 1, text:"Arin has an adverse reaction to ____."}
# 936: {active: 1, play: 1, text:"Barry entertains himself by watching old episodes of ____."}
# 937: {active: 1, play: 1, text:"<NAME>, add ____ into the video!"}
# 938: {active: 1, play: 1, text:"<NAME>, we need a replay on ____."}
# 939: {active: 1, play: 1, text:"<NAME>! SHOW ____ AGAIN!"}
# 940: {active: 1, play: 1, text:"<NAME>'s sheer skill at ____ is unmatched."}
# 941: {active: 1, play: 1, text:"I don't like the ____ flavor."}
# 942: {active: 1, play: 1, text:"____ don't even cost this less!"}
# 943: {active: 1, play: 1, text:"____ has aged really well."}
# 944: {active: 1, play: 1, text:"____ is GREAT GREAT GREAT!"}
# 945: {active: 1, play: 1, text:"____ Train!"}
# 946: {active: 1, play: 1, text:"____ WINS!"}
# 947: {active: 1, play: 1, text:"____: Better than deer shit!"}
# 948: {active: 1, play: 2, text:"Welcome back to ____ ____!"}
# 949: {active: 1, play: 2, text:"Real talk? Is that ____ ____?"}
# 950: {active: 1, play: 2, text:"Look at that ____-ass ____!"}
# 951: {active: 1, play: 2, text:"JON'S ____, SHOW US YOUR ____."}
# 952: {active: 1, play: 2, text:"If you don't know what ____ is, you can't go to ____."}
# 953: {active: 1, play: 2, text:"IF I CAN'T BE ____, I SURE AS HELL CAN BE ____!!"}
# 954: {active: 1, play: 2, text:"COME ON AND ____, AND WELCOME TO THE ____!"}
# 955: {active: 1, play: 3, text:"If ____ evolved from ____, why the fuck is there still ____, dude?!"}
# 956: {active: 1, play: 3, text:"____? Pretty smart. ____? Pretty fuckin' smart. ____? FUCKING GENIUS!!!!"}
# 957: {active: 1, play: 1, text:"____ is the greatest Canadian."}
# 958: {active: 1, play: 1, text:"____ is the worst on the Podcast."}
# 959: {active: 1, play: 1, text:"____. That's top."}
# 960: {active: 1, play: 1, text:"After getting wasted at PAX, <NAME> announced that 'I am ____!'"}
# 961: {active: 1, play: 1, text:"<NAME> sucks ____."}
# 962: {active: 1, play: 1, text:"Close up of my ____."}
# 963: {active: 1, play: 1, text:"Come to Fort ____!"}
# 964: {active: 1, play: 1, text:"Describe yourself in one word/phrase."}
# 965: {active: 1, play: 1, text:"Detective ____ is down!"}
# 966: {active: 1, play: 1, text:"Does our house say 'We love ____?'"}
# 967: {active: 1, play: 1, text:"Dude, I got sixteen ____!"}
# 968: {active: 1, play: 1, text:"Fight, fight, fight, ____?"}
# 969: {active: 1, play: 1, text:"Fuck it, I mean ____, right?"}
# 970: {active: 1, play: 1, text:"I'ma smother you in my ____!"}
# 971: {active: 1, play: 1, text:"If you could fuck anyone in the world, who would you choose?"}
# 972: {active: 1, play: 1, text:"If you could have any superpower, what would it be?"}
# 973: {active: 1, play: 1, text:"If you were allowed to do one illegal thing, what would it be? "}
# 974: {active: 1, play: 1, text:"It's a ____ out there."}
# 975: {active: 1, play: 1, text:"It's not my fault. Somebody put ____ in my way."}
# 976: {active: 1, play: 1, text:"<NAME> plays ____."}
# 977: {active: 1, play: 1, text:"Let's do ____ again! This is fun!"}
# 978: {active: 1, play: 1, text:"Lindsay could fuck up ____."}
# 979: {active: 1, play: 1, text:"LLLLLLLLLLLLLET'S ____!"}
# 980: {active: 1, play: 1, text:"My ____ is trying to die."}
# 981: {active: 1, play: 1, text:"On tonight's Let's Play, the AH crew plays ____."}
# 982: {active: 1, play: 1, text:"People like ____."}
# 983: {active: 1, play: 1, text:"RT Recap, featuring ____!"}
# 984: {active: 1, play: 1, text:"Shout out to ____!"}
# 985: {active: 1, play: 1, text:"Shout out to my mom. Called my Teddy Bear ____."}
# 986: {active: 1, play: 1, text:"So, I was just walking along, until suddenly ____ came along and attacked me."}
# 987: {active: 1, play: 1, text:"Thanks to ____ for this week's theme song."}
# 988: {active: 1, play: 1, text:"This week on AHWU, ____."}
# 989: {active: 1, play: 1, text:"This week on Immersion, we are going to test ____."}
# 990: {active: 1, play: 1, text:"What are fire hydrants called in England?"}
# 991: {active: 1, play: 1, text:"What is Game Night?"}
# 992: {active: 1, play: 1, text:"What is the meaning of life?"}
# 993: {active: 1, play: 1, text:"What is the saddest thing you've ever seen?"}
# 994: {active: 1, play: 1, text:"What is the worst thing anyone could say in front of the police?"}
# 995: {active: 1, play: 1, text:"What is your biggest feature?"}
# 996: {active: 1, play: 1, text:"What is your favorite book?"}
# 997: {active: 1, play: 1, text:"What is your mating call?"}
# 998: {active: 1, play: 1, text:"What makes Caboose angry?"}
# 999: {active: 1, play: 1, text:"What would be your chosen catchphrase?"}
# 1000: {active: 1, play: 1, text:"Where are we going for lunch?"}
# 1001: {active: 1, play: 1, text:"Who has a fake Internet girlfriend?"}
# 1002: {active: 1, play: 1, text:"Why are we here?"}
# 1003: {active: 1, play: 1, text:"Would you guys still like me if my name was ____?"}
# 1004: {active: 1, play: 1, text:"You threw it against the wall like a ____!"}
# 1005: {active: 1, play: 2, text:"____ is ____ as dicks."}
# 1006: {active: 1, play: 2, text:"____ is the best ____ ever. Of all time."}
# 1007: {active: 1, play: 2, text:"____ wins! ____ is a horse!"}
# 1008: {active: 1, play: 2, text:"If you got $1,000,000 per week, would you ____, but in the next day, you'd have to ____?"}
# 1009: {active: 1, play: 2, text:"My name is ____, and I hate ____!"}
# 1010: {active: 1, play: 2, text:"No one in the office expected the bromance between ____ and ____."}
# 1011: {active: 1, play: 2, text:"Select two cards to create your team name."}
# 1012: {active: 1, play: 3, text:"This week on VS, ____ challenges ____ to a game of ____."}
# 1013: {active: 1, play: 3, text:"The war's over. We're holding a parade in ____'s honor. ____ drives the float, and ____ is in charge of confetti."}
# 1014: {active: 1, play: 1, text:"What's a paladin?"}
# 1015: {active: 1, play: 1, text:"One of these days i'm just gonna shit my ____."}
# 1016: {active: 1, play: 1, text:"You need to ____ your asshole, it's vital to this operation."}
# 1017: {active: 1, play: 1, text:"I'm sorry <NAME>, but I must ____ you."}
# 1018: {active: 1, play: 1, text:"In this week's gauntlet, Tehsmarty challenges ChilledChaos to ____."}
# 1019: {active: 1, play: 1, text:"In this week's gauntlet, ChilledChaos challenges Tehsmarty to ____."}
# 1020: {active: 1, play: 1, text:"I AM THE ____ CZAR!!!"}
# 1021: {active: 1, play: 1, text:"ZeRoyalViking's up and coming game company, 'ZEA' accredits their success to ____."}
# 1022: {active: 1, play: 1, text:"Tehsmarty loves the smell of ____ in the morning."}
# 1023: {active: 1, play: 1, text:"The Creatures' next member is ____."}
# 1024: {active: 1, play: 1, text:"Come on and slam, and welcome to the ____."}
# 1025: {active: 1, play: 1, text:"____, the one you want to get DDoS'd"}
# 1026: {active: 1, play: 2, text:"Why are there six ____ when there are only four ____?"}
# 1027: {active: 1, play: 1, text:"GaLmHD is so pro at almost every game he plays yet he can`t play____!"}
# 1028: {active: 1, play: 1, text:"Smarty's darkest fear is ____."}
# 1029: {active: 1, play: 1, text:"Pewdiepie's going to play ____!?"}
# 1030: {active: 1, play: 1, text:"And here we have ____. Strike it's weakness for MASSIVE damage!"}
# 1031: {active: 1, play: 1, text:"But <NAME>! Why do you think that ____?"}
# 1032: {active: 1, play: 1, text:"In the next episode of Press Heart to Continue: Dodger talks about ____."}
# 1033: {active: 1, play: 1, text:"What did <NAME>ken do this time to break ARMA III? "}
# 1034: {active: 1, play: 1, text:"What was the big prize this time around at the Thrown Controllers panel?"}
# 1035: {active: 1, play: 1, text:"What did <NAME> or <NAME> find in the fridge today?"}
# 1036: {active: 1, play: 1, text:"In ____ We Trust."}
# 1037: {active: 1, play: 1, text:"When <NAME> finally removed his horsemask on the livestream, we saw ____."}
# 1038: {active: 1, play: 1, text:"I give this game a rating of ____."}
# 1039: {active: 1, play: 1, text:"What did <NAME> overreact to on his channel today?"}
# 1040: {active: 1, play: 1, text:"This time on Brutalmoose's Top 10, his guest was ____."}
# 1041: {active: 1, play: 1, text:"Only Totalbiscuit would spend an hour long video discussing ____."}
# 1042: {active: 1, play: 1, text:"Last Thursday, <NAME> was identified in public and she proceeded to ____."}
# 1043: {active: 1, play: 1, text:"On this episode of PKA Woody and Wings talk about ____."}
# 1044: {active: 1, play: 1, text:"Bro's Angels. We ____ hard."}
# 1045: {active: 1, play: 1, text:"TotalBiscuit's top hat is actually ____. "}
# 1046: {active: 1, play: 2, text:"GTA shenanigans would not be GTA shenanigans without Seananners dropping ____ on ____."}
# 1047: {active: 1, play: 2, text:"Knowing Chilled's knowledge with Minecraft, he'll probably use ____ on ____ in his next video."}
# 1048: {active: 1, play: 2, text:"Oh great, ____ is doing another ____ game LP."}
# 1049: {active: 1, play: 2, text:"In his new Co-op work SSoHPKC will be playing ____ with ____."}
# 1050: {active: 1, play: 2, text:"My name is-a ____ and i likea da ____."}
# 1051: {active: 1, play: 1, text:"In today's Driftor in-depth episode we shall look at ____."}
# 1052: {active: 1, play: 1, text:"The Xbox One's DRM policy isn't half as bad as ____."}
# 1053: {active: 1, play: 1, text:"What will YouTube add in its next unneeded update?"}
# 1054: {active: 1, play: 1, text:"Two Best Friends Play ____."}
# 1055: {active: 1, play: 1, text:"There was a riot at the Gearbox panel when they gave the attendees ____."}
# 1056: {active: 1, play: 1, text:"In the new DLC for Mass Effect, Shepard must save the galaxy from ____."}
# 1057: {active: 1, play: 1, text:"No Enforcer wants to manage the panel on ____."}
# 1058: {active: 1, play: 1, text:"What's fun until it gets weird?"}
# 1059: {active: 1, play: 1, text:"<NAME>'s new film tells the story of a precocious child coming to terms with ____."}
# 1060: {active: 1, play: 1, text:"I'm sorry, sir, but we don't allow ____ at the country club."}
# 1061: {active: 1, play: 1, text:"How am I compensating for my tiny penis?"}
# 1062: {active: 1, play: 1, text:"You've seen the bearded lady! You've seen the ring of fire! Now, ladies and gentlemen, feast your eyes upon ____!"}
# 1063: {active: 1, play: 1, text:"She's up all night for good fun. I'm up all night for ____."}
# 1064: {active: 1, play: 1, text:"Dear Leader <NAME>, our village praises your infinite wisdom with a humble offering of ____."}
# 1065: {active: 1, play: 1, text:"Man, this is bullshit. Fuck ____."}
# 1066: {active: 1, play: 3, text:"You guys, I saw this crazy movie last night. It opens on ____, and then there's some stuff about ____, and then it ends with ____."}
# 1067: {active: 1, play: 2, text:"In return for my soul, the Devil promised me ____, but all I got was ____."}
# 1068: {active: 1, play: 1, text:"The Japanese have developed a smaller, more efficient version of ____."}
# 1069: {active: 1, play: 1, text:"Alright, bros. Our frat house is condemned, and all the hot slampieces are over at Gamma Phi. The time has come to commence Operation ____."}
# 1070: {active: 1, play: 1, text:"This is the prime of my life. I'm young, hot, and full of ____."}
# 1071: {active: 1, play: 1, text:"I'm pretty sure I'm high right now, because I'm absolutely mesmerized by ____."}
# 1072: {active: 1, play: 1, text:"It lurks in the night. It hungers for flesh. This summer, no one is safe from ____."}
# 1073: {active: 1, play: 2, text:"If you can't handle ____, you'd better stay away from ____."}
# 1074: {active: 1, play: 2, text:"Forget everything you know about ____, because now we've supercharged it with ____!"}
# 1075: {active: 1, play: 2, text:"Honey, I have a new role-play I want to try tonight! You can be ____, and I'll be ____."}
# 1076: {active: 1, play: 2, text:"This year's hottest album is '____' by ____."}
# 1077: {active: 1, play: 2, text:"Every step towards ____ gets me a little closer to ____."}
# 1078: {active: 1, play: 1, text:"Do not fuck with me! I am literally ____ right now."}
# 1079: {active: 1, play: 1, text:"2 AM in the city that never sleeps. The door swings open and she walks in, legs up to here. Something in her eyes tells me she's looking for ____."}
# 1080: {active: 1, play: 1, text:"As king, how will I keep the peasants in line?"}
# 1081: {active: 1, play: 2, text:"I am become ____, destroyer of ____!"}
# 1082: {active: 1, play: 2, text:"In the beginning, there was ____. And the Lord said, 'Let there be ____.'"}
# 1083: {active: 1, play: 2, text:"____ will never be the same after ____."}
# 1084: {active: 1, play: 2, text:"We never did find ____, but along the way we sure learned a lot about ____."}
# 1085: {active: 1, play: 2, text:"____ may pass, but ____ will last forever."}
# 1086: {active: 1, play: 2, text:"Adventure. Romance. ____. From Paramount Pictures, '____.'"}
# 1087: {active: 1, play: 1, text:"The seldomly mentioned 4th little pig built his house out of ____."}
# 1088: {active: 1, play: 1, text:"Mom, I swear! Despite its name, ____ is NOT a porno!"}
# 1089: {active: 1, play: 2, text:"Oprah's book of the month is '____ For ____: A Story of Hope.'"}
# 1090: {active: 1, play: 2, text:"But wait, there's more! If you order ____ in the next 15 minutes, we'll throw in ____ absolutely free!"}
# 1091: {active: 1, play: 1, text:"Blessed are you, Lord our God, creator of the universe, who has granted us ____."}
# 1092: {active: 1, play: 2, text:"That fucking idiot ____ ragequit the fandom over ____."}
# 1093: {active: 1, play: 1, text:"Because they are forbidden from masturbating, Mormons channel their repressed sexual energy into ____."}
# 1094: {active: 1, play: 1, text:"I really hope my grandmother doesn't ask me to explain ____ again."}
# 1095: {active: 1, play: 1, text:"What's the one thing that makes an elf instantly ejaculate?"}
# 1096: {active: 1, play: 1, text:"GREETINGS HUMANS. I AM ____ BOT. EXECUTING PROGRAM"}
# 1097: {active: 1, play: 1, text:"Kids these days with their iPods and their Internet. In my day, all we needed to pass the time was ____."}
# 1098: {active: 1, play: 1, text:"I always ____ ass - razor1000."}
# 1099: {active: 1, play: 1, text:"____ for temperature. "}
# 1100: {active: 1, play: 1, text:"Not asking for upvotes but ____."}
# 1101: {active: 1, play: 1, text:"I got ____ to the frontpage "}
# 1102: {active: 1, play: 1, text:"I know this is going to get downvoted to hell but ____."}
# 1103: {active: 1, play: 1, text:"I know this is a selfie but ____."}
# 1104: {active: 1, play: 1, text:"Imgur: where the points don’t matter and the ____ is made up."}
# 1105: {active: 1, play: 1, text:"If you could stop ____, that’d be greeeeattt. "}
# 1106: {active: 1, play: 1, text:"ERMAGERD! ____."}
# 1107: {active: 1, play: 1, text:"Not sure if Imgur reference or ____."}
# 1108: {active: 1, play: 1, text:"Having a bit of fun with the new ____."}
# 1109: {active: 1, play: 1, text:"Press 0 twice for ____."}
# 1110: {active: 1, play: 1, text:"No, no, you leave ____. We no like you."}
# 1111: {active: 1, play: 1, text:"FOR ____!!!!"}
# 1112: {active: 1, play: 2, text:"If ____ happens because of ____, I will eat my socks."}
# 1113: {active: 1, play: 1, text:"Put that ____ back where it came from or so help me."}
# 1114: {active: 1, play: 1, text:"Yer a wizard ____"}
# 1115: {active: 1, play: 1, text:"Am I the only one around here who ____?"}
# 1116: {active: 1, play: 2, text:"Confession Bear: When I was 6, I ____ on my ____."}
# 1117: {active: 1, play: 1, text:"Actual Advice Mallard: Always ____."}
# 1118: {active: 1, play: 1, text:"For every upvote I will ____."}
# 1119: {active: 1, play: 1, text:"____. Awkward boner. "}
# 1120: {active: 1, play: 1, text:"____. Forever Alone."}
# 1121: {active: 1, play: 1, text:"____. TOO SAD AND TOO TINY!"}
# 1122: {active: 1, play: 2, text:"I’ve never seen anyone so ____ while ____."}
# 1123: {active: 1, play: 1, text:"OH MY GOD ____. ARE YOU FUCKING KIDDING ME!?"}
# 1124: {active: 1, play: 1, text:"You know nothing ____."}
# 1125: {active: 1, play: 1, text:"Most of the time you can only fit one____ in there."}
# 1126: {active: 1, play: 1, text:"That ____ tasted so bad, I needed a Jolly Rancher. "}
# 1127: {active: 1, play: 2, text:"I don’t always ____. But when I do____.."}
# 1128: {active: 1, play: 1, text:"+1 for ____."}
# 1129: {active: 1, play: 1, text:"SAY GOODBYE TO____."}
# 1130: {active: 1, play: 1, text:"When I found ____ in usersubmitted, I was flabbergasted. "}
# 1131: {active: 1, play: 1, text:"France is ____"}
# 1132: {active: 1, play: 2, text:"The ____ for this ____ is TOO DAMN HIGH. "}
# 1133: {active: 1, play: 1, text:"Any love for ____?"}
# 1134: {active: 1, play: 1, text:"In Japan, ____ is the new sexual trend."}
# 1135: {active: 1, play: 2, text:"I love bacon as much as ____ loves ____."}
# 1136: {active: 1, play: 2, text:"A hipster needs a ____ as much as a fish needs a ____."}
# 1137: {active: 1, play: 1, text:"<NAME> is a ____."}
# 1138: {active: 1, play: 1, text:"Are you my ____?"}
# 1139: {active: 1, play: 1, text:"Weasley is our ____."}
# 1140: {active: 1, play: 1, text:"I have a bad feeling about ____."}
# 1141: {active: 1, play: 1, text:"I am a leaf on the ____."}
# 1142: {active: 1, play: 1, text:"That was more awkward than ____."}
# 1143: {active: 1, play: 1, text:"Boardgame Online is more fun than ____."}
# 1144: {active: 1, play: 2, text:"I hate My Little Pony more than ____ hates ____."}
# 1145: {active: 1, play: 2, text:"I love My Little Pony more than ____ loves ____."}
# 1146: {active: 1, play: 1, text:"Cat gifs are cuter than ____. "}
# 1147: {active: 1, play: 1, text:"If it fits, I ____. "}
# 1148: {active: 1, play: 1, text:"____. My moon and my stars. "}
# 1149: {active: 1, play: 1, text:"A ____ always pays his debts. "}
# 1150: {active: 1, play: 1, text:"My ovaries just exploded because of ____. "}
# 1151: {active: 1, play: 1, text:"Chewie, ____ it!"}
# 1152: {active: 1, play: 1, text:"<NAME> has no ____. "}
# 1153: {active: 1, play: 1, text:"<NAME> is ____!!"}
# 1154: {active: 1, play: 3, text:"The court finds the defendant, ____, guilty of ____, and sentences them to a lifetime of ____."}
# 1155: {active: 1, play: 3, text:"____ ____ Divided By ____."}
# 1156: {active: 1, play: 2, text:"____ adds a thread in the Anti-____ group, and everybody loses their fucking minds."}
# 1157: {active: 1, play: 1, text:"____ is Best Pony."}
# 1158: {active: 1, play: 2, text:"____ is the least autistic ____ on Fimfiction."}
# 1159: {active: 1, play: 2, text:"____ posted that they're not working on fics for a while, because ____."}
# 1160: {active: 1, play: 2, text:"____ signalled the end of the ____ Age of FiMfiction.net."}
# 1161: {active: 1, play: 1, text:"____ signalled the end of the Golden Age of FiMfiction.net."}
# 1162: {active: 1, play: 1, text:"____ was a strong stallion."}
# 1163: {active: 1, play: 3, text:"____, ____, and ____ in a sexy circlejerk."}
# 1164: {active: 1, play: 3, text:"A clopfic about ____ with ____, and ____ is a sexy orphan."}
# 1165: {active: 1, play: 2, text:"An alternate universe where ____ is instead ____."}
# 1166: {active: 1, play: 2, text:"Fallout Equestria is ____ and tends to overdramaticize its ____."}
# 1167: {active: 1, play: 1, text:"Hey, let's cross over ____ and MLP! Why the fuck not?"}
# 1168: {active: 1, play: 3, text:"I commissioned a picture of ____ violating ____ with ____'s dick."}
# 1169: {active: 1, play: 1, text:"I hope someone writes a fic about ____ because I am too fucking lazy to do it myself."}
# 1170: {active: 1, play: 2, text:"I just read a fic where ____ was fucking ____."}
# 1171: {active: 1, play: 1, text:"I just started the ____verse."}
# 1172: {active: 1, play: 1, text:"I swear I'm going to quit the fandom if ____ happens."}
# 1173: {active: 1, play: 1, text:"If only people bothered to read Ezn's ____ Guide!"}
# 1174: {active: 1, play: 1, text:"knighty's new blogpost is about ____"}
# 1175: {active: 1, play: 1, text:"My ____ Pony"}
# 1176: {active: 1, play: 1, text:"My Little Dashie? How about My Little ____?"}
# 1177: {active: 1, play: 2, text:"My OTP is ____ and ____."}
# 1178: {active: 1, play: 1, text:"Oh, fuck, someone made a group about ____."}
# 1179: {active: 1, play: 1, text:"Oh, look, ____ made a fan group for themselves."}
# 1180: {active: 1, play: 2, text:"RainbowBob's newest clopfic: ____ X ____"}
# 1181: {active: 1, play: 1, text:"Remember when ____ was on every page?"}
# 1182: {active: 1, play: 1, text:"Short Skirts and ____."}
# 1183: {active: 1, play: 3, text:"Someone should write a clopfic of ____ fucking ____, using ____ as lubricant."}
# 1184: {active: 1, play: 1, text:"The ____ Bureau."}
# 1185: {active: 1, play: 2, text:"The ____ Group of ____ Excellence."}
# 1186: {active: 1, play: 2, text:"The cardinal sin of FiMFic noobs: _____ without ______"}
# 1187: {active: 1, play: 2, text:"The Incredible ____ Of A Winning ____."}
# 1188: {active: 1, play: 2, text:"There's a crossover fic about ____ and ____ in the FB."}
# 1189: {active: 1, play: 3, text:"____: ____ in fiction, ____ on the tabletop."}
# 1190: {active: 1, play: 2, text:"I proxy ____ using a second-hand ____."}
# 1191: {active: 1, play: 1, text:"Next up: L<NAME> L<NAME>ander's paints ____."}
# 1192: {active: 1, play: 1, text:"The citizens of Innsmouth are really ____!"}
# 1193: {active: 1, play: 1, text:"I am Angry, Angry about ____."}
# 1194: {active: 1, play: 2, text:"In respect to your chapter, the Blood Ravens have dedicated one of their____to ____."}
# 1195: {active: 1, play: 1, text:"Roll for ____."}
# 1196: {active: 1, play: 1, text:"I prepared ____ this morning."}
# 1197: {active: 1, play: 1, text:"The bard nearly got us killed when he rolled to seduce ____."}
# 1198: {active: 1, play: 1, text:"____ causes the Paladin to fall"}
# 1199: {active: 1, play: 2, text:"The door to the FLGS opens and a ____ walks in!"}
# 1200: {active: 1, play: 1, text:"GW stores no longer stock____"}
# 1201: {active: 1, play: 1, text:"The price on ____ Has doubled!"}
# 1202: {active: 1, play: 1, text:"____ falls, everyone dies."}
# 1203: {active: 1, play: 1, text:"My GM just made his girlfriend a ____ character. How fucked are we?"}
# 1204: {active: 1, play: 1, text:"If you buy a camel, Crazy Hassan is adding in free ____ this week only!"}
# 1205: {active: 1, play: 1, text:"Around elves, watch ____"}
# 1206: {active: 1, play: 2, text:"The only good ____ is a dead ____"}
# 1207: {active: 1, play: 1, text:"...And then he killed the Tarasque with a ____"}
# 1208: {active: 1, play: 1, text:"There is a ____ on the roof."}
# 1209: {active: 1, play: 1, text:"What are we going to argue about today?"}
# 1210: {active: 1, play: 1, text:"I got a box today. What's inside? ____"}
# 1211: {active: 1, play: 1, text:"Roll ____ circumference"}
# 1212: {active: 1, play: 3, text:"What I made: ____. What the Dungeon Master saw: ____. What I played: ____"}
# 1213: {active: 1, play: 2, text:"____ vs. ____: Critical Hit!"}
# 1214: {active: 1, play: 1, text:"Then the barbarian drank from the ____-filled fountain"}
# 1215: {active: 1, play: 1, text:"____: That was a thing."}
# 1216: {active: 1, play: 1, text:"preferring 3D women over ____"}
# 1217: {active: 1, play: 1, text:"Where we're going, we won't need ____ to see"}
# 1218: {active: 1, play: 1, text:"You encounter a Gazebo. You respond with ____"}
# 1219: {active: 1, play: 1, text:"D&D: 6th edition will feature ____ as a main race!"}
# 1220: {active: 1, play: 1, text:"Your Natural 1 summons ____."}
# 1221: {active: 1, play: 1, text:"It would have taken ____ to..... CREEEEEEEEEED!"}
# 1222: {active: 1, play: 1, text:"Can ____ bloom on the battlefield?"}
# 1223: {active: 1, play: 1, text:"____? That's ULTRA heretical"}
# 1224: {active: 1, play: 1, text:"So I made my chapter insignia ____"}
# 1225: {active: 1, play: 1, text:"In the grim darkness of the far future there is only ____"}
# 1226: {active: 1, play: 1, text:"2e or ____"}
# 1227: {active: 1, play: 2, text:"Blood for the blood god! ____ for the ____!"}
# 1228: {active: 1, play: 1, text:"____. we don't need other boards anymore!"}
# 1229: {active: 1, play: 1, text:"____ just fucked us"}
# 1230: {active: 1, play: 2, text:"The guard looks a troubled, uncomfortable glare, like a man who must explain to his ____, that's its dreams of becoming ____ will never happen."}
# 1231: {active: 1, play: 1, text:"Dwarf Fortress needs more ____"}
# 1232: {active: 1, play: 1, text:"My ____ are moving on their own"}
# 1233: {active: 1, play: 1, text:"Welcome to the ____ Quest Thread."}
# 1234: {active: 1, play: 1, text:"You should never let your bard ____."}
# 1235: {active: 1, play: 1, text:"That one guy in my group always rolls a chaotic neutral ____."}
# 1236: {active: 1, play: 1, text:"The lich's phylactery is a ____!"}
# 1237: {active: 1, play: 1, text:"Macha was dismayed to find out that ____."}
# 1238: {active: 1, play: 1, text:"Never fire ____ at the bulkhead!"}
# 1239: {active: 1, play: 1, text:"____ is the only way I can forget about 4e."}
# 1240: {active: 1, play: 1, text:"I sure hope no one notices that I inserted my ____ fetish into the game."}
# 1241: {active: 1, play: 2, text:"Behold! White Wolf's newest game: ____: the ____."}
# 1242: {active: 1, play: 1, text:"For our upcoming FATAL game, I've assigned ____ as your new character."}
# 1243: {active: 1, play: 2, text:"The GM has invited his new ____ to join the game. They'll be playing ____."}
# 1244: {active: 1, play: 1, text:"0/10 would not ____."}
# 1245: {active: 1, play: 1, text:"The ____ guides my blade."}
# 1246: {active: 1, play: 1, text:"Don't touch me ____!"}
# 1247: {active: 1, play: 1, text:"Mountain, Black lotus, sac, to cast ____."}
# 1248: {active: 1, play: 2, text:"____ followed by gratuitous ____ is how I got kicked out off my last group."}
# 1249: {active: 1, play: 1, text:"Everybody was surprised when the king's trusted adviser turned out to be ____."}
# 1250: {active: 1, play: 3, text:"You and ____ must stop ____ with the ancient artifact ____."}
# 1251: {active: 1, play: 1, text:"Elf ____ Wat do?"}
# 1252: {active: 1, play: 1, text:"Magic the Gathering's next set is themed around ____."}
# 1253: {active: 1, play: 1, text:"We knew the game was off to a good start when the GM didn't veto a player's decision to play as ____."}
# 1254: {active: 1, play: 1, text:"My Kriegers came in a box of ____!"}
# 1255: {active: 1, play: 1, text:"I had to kill a party member when wasted 2 hours by ____."}
# 1256: {active: 1, play: 1, text:"We found ____in the Dragon's hoard."}
# 1257: {active: 1, play: 1, text:"What's on today's agenda for the mage guild meeting?"}
# 1258: {active: 1, play: 1, text:"____ is the only way to fix 3.5."}
# 1259: {active: 1, play: 1, text:"What is the BBEG's secret weapon?"}
# 1260: {active: 1, play: 1, text:"Ach! Hans run! It's the ____!"}
# 1261: {active: 1, play: 1, text:"The enemy's ____ is down."}
# 1262: {active: 1, play: 1, text:"Only fags play mono____."}
# 1263: {active: 1, play: 1, text:"What is better than 3D women?"}
# 1264: {active: 1, play: 1, text:"I kept getting weird looks at FNM when I brought my new ____ card sleeves."}
# 1265: {active: 1, play: 1, text:"I like to dress up like ____ and hit people with foam swords."}
# 1266: {active: 1, play: 2, text:"You've been cursed by the witch! Your ____ has turned into a ____!"}
# 1267: {active: 1, play: 1, text:"The adventure was going fine until the BBEG put ____ in our path."}
# 1268: {active: 1, play: 1, text:"Your BBEG is actually ____!"}
# 1269: {active: 1, play: 1, text:"The last straw was the Chaotic Neutral buying a case of ____."}
# 1270: {active: 1, play: 1, text:"What won't the Bard fuck?."}
# 1271: {active: 1, play: 1, text:"____! what was that?"}
# 1272: {active: 1, play: 1, text:"You roll 00 for your magical mishap and turn into ____."}
# 1273: {active: 1, play: 1, text:"You fool! you fell victim to one of the classic blunders: ____."}
# 1274: {active: 1, play: 1, text:"...and then the bastard pulled out ____ and placed it on the table."}
# 1275: {active: 1, play: 3, text:"What is your OT3?"}
# 1276: {active: 1, play: 1, text:"I cast magic missile at ____."}
# 1277: {active: 1, play: 2, text:"Wait! I'm a ____! Let me tell you about my ____!"}
# 1278: {active: 1, play: 2, text:"Whenever we run ____, it's customary that ____ pays for the group's pizza."}
# 1279: {active: 1, play: 1, text:"My most shameful orgasm was the time I masturbated to ____."}
# 1280: {active: 1, play: 1, text:"I got an STD from ____."}
# 1281: {active: 1, play: 1, text:"____ is serious business."}
# 1282: {active: 1, play: 1, text:"If you don't pay your Comcast cable bill, they will send ____ after you."}
# 1283: {active: 1, play: 1, text:"Mewtwo achieved a utopian society when he eliminated ____ once and for all."}
# 1284: {active: 1, play: 1, text:"The only thing that caused more of a shitfit than Mewtwo's new form is ____."}
# 1285: {active: 1, play: 1, text:"The idiots in that one room at the Westin finally got kicked out of Anthrocon for ____."}
# 1286: {active: 1, play: 1, text:"Furaffinity went down for 48 hours because of ____."}
# 1287: {active: 1, play: 1, text:"Anthrocon was ruined by ____."}
# 1288: {active: 1, play: 1, text:"I unwatched his FurAffinity page because he kept posting ____."}
# 1289: {active: 1, play: 1, text:"You don't want to find ____ in your Furnando's Lasagna Wrap."}
# 1290: {active: 1, play: 2, text:"____ ruined the ____ fandom for all eternity."}
# 1291: {active: 1, play: 2, text:"I was fapping to ____, but ____ walked in on me."}
# 1292: {active: 1, play: 1, text:"In recent tech news, computers are now being ruined by ____."}
# 1293: {active: 1, play: 3, text:"Yu-Gi-Oh players were shocked when the win condition of holding 5 Exodia pieces was replaced by ____, ____, and ____. "}
# 1294: {active: 1, play: 3, text:"What are the worst 3 cards in your hand right now?"}
# 1295: {active: 1, play: 1, text:"____ makes the Homestuck fandom uncomfortable."}
# 1296: {active: 1, play: 2, text:"____ stays awake at night, crying over ____."}
# 1297: {active: 1, play: 1, text:"____. It keeps happening!"}
# 1298: {active: 1, play: 1, text:"'Sacred leggings' was a mistranslation. The Sufferer actually died in Sacred ____."}
# 1299: {active: 1, play: 1, text:"After throwing ____ at Karkat's head, <NAME> made the intriguing discover that troll horns are very sensitive."}
# 1300: {active: 1, play: 1, text:"AG: Who needs luck when you have ____?"}
# 1301: {active: 1, play: 1, text:"All ____. All of it!"}
# 1302: {active: 1, play: 1, text:"Alternia's political system was based upon ____."}
# 1303: {active: 1, play: 1, text:"Believe it or not, Kankri's biggest trigger is ____."}
# 1304: {active: 1, play: 1, text:"<NAME> likes ____, but only ironically."}
# 1305: {active: 1, play: 1, text:"Equius beats up Eridan for ____."}
# 1306: {active: 1, play: 1, text:"Feferi secretly hates ____."}
# 1307: {active: 1, play: 1, text:"For <NAME>'s latest ad campaign/brainwashing scheme, she is using ____ as inspiration."}
# 1308: {active: 1, play: 1, text:"For his birthday, <NAME> gave <NAME> ____."}
# 1309: {active: 1, play: 1, text:"Fuckin' ____. How do they work?"}
# 1310: {active: 1, play: 1, text:"<NAME> not only likes using his clubs for juggling and strifing, he also uses them for____."}
# 1311: {active: 1, play: 1, text:"Getting a friend to read Homestuck is like ____."}
# 1312: {active: 1, play: 1, text:"How do I live without ____?"}
# 1313: {active: 1, play: 2, text:"<NAME> died on his quest bed and rose as the fully realized ____ of ____."}
# 1314: {active: 1, play: 2, text:"<NAME>uss<NAME> unintentionally revealed that Homestuck will end with ____ and ____ consummating their relationship at last."}
# 1315: {active: 1, play: 1, text:"I am ____. It's me."}
# 1316: {active: 1, play: 1, text:"I finally became Tumblr famous when I released a gifset of ____."}
# 1317: {active: 1, play: 1, text:"I just found ____ in my closet it is like fucking christmas up in here."}
# 1318: {active: 1, play: 1, text:"I warned you about ____, bro! I told you, dog!"}
# 1319: {active: 1, play: 1, text:"In the final battle, <NAME> distracts Lord English by showing him ____."}
# 1320: {active: 1, play: 1, text:"It's hard, being ____. It's hard and no one understands."}
# 1321: {active: 1, play: 1, text:"<NAME> is a good boy. And he loves ____."}
# 1322: {active: 1, play: 1, text:"<NAME> may not be a homosexual, but he has a serious thing for ____."}
# 1323: {active: 1, play: 1, text:"Kanaya reached into her dead lusus's stomach and retrieved ____."}
# 1324: {active: 1, play: 1, text:"Kanaya tells Karkat about ____ to cheer him up."}
# 1325: {active: 1, play: 1, text:"Karkat gave our universe ____."}
# 1326: {active: 1, play: 1, text:"<NAME> and <NAME> have decided to teach <NAME>ri about the wonders of ____."}
# 1327: {active: 1, play: 1, text:"Little did they know, the key to defeating Lord English was actually ____."}
# 1328: {active: 1, play: 1, text:"Little known fact: <NAME>'s stitching is actually made out of ____."}
# 1329: {active: 1, play: 1, text:"<NAME> baked a cake for <NAME> to commemorate ____."}
# 1330: {active: 1, play: 1, text:"<NAME>ta only likes Karkat for his ____."}
# 1331: {active: 1, play: 2, text:"Nepeta's secret OTP is ____ with ____."}
# 1332: {active: 1, play: 1, text:"The next thing <NAME>ussie will turn into a sex joke will be ____."}
# 1333: {active: 1, play: 2, text:"Nobody was surprised to find ____ under Jade's skirt. The surprise was she used it for/on ____."}
# 1334: {active: 1, play: 1, text:"The only way to beat <NAME> in an eating contest is to put ____ on the table."}
# 1335: {active: 1, play: 1, text:"<NAME> made <NAME> a sweater to cover his ____."}
# 1336: {active: 1, play: 1, text:"Problem <NAME> had a hard time investigating ____."}
# 1337: {active: 1, play: 1, text:"The real reason <NAME> stabbed <NAME> was to punish her for ____."}
# 1338: {active: 1, play: 1, text:"Rose was rather disgusted when she started reading about ____."}
# 1339: {active: 1, play: 1, text:"The secret way to achieve God Tier is to die on top of ____."}
# 1340: {active: 1, play: 1, text:"<NAME>zi can top anyone except ____."}
# 1341: {active: 1, play: 1, text:"The thing that made <NAME> break his vow of celibacy was ____."}
# 1342: {active: 1, play: 1, text:"Turns out, pre-entry prototyping with ____ was not the best idea."}
# 1343: {active: 1, play: 1, text:"<NAME> killed <NAME>idermom with ____."}
# 1344: {active: 1, play: 2, text:"Vriska roleplays ____ with <NAME>erezi as ____."}
# 1345: {active: 1, play: 1, text:"Vriska's greatest regret is ____."}
# 1346: {active: 1, play: 2, text:"Wear ____. Be ____."}
# 1347: {active: 1, play: 1, text:"What did <NAME> get Dirk for his birthday?"}
# 1348: {active: 1, play: 1, text:"What is the worst thing that <NAME>zi ever licked?"}
# 1349: {active: 1, play: 1, text:"What makes your kokoro go 'doki doki'?"}
# 1350: {active: 1, play: 1, text:"What's in the box, <NAME>?"}
# 1351: {active: 1, play: 1, text:"When a bucket is unavailable, trolls with use ____."}
# 1352: {active: 1, play: 1, text:"When <NAME> received ____ from his Bro for his 9th birthday, be felt a little warm inside."}
# 1353: {active: 1, play: 1, text:"The hole in Kanaya's stomach is so large, she can fit ____ in it."}
# 1354: {active: 1, play: 1, text:"where doing it man. where MAKING ____ HAPEN!"}
# 1355: {active: 1, play: 1, text:"Your name is <NAME> and boy do you love ____!"}
# 1356: {active: 1, play: 1, text:"____. On the roof. Now."}
# 1357: {active: 1, play: 1, text:"____ totally makes me question my sexuality."}
# 1358: {active: 1, play: 1, text:"Whenever I see ____ on MSPARP, I disconnect immediately."}
# 1359: {active: 1, play: 1, text:"Calliborn wants you to draw pornography of ____."}
# 1360: {active: 1, play: 1, text:"They found some more last episodes! They were found in ____."}
# 1361: {active: 1, play: 1, text:"The Doctor did it! He saved the world again! This time using a ____."}
# 1362: {active: 1, play: 1, text:"I'd give up ____ to travel with The Doctor."}
# 1363: {active: 1, play: 1, text:"The next Doctor Who spin-off is going to be called ____."}
# 1364: {active: 1, play: 1, text:"Who should be the 13th Doctor?"}
# 1365: {active: 1, play: 1, text:"The Chameleon circuit is working again...somewhat. Instead of a phone booth, the TARDIS is now a ____."}
# 1366: {active: 1, play: 1, text:"Originally, the 50th special was going to have ____ appear, but the BBC decided against it in the end."}
# 1367: {active: 1, play: 1, text:"After we watch an episode, I've got some ____-flavored Jelly Babies to hand out."}
# 1368: {active: 1, play: 1, text:"Wibbly-wobbly, timey-wimey ____."}
# 1369: {active: 1, play: 1, text:"What's going to be The Doctor's new catchphrase?"}
# 1370: {active: 1, play: 1, text:"Bowties are ____."}
# 1371: {active: 1, play: 1, text:"Old and busted: EXTERMINATE! New hotness: ____."}
# 1372: {active: 1, play: 1, text:"There's a new dance on Gallifrey. It's called the ____."}
# 1373: {active: 1, play: 1, text:"They announced a new LEGO Doctor Who game! Rumor has it that ____ is an unlockable character."}
# 1374: {active: 1, play: 1, text:"FUN FACT: The Daleks were originally shaped to look like ____."}
# 1375: {active: 1, play: 1, text:"At this new Doctor Who themed restaurant, you can get a free ____ if you can eat a plate of bangers and mash in under 3 minutes."}
# 1376: {active: 1, play: 1, text:"Who is going to be The Doctor's next companion?"}
# 1377: {active: 1, play: 1, text:"I think the BBC is losing it. They just released a Doctor Who themed ____."}
# 1378: {active: 1, play: 1, text:"It's a little known fact that if you send a ____ to the BBC, they will send you a picture of The Doctor."}
# 1379: {active: 1, play: 1, text:"I was ok with all the BAD WOLF graffiti, until someone wrote it on ____."}
# 1380: {active: 1, play: 1, text:"<NAME>, I can't leave you alone for a minute! I turn around and you're trying to seduce ____."}
# 1381: {active: 1, play: 1, text:"In all of space and time you decide that ____ is a good choice?!"}
# 1382: {active: 1, play: 1, text:"Adipose were thought to be made of fat, but are really made of ____."}
# 1383: {active: 1, play: 1, text:"I hear the next thing that will cause The Doctor to regenerate is ____."}
# 1384: {active: 1, play: 1, text:"Honey badger don't give a ____!"}
# 1385: {active: 1, play: 1, text:"My next video turorial covers ____."}
# 1386: {active: 1, play: 1, text:"We found a map <NAME>! A map to ____ Mountain!"}
# 1387: {active: 1, play: 1, text:"For the love of GOD, and all that is HOLY, ____!!"}
# 1388: {active: 1, play: 1, text:"The new Operating System will be called ____."}
# 1389: {active: 1, play: 2, text:"I used to be an adventurer like you, then I took a/an ____ in the ____."}
# 1390: {active: 1, play: 1, text:"You've got to check out ____ Fluxx!"}
# 1391: {active: 1, play: 1, text:"Call of Duty Modern Warfare 37: War of ____!"}
# 1392: {active: 1, play: 1, text:"In brightest day, in blackest night, no ____ shall escape my sight."}
# 1393: {active: 1, play: 1, text:"Yes, Mr. Death... I'll play you a game! But not chess! My game is ____."}
# 1394: {active: 1, play: 1, text:"I cannot preach hate and warfare when I am a disciple of ____."}
# 1395: {active: 1, play: 1, text:"With great power comes great ____."}
# 1396: {active: 1, play: 1, text:"Don't make me ____. You wouldn't like me when I'm ____."}
# 1397: {active: 1, play: 1, text:"Fighting a never-ending battle for truth, justice, and the American ____!"}
# 1398: {active: 1, play: 2, text:"Faster than a speeding ____! More powerful than a ____!"}
# 1399: {active: 1, play: 1, text:"Able to leap ____ in a single bound! "}
# 1400: {active: 1, play: 2, text:"Disguised as ____, mild-mannered ____. "}
# 1401: {active: 1, play: 1, text:"Patriotism doesn't automatically equal ____."}
# 1402: {active: 1, play: 1, text:"I'm loyal to nothing, General - except the ____."}
# 1403: {active: 1, play: 1, text:"Alright you Primitive Screwheads, listen up! You see this? This... is my ____!"}
# 1404: {active: 1, play: 1, text:"Shop smart. Shop ____."}
# 1405: {active: 1, play: 1, text:"Hail to the ____, baby."}
# 1406: {active: 1, play: 1, text:"Good. Bad. I'm the guy with the ____."}
# 1407: {active: 1, play: 1, text:"How will we stop an army of the dead at our castle walls?"}
# 1408: {active: 1, play: 1, text:"I seek The Holy ____."}
# 1409: {active: 1, play: 1, text:"I see you have the machine that goes ____."}
# 1410: {active: 1, play: 1, text:"Every sperm is ____."}
# 1411: {active: 1, play: 1, text:"An African or European ____?"}
# 1412: {active: 1, play: 1, text:"Well you can't expect to wield supreme executive power just 'cause some watery tart threw a ____ at you!"}
# 1413: {active: 1, play: 1, text:"'____!' 'It's only a model.'"}
# 1414: {active: 1, play: 1, text:"Good night. Sleep well. I'll most likely ____ you in the morning."}
# 1415: {active: 1, play: 1, text:"I am The Dread Pirate ____."}
# 1416: {active: 1, play: 2, text:"Do you want me to send you back to where you were, ____ in ____?"}
# 1417: {active: 1, play: 1, text:"I see ____ people"}
# 1418: {active: 1, play: 1, text:"____? We don't need no stinking ____!"}
# 1419: {active: 1, play: 1, text:"These aren't the ____ you're looking for."}
# 1420: {active: 1, play: 1, text:"We're gonna need a bigger ____."}
# 1421: {active: 1, play: 1, text:"Beavis and Butthead Do ____."}
# 1422: {active: 1, play: 1, text:"I, for one, welcome our new ____ overlords."}
# 1423: {active: 1, play: 2, text:"You know, there's a million fine looking women in the world, dude. But they don't all bring you ____ at work. Most of 'em just ____."}
# 1424: {active: 1, play: 1, text:"Teenage Mutant Ninja ____."}
# 1425: {active: 1, play: 1, text:"Achy Breaky ____."}
# 1426: {active: 1, play: 1, text:"I'm not a ____, but I play one on TV"}
# 1427: {active: 1, play: 3, text:"____'s latest music video features a dozen ____ on ____."}
# 1428: {active: 1, play: 1, text:"____. Like a boss!"}
# 1429: {active: 1, play: 3, text:"In Soviet ____, ____ ____s you."}
# 1430: {active: 1, play: 1, text:"____. It's not just for breakfast anymore."}
# 1431: {active: 1, play: 1, text:"____. It's what's for dinner!"}
# 1432: {active: 1, play: 1, text:"____. Part of this nutritious breakfast."}
# 1433: {active: 1, play: 1, text:"____. Breakfast of champions!"}
# 1434: {active: 1, play: 1, text:"Where's the beef?"}
# 1435: {active: 1, play: 1, text:"Oh my god! They killed ____!"}
# 1436: {active: 1, play: 1, text:"I am not fat! I'm just ____."}
# 1437: {active: 1, play: 1, text:"Two by two, hands of ____."}
# 1438: {active: 1, play: 2, text:"____ was sent to save ____."}
# 1439: {active: 1, play: 1, text:"The anxiously awaited new season of Firefly is rumoured to kick off with an action packed scene, featuring River Tam's amazing feats of ____!"}
# 1440: {active: 1, play: 2, text:"I swear by my pretty floral ____, I will ____ you."}
# 1441: {active: 1, play: 1, text:"Wendy's ____ & Juicy."}
# 1442: {active: 1, play: 2, text:"I HATE it when ____(s) crawl(s) up my ____!"}
# 1443: {active: 1, play: 2, text:"At ____, where every day is ____ day!"}
# 1444: {active: 1, play: 1, text:"____ at last! ____ at last! Thank God almighty, I'm ____ at last! "}
# 1445: {active: 1, play: 1, text:"I have a dream that one day this nation will rise up and live out the true meaning of its creed:"}
# 1446: {active: 1, play: 2, text:"This year's ____ guest of honour is ____."}
# 1447: {active: 1, play: 1, text:"This will be the greatest ____con ever!"}
# 1448: {active: 1, play: 2, text:"____ is the new ____."}
# 1449: {active: 1, play: 1, text:"Bitches LOVE ____!"}
# 1450: {active: 1, play: 1, text:"The only good ____ is a dead ____."}
# 1451: {active: 1, play: 2, text:"A vote for ____ is a vote for ____."}
# 1452: {active: 1, play: 1, text:"Thou shalt not____."}
# 1453: {active: 1, play: 1, text:"I am the King of ____!"}
# 1454: {active: 1, play: 1, text:"Team ____!"}
# 1455: {active: 1, play: 1, text:"We went to a workshop on tantric ____."}
# 1456: {active: 1, play: 1, text:"My safeword is ____."}
# 1457: {active: 1, play: 2, text:"I like ____, but ____ is a hard limit!"}
# 1458: {active: 1, play: 2, text:"I ____, therefore I ____."}
# 1459: {active: 1, play: 1, text:"Welcome to my secret lair. I call it The Fortress of ____."}
# 1460: {active: 1, play: 1, text:"These are my minions of ____!"}
# 1461: {active: 1, play: 1, text:"____ doesn't need to be judged right now."}
# 1462: {active: 1, play: 2, text:"____ is a terrible thing to do to the ____!"}
# 1463: {active: 1, play: 2, text:"____ & ____: Worst mods ever."}
# 1464: {active: 1, play: 1, text:"/____ all over this post."}
# 1465: {active: 1, play: 1, text:"/____ delicately from the butt."}
# 1466: {active: 1, play: 1, text:"/slides hand up your ____."}
# 1467: {active: 1, play: 1, text:"____ is not an island."}
# 1468: {active: 1, play: 1, text:"____ runs into the forest, screaming."}
# 1469: {active: 1, play: 1, text:"____ was better before the anon meme."}
# 1470: {active: 1, play: 1, text:"We'd love to have you at ____ Island!"}
# 1471: {active: 1, play: 1, text:"Bad news guys, my parents found that thread involving ____."}
# 1472: {active: 1, play: 1, text:"But what are your thoughts on ____?"}
# 1473: {active: 1, play: 1, text:"Chaos ensued when Wankgate banned ____."}
# 1474: {active: 1, play: 1, text:"Cute, fun and ____."}
# 1475: {active: 1, play: 1, text:"Does anyone ____? I feel like the only one."}
# 1476: {active: 1, play: 1, text:"Excuse me, but I identify as ____."}
# 1477: {active: 1, play: 1, text:"Great, another ____ event."}
# 1478: {active: 1, play: 1, text:"How can there be a group of people more ____ than us?"}
# 1479: {active: 1, play: 1, text:"How's my driving?"}
# 1480: {active: 1, play: 1, text:"I can only ____ if I feel a deep emotional connection."}
# 1481: {active: 1, play: 1, text:"I can't believe we just spent a whole page wanking about ____."}
# 1482: {active: 1, play: 1, text:"I have a PHD in ____."}
# 1483: {active: 1, play: 1, text:"I just benchpressed, like, 14 ____."}
# 1484: {active: 1, play: 1, text:"I predict ____ will close by the end of the year."}
# 1485: {active: 1, play: 2, text:"I randomly began to ____ and ____ came galloping up the stairs."}
# 1486: {active: 1, play: 1, text:"I see Wankgate's bitching about ____ again."}
# 1487: {active: 1, play: 1, text:"I'm literally shaking and ____ right now."}
# 1488: {active: 1, play: 1, text:"I'm married to ____ on the astral plane."}
# 1489: {active: 1, play: 1, text:"I'm really into ____, so please don't kinkshame."}
# 1490: {active: 1, play: 1, text:"I'm sad we lost ____ in the exodus from LJ to DW."}
# 1491: {active: 1, play: 1, text:"I'm starting a game where the characters are stuck in ____."}
# 1492: {active: 1, play: 1, text:"I'm taking commissions for ____!"}
# 1493: {active: 1, play: 1, text:"How dare you not warn for ____! Don't you know how triggering that is?"}
# 1494: {active: 1, play: 3, text:"In this world, sexual roles are divided into three categories: the ____, the ____, and the ____"}
# 1495: {active: 1, play: 1, text:"It's ____ o'clock."}
# 1496: {active: 1, play: 1, text:"ITT: ____."}
# 1497: {active: 1, play: 1, text:"Join my new game about ____!"}
# 1498: {active: 1, play: 1, text:"Keep fucking that ____."}
# 1499: {active: 1, play: 1, text:"Let me tell you about ____."}
# 1500: {active: 1, play: 1, text:"Log in and ____."}
# 1501: {active: 1, play: 2, text:"My favorite thread is the one where ____ has kinky sex with ____."}
# 1502: {active: 1, play: 2, text:"My headcanon is that ____ is ____."}
# 1503: {active: 1, play: 2, text:"My OTP: ____ x ____."}
# 1504: {active: 1, play: 2, text:"New game idea! You're kidnapped by ____ and forced into ____."}
# 1505: {active: 1, play: 1, text:"no actually i don't care at all, i don't even ____. :))))"}
# 1506: {active: 1, play: 1, text:"OMG you guys I have so many feels about ____!"}
# 1507: {active: 1, play: 2, text:"Only ____ would play from ____."}
# 1508: {active: 1, play: 1, text:"Raising money for ____! Please replurk!"}
# 1509: {active: 1, play: 1, text:"RPAnons made me ____."}
# 1510: {active: 1, play: 1, text:"SHUT UP ABOUT YOUR ____."}
# 1511: {active: 1, play: 1, text:"Signal boosting for ____!"}
# 1512: {active: 1, play: 2, text:"Since ____ is on hiatus, fans have migrated to ____."}
# 1513: {active: 1, play: 1, text:"Someone just stuck their head out of the window and screamed '____'s UP!'"}
# 1514: {active: 1, play: 1, text:"Someone left a ____ out in the rain."}
# 1515: {active: 1, play: 1, text:"That ____. You know, *that* one."}
# 1516: {active: 1, play: 1, text:"The ____ is happy."}
# 1517: {active: 1, play: 1, text:"The perfect username for my next character: ____."}
# 1518: {active: 1, play: 1, text:"The thing I hate most about RP is ____."}
# 1519: {active: 1, play: 1, text:"Their ____ are of age."}
# 1520: {active: 1, play: 1, text:"There are too many memes about ____."}
# 1521: {active: 1, play: 1, text:"There is no ____ in Holly Heights."}
# 1522: {active: 1, play: 1, text:"We need a new post. This one smells like ____."}
# 1523: {active: 1, play: 1, text:"Why was I asked for app revisions?"}
# 1524: {active: 1, play: 1, text:"Why was I banned?"}
# 1525: {active: 1, play: 1, text:"Who apps ____ to a sex game?"}
# 1526: {active: 1, play: 1, text:"Who should I play next?"}
# 1527: {active: 1, play: 1, text:"You can't fist ____."}
# 1528: {active: 1, play: 1, text:"You sound ____, tbh."}
# 1529: {active: 1, play: 1, text:"Azerbaijan, Land of ____."}
# 1530: {active: 1, play: 1, text:"There's rumours of a country buying votes with ____."}
# 1531: {active: 1, play: 3, text:"Your ideal interval act."}
# 1532: {active: 1, play: 2, text:"This performance contains flashing images, ____ and ____."}
# 1533: {active: 1, play: 2, text:"Serbia entered magical girls. How horribly will their contract end?"}
# 1534: {active: 1, play: 2, text:"HELLO EUROPE, ____ CALLING! 12 POINTS GO TO ____!"}
# 1535: {active: 1, play: 1, text:"____. As guaranteed as Cyprus giving Greece 12 points."}
# 1536: {active: 1, play: 1, text:"Women kissing each other on stage, men kissing each other on stage, what next?"}
# 1537: {active: 1, play: 1, text:"<NAME> goes from Eurovision winner, to participant, to score reader. Her next job is ____."}
# 1538: {active: 1, play: 2, text:"The correct procedure for listening to Fairytale is:"}
# 1539: {active: 1, play: 1, text:"Nothing can bring down Ruslana's chippy mood,, not even ____."}
# 1540: {active: 1, play: 1, text:"<NAME>' chronic marrying spree added ____ to her victims list."}
# 1541: {active: 1, play: 1, text:"The BBC have decided to dig up another old relic and send ____ to represent the UK."}
# 1542: {active: 1, play: 1, text:"A (few) word(s) synonymous with Eurovision fans: ____"}
# 1543: {active: 1, play: 1, text:"<NAME> is a man of many talents; he wins Eurovisions and ____."}
# 1544: {active: 1, play: 1, text:"Misheard lyrics of Verjamem resulted in people thinking <NAME> Boto screeched ____."}
# 1545: {active: 1, play: 1, text:"This country has declined to participate due to ____."}
# 1546: {active: 1, play: 1, text:"I'm in loooooooove with a fairytaaaale, even thouuugh it ____."}
# 1547: {active: 1, play: 2, text:"In an attempt to foster friendly attitudes between ESC entrants, the host country made them ____ and ____."}
# 1548: {active: 1, play: 3, text:"The winning act had ____ and ____ as the singer belted out lyrics about ____."}
# 1549: {active: 1, play: 3, text:"Everybody out of the god damn way. You've got a heart full of ____, a soul full of ____, and a body full of ____."}
# 1550: {active: 1, play: 1, text:"____ would be a good name for a band."}
# 1551: {active: 1, play: 1, text:"____ wouldn't be funny if not for the irony."}
# 1552: {active: 1, play: 1, text:"Help, I'm trapped in a ____ factory!"}
# 1553: {active: 1, play: 1, text:"None of the places I floated to had ____."}
# 1554: {active: 1, play: 1, text:"____. My normal method is useless here."}
# 1555: {active: 1, play: 1, text:"We had a ____ party, but it turned out not to be very much fun."}
# 1556: {active: 1, play: 1, text:"My hobby: ____."}
# 1557: {active: 1, play: 1, text:"____ makes terrible pillow talk."}
# 1558: {active: 1, play: 1, text:"What is the best way to protect yourself from Velociraptors?"}
# 1559: {active: 1, play: 1, text:"I'm pretty sure you can't send ____ through the mail."}
# 1560: {active: 1, play: 1, text:"I'm like ____, except with love."}
# 1561: {active: 1, play: 3, text:"Spoiler Alert! ____ kills ____ with ____!"}
# 1562: {active: 1, play: 2, text:"I didn't actually want you to be ____; I just wanted you to be ____."}
# 1563: {active: 1, play: 1, text:"Do you really expect ____? No, <NAME>. I expect you to die!"}
# 1564: {active: 1, play: 1, text:"What do we miss most from the internet in 1998?"}
# 1565: {active: 1, play: 1, text:"All of my algorithms were really just disguised ____."}
# 1566: {active: 1, play: 1, text:"Waking up would be a lot easier if ____ didn't look so much like you."}
# 1567: {active: 1, play: 1, text:"____? No, I'm not really into Pokémon."}
# 1568: {active: 1, play: 2, text:"I got a lot more interested in ____ when I made the connection to ____."}
# 1569: {active: 1, play: 1, text:"Dreaming about ____ in Cirque du Soleil."}
# 1570: {active: 1, play: 1, text:"When I eat ____, I like to pretend I'm a Turing machine."}
# 1571: {active: 1, play: 1, text:"Freestyle rapping is really just ____."}
# 1572: {active: 1, play: 1, text:"It turns out God created the universe using ____."}
# 1573: {active: 1, play: 1, text:"Human intelligence decreases with increasing proximity to ____."}
# 1574: {active: 1, play: 2, text:"If I could rearrange the alphabet, I'd put ____ and ____ together."}
# 1575: {active: 1, play: 1, text:"The #1 Programmer's excuse for legitimately slacking off: ____."}
# 1576: {active: 1, play: 2, text:"I like alter songs by replacing ____ with ____."}
# 1577: {active: 1, play: 2, text:"Ebay review: Instead of ____, package contained ____. Would not buy again."}
# 1578: {active: 1, play: 1, text:"Social rule 99.1: If friends spend more than 60 minutes deciding what to do, they must default to ____."}
# 1579: {active: 1, play: 1, text:"____ linked to Acne! 95% confidence."}
# 1580: {active: 1, play: 1, text:"How many Google results are there for 'Died in a ____ accident?'"}
# 1581: {active: 1, play: 1, text:"Real Programmers use ____."}
# 1582: {active: 1, play: 1, text:"After finding Higgs-Boson, I can always use the LHC for ____."}
# 1583: {active: 1, play: 1, text:"My health declined when I realized I could eat ____ whenever I wanted."}
# 1584: {active: 1, play: 2, text:"____ is just applied ____."}
# 1585: {active: 1, play: 1, text:"What's my favorite unit of measurement?"}
# 1586: {active: 1, play: 1, text:"In the extended base metaphor, shortstop is ____."}
# 1587: {active: 1, play: 2, text:"I don't actually care about ____, I just like ____."}
# 1588: {active: 1, play: 1, text:"Why do you have a crossbow in your desk?"}
# 1589: {active: 1, play: 3, text:"I set up script to buy things on ebay for $1, but then it bought ____, ____, and ____."}
# 1590: {active: 1, play: 1, text:"I can extrude ____, but I can't retract it."}
# 1591: {active: 1, play: 2, text:"____'s fetish: ____."}
# 1592: {active: 1, play: 1, text:"Now I have to live my whole life pretending ____ never happened. It's going to be a fun 70 years."}
# 1593: {active: 1, play: 1, text:"My new favorite game is Strip ____."}
# 1594: {active: 1, play: 1, text:"Did you know you can just buy ____?"}
# 1595: {active: 1, play: 3, text:"Take me down to the ____, where the ____ is green and the ____ are pretty."}
# 1596: {active: 1, play: 1, text:"____. That's right. Shit just got REAL."}
# 1597: {active: 1, play: 1, text:"Just because I have ____ doesn't mean you could milk me now. I'd have to be lactating."}
# 1598: {active: 1, play: 1, text:"2009 called? Did you warn them about ____?"}
# 1599: {active: 1, play: 1, text:"I'm going to name my child ____."}
# 1600: {active: 1, play: 1, text:"3D printers sound great until you receive spam containing actual ____."}
# 1601: {active: 1, play: 2, text:"Until I see more data, I'm going to assume ____ causes ____."}
# 1602: {active: 1, play: 1, text:"Did you know November is ____ Awareness Month?"}
# 1603: {active: 1, play: 1, text:"University Researchers create life in lab! ____ blamed!"}
# 1604: {active: 1, play: 1, text:"If you really hate someone, teach them to recognize ____."}
# 1605: {active: 1, play: 1, text:"____. So it has come to this."}
# 1606: {active: 1, play: 1, text:"Hey baby, wanna come back to my sex ____?"}
# 1607: {active: 1, play: 2, text:"The past is a foreign country... with ____ and ____!"}
# 1608: {active: 1, play: 2, text:"What role has social media played in ____? Well, it's certainly made ____ stupider."}
# 1609: {active: 1, play: 1, text:"____. It works in Kerbal Space Program."}
# 1610: {active: 1, play: 1, text:"____ is too big for small talk."}
# 1611: {active: 1, play: 1, text:"What did I suggest to the IAU for a new planet name?"}
# 1612: {active: 1, play: 2, text:"By 2019, ____ will be outnumbered by ____."}
# 1613: {active: 1, play: 1, text:"New movie this summer: ____ beats up everyone."}
# 1614: {active: 1, play: 1, text:"Revealed: Why He Really Resigned! Pope Benedict's Secret Struggle with ____!"}
# 1615: {active: 1, play: 2, text:"Here's what you can expect for the new year. Out: ____. In: ____."}
# 1616: {active: 1, play: 2, text:"According to the Daleks, ____ is better at ____."}
# 1617: {active: 1, play: 1, text:"I can't believe Netflix is using ____ to promote House of Cards."}
# 1618: {active: 1, play: 1, text:"I'm not going to lie. I despise ____. There, I said it."}
# 1619: {active: 1, play: 1, text:"A wise man said, 'Everything is about sex. Except sex. Sex is about ____.'"}
# 1620: {active: 1, play: 1, text:"Our relationship is strictly professional. Let's not complicate things with ____."}
# 1621: {active: 1, play: 2, text:"Because you enjoyed ____, we thought you'd like ____."}
# 1622: {active: 1, play: 1, text:"We're not like other news organizations. Here at Slugline, we welcome ____ in the office. "}
# 1623: {active: 1, play: 1, text:"Cancel all my meetings. We've got a situation with ____ that requires my immediate attention."}
# 1624: {active: 1, play: 1, text:"If you need him to, <NAME> can pull some strings and get you ____, but it'll cost you."}
# 1625: {active: 1, play: 2, text:"Corruption. Betrayal. ____. Coming soon to Netflix, 'House of ____.'"}
# 1626: {active: 1, play: 1, text:"I filled my apartment with ____."}
# 1627: {active: 1, play: 2, text:"It's fun to mentally replace the word ____ with ____."}
# 1628: {active: 1, play: 1, text:"Next on GSN: 'The $100,000 ____.'"}
# 1629: {active: 1, play: 2, text:"Much ____. So ____. Wow."}
# 1630: {active: 1, play: 1, text:"<NAME> and <NAME> have panned ____ as 'poorly conceived' and 'sloppily executed.'"}
# 1631: {active: 1, play: 1, text:"Up next on Nickelodeon: 'Clarissa Explains ____.'"}
# 1632: {active: 1, play: 1, text:"How did <NAME> get her groove back?"}
# 1633: {active: 1, play: 1, text:"Believe it or not, <NAME> can do a dead-on impression of ____."}
# 1634: {active: 1, play: 1, text:"It's Morphin' Time! Mastadon! Pterodactyl! Triceratops! Sabertooth Tiger! ____!"}
# 1635: {active: 1, play: 1, text:"Tonight on SNICK: 'Are You Afraid of ____?'"}
# 1636: {active: 1, play: 1, text:"What the hell?! They added a 6/6 with flying, trample, and ____."}
# 1637: {active: 1, play: 1, text:"I'm a bitch, I'm a lover, I'm a child, I'm ____."}
# 1638: {active: 1, play: 1, text:"____ was totally worth the trauma."}
# 1639: {active: 1, play: 2, text:"Let me tell you about my new startup. It's basically ____, but for ____."}
# 1640: {active: 1, play: 1, text:"Unfortunately, Neo, no one can be told what ____ is. You have to see it for yourself."}
# 1641: {active: 1, play: 1, text:"(Heavy breathing) Luke, I am ____."}
# 1642: {active: 1, play: 1, text:"You think you have defeated me? Well, let's see how you handle ____!"}
# 1643: {active: 1, play: 2, text:"____ is way better in ____ mode."}
# 1644: {active: 1, play: 2, text:"Nickelodeon's next kids' game show is '____', hosted by ____."}
# 1645: {active: 1, play: 1, text:"____ probably tastes better than Quiznos."}
# 1646: {active: 1, play: 1, text:"The Discovery Channel presents: ____ week."}
# 1647: {active: 1, play: 1, text:"Like ____, State Farm is there."}
# 1648: {active: 1, play: 1, text:"The Discovery Channel presents: ____ week."}
# 1649: {active: 1, play: 1, text:"Like ____, State Farm is there."}
# 1650: {active: 1, play: 1, text:"<NAME>'s little-known first show was called 'The Joy of ____.'"}
# 1651: {active: 1, play: 1, text:"During my first game of D&D, I accidentally summoned ____."}
# 1652: {active: 1, play: 2, text:"In <NAME>'s new movie, <NAME> discovers that ____ had really been ____ all along."}
# 1653: {active: 1, play: 1, text:"After <NAME>, <NAME> brought ____ to all the people of New Orleans."}
# 1654: {active: 1, play: 2, text:"<NAME>'s new three-hour action epic pits ____ against ____."}
# 1655: {active: 1, play: 1, text:"<NAME> enjoys ____ on his food."}
# 1656: {active: 1, play: 1, text:"My new favorite porn star is <NAME> '____' <NAME>."}
# 1657: {active: 1, play: 1, text:"In his newest and most difficult stunt, <NAME> must escape from ____."}
# 1658: {active: 1, play: 1, text:"Little Miss Muff<NAME> Sat on a tuffet, Eating her curds and ____."}
# 1659: {active: 1, play: 1, text:"My country, 'tis of thee, sweet land of ____."}
# 1660: {active: 1, play: 1, text:"<NAME> was ruined for me forever when my mom had to act out ____."}
# 1661: {active: 1, play: 1, text:"After the earthquake, <NAME> brought ____ to the people of Haiti."}
# 1662: {active: 1, play: 1, text:"This holiday season, <NAME> must overcome his fear of ____ to save Christmas."}
# 1663: {active: 1, play: 1, text:"<NAME> is ____."}
# 1664: {active: 1, play: 1, text:"Dogimo would give up ____ to type a six sentence paragraph in a thread."}
# 1665: {active: 1, play: 1, text:"We need to talk about your whole gallon of ____."}
# 1666: {active: 1, play: 2, text:"A mod war about ____ occurred during ____."}
# 1667: {active: 1, play: 2, text:"____ was banned from tinychat because of ____."}
# 1668: {active: 1, play: 1, text:"Roses and her hammer collection defeated an entire squadron of ____."}
# 1669: {active: 1, play: 1, text:"Yaar's mother is ____."}
# 1670: {active: 1, play: 1, text:"VS: Where the ____ happens!"}
# 1671: {active: 1, play: 1, text:"____? FRY. EYES."}
# 1672: {active: 1, play: 1, text:"I'm under the ____."}
# 1673: {active: 1, play: 1, text:"Alcoholic games of Clue® lead to ____."}
# 1674: {active: 1, play: 1, text:"In the final round of this year's Omegathon, Omeganauts must face off in a game of ____."}
# 1675: {active: 1, play: 1, text:"I don't know exactly how I got the PAX plague, but I suspect it had something to do with ____."}
# 1676: {active: 1, play: 1, text:"Call the law offices of <NAME>stein & Goldstein, because no one should have to tolerate ____ in the workplace."}
# 1677: {active: 1, play: 1, text:"To prepare for his upcoming role, <NAME> immersed himself in the world of ____."}
# 1678: {active: 1, play: 1, text:"As part of his daily regimen, <NAME> sets aside 15 minutes for ____."}
# 1679: {active: 1, play: 1, text:"As part of his contract, Prince won't perform without ____ in his dressing room."}
# 1680: {active: 1, play: 1, text:"____ caused Northernlion to take stupid damage."}
# 1681: {active: 1, play: 1, text:"____ Is the best item in The Binding of Isaac."}
# 1682: {active: 1, play: 1, text:"____ is the worst item in The Binding of Isaac."}
# 1683: {active: 1, play: 1, text:"____ is/are Northernlion's worst nightmare."}
# 1684: {active: 1, play: 1, text:"____: The Northernlion Story."}
# 1685: {active: 1, play: 1, text:"As always, I will ____ you next time!"}
# 1686: {active: 1, play: 2, text:"Lifetime® presents ____, the story of ____."}
# 1687: {active: 1, play: 1, text:"Dear <NAME>, I'm having some trouble with ____ and would like your advice."}
# 1688: {active: 1, play: 1, text:"Even ____ is/are better at video games than Northernlion."}
# 1689: {active: 1, play: 1, text:"Everything's coming up ____."}
# 1690: {active: 1, play: 1, text:"Finding something like ____ would turn this run around."}
# 1691: {active: 1, play: 1, text:"I don't even see ____ anymore; all I see are blondes, brunettes, redheads..."}
# 1692: {active: 1, play: 1, text:"I'm in the permanent ____ state."}
# 1693: {active: 1, play: 1, text:"If sloth ____ are wrong I don’t want to be right."}
# 1694: {active: 1, play: 1, text:"JSmithOTI: Total ____."}
# 1695: {active: 1, play: 1, text:"Northernlion's latest novelty Twitter account is @____."}
# 1696: {active: 1, play: 1, text:"<NAME> has been facing ridicule for calling ____ a rogue-like."}
# 1697: {active: 1, play: 1, text:"<NAME> always forgets the name of ____."}
# 1698: {active: 1, play: 1, text:"<NAME>'s refusal to Let's Play ____ was probably a good call."}
# 1699: {active: 1, play: 1, text:"Of all the things that <NAME> and <NAME> have in common, they bond together through their mutual love of ____."}
# 1700: {active: 1, play: 1, text:"Oh god, I can't believe we ate ____ at PAX."}
# 1701: {active: 1, play: 1, text:"One thing <NAME> was right about was ____."}
# 1702: {active: 1, play: 1, text:"Recently, <NAME>ion has felt woefully insecure due to ____."}
# 1703: {active: 1, play: 1, text:"The stream was going well until ____."}
# 1704: {active: 1, play: 1, text:"The Youtube chat proved ineffective, so instead we had to communicate via ____."}
# 1705: {active: 1, play: 1, text:"Whenever I ___, take a drink."}
# 1706: {active: 1, play: 1, text:"The only way NL is ever going to make it to Hell in Spelunky is by using ____."}
# 1707: {active: 1, play: 1, text:"Welcome back to The Binding of Isaac. Today's challenge run will be based on ____."}
# 1708: {active: 1, play: 1, text:"Fox would still be here if not for ____."}
# 1709: {active: 1, play: 3, text:"I wasn't even that drunk! I just had some ____, ____, and ____."}
# 1710: {active: 1, play: 1, text:"What does Alucard have nightmares about?"}
# 1711: {active: 1, play: 2, text:"I beat Blue Baby with only ____ and ____!"}
# 1712: {active: 1, play: 2, text:"Northernlion has alienated fans of ____ by calling them ____."}
# 1713: {active: 1, play: 2, text:"Northernlion was fired from his teaching job and had to flee South Korea after an incident involving ____ and ____."}
# 1714: {active: 1, play: 3, text:"My original species combines ____ and ____. It's called ____."}
# 1715: {active: 1, play: 1, text:"Don't slow down in East Cleveland or ____."}
# 1716: {active: 1, play: 1, text:"Grand Theft Auto™: ____."}
# 1717: {active: 1, play: 2, text:"____ and ____ are the new hot couple."}
# 1718: {active: 1, play: 1, text:"What will Xyzzy take over the world with?"}
# 1719: {active: 1, play: 1, text:"Who is GLaDOS's next test subject?"}
# 1720: {active: 1, play: 1, text:"The next Assassin's Creed game will take place in ____."}
# 1721: {active: 1, play: 2, text:"I wouldn't fuck ____ with ____'s dick."}
# 1722: {active: 1, play: 1, text:"In the next Punch Out!!, ____ will be the secret final boss."}
# 1723: {active: 1, play: 1, text:"<NAME> demands more ____ in StarCraft®."}
# 1724: {active: 1, play: 1, text:"To top One More Day, future comic writers will use ____ to break up a relationship."}
# 1725: active: 1, {play: 1, text:"The real reason MAGFest was ruined was ____."}
# 1726: {active: 1, play: 2, text:"For the next Anniversary event, the TGWTG producers must battle ____ to get ____."}
# 1727: {active: 1, play: 2, text:"I write slash fanfiction pairing ____ with ____."}
# 1728: {active: 1, play: 2, text:"Next time on Obscurus Lupa Presents: ' ____ IV: The Return of ____'."}
# 1729: {active: 1, play: 2, text:"Todd in the Shadows broke the Not a Rhyme button when the singer tried to rhyme ____ with ____."}
# 1730: {active: 1, play: 2, text:"Welshy is to ____ as Sad Panda is to ____."}
# 1731: {active: 1, play: 1, text:"What is hidden in Linkara's hat?"}
# 1732: {active: 1, play: 1, text:"What was the first sign that Linkara was turning evil?"}
# 1733: {active: 1, play: 1, text:"When interviewing Linkara, be sure to ask him about ____!"}
# 1734: {active: 1, play: 3, text:"Write Linkara's next storyline as a haiku."}
# 1735: {active: 1, play: 1, text:"The reason Linkara doesn't like milk in his cereal is ____."}
# 1736: {active: 1, play: 1, text:"The secret of Linkara's magic gun is ____."}
# 1737: {active: 1, play: 2, text:"I asked Linkara to retweet ____, but instead, he retweeted ____."}
# 1738: {active: 1, play: 2, text:"Linkara's next story arc will involve him defeating ____ with the power of ____."}
# 1739: {active: 1, play: 1, text:"Being fed up with reviewing lamps, what obscure topic did Linkara review next?"}
# 1740: {active: 1, play: 1, text:"Why does Linkara have all of those Cybermats?"}
# 1741: {active: 1, play: 1, text:"At his next con appearance, Linkara will cosplay as ____."}
# 1742: {active: 1, play: 1, text:"What does Linkara eat with his chicken strips?"}
# 1743: {active: 1, play: 2, text:"____ and ____ are in the worst comic Linkara ever read."}
# 1744: {active: 1, play: 1, text:"____ is the reason Linkara doesn't like to swear."}
# 1745: {active: 1, play: 1, text:"The only thing Linkara would sell his soul for is ____."}
# 1746: {active: 1, play: 1, text:"In a surprise twist, the villain of Linkara's next story arc turned out to be ____."}
# 1747: {active: 1, play: 1, text:"Linkara now prefers to say ____ in lieu of 'fuck'."}
# 1748: {active: 1, play: 1, text:"____ will be Linkara's next cosplay."}
# 1749: {active: 1, play: 1, text:"An intervention was staged for <NAME>ara after ____ was discovered in his hat."}
# 1750: {active: 1, play: 1, text:"<NAME>ara was shocked when he found out Insano was secretly ____."}
# 1751: {active: 1, play: 1, text:"Linkara's Yu-Gi-Oh deck is built up with nothing but ____."}
# 1752: {active: 1, play: 1, text:"Why was Radio Dead Air shut down this time?"}
# 1753: {active: 1, play: 1, text:"During his childhood, <NAME>í produced hundreds of paintings of ____."}
# 1754: {active: 1, play: 2, text:"Rumor has it that <NAME>'s favorite delicacy is ____ stuffed with ____."}
# 1755: {active: 1, play: 1, text:"____, by Bad Dragon™."}
# 1756: {active: 1, play: 2, text:"Arlo P. Arlo's newest weapon combines ____ and ____!"}
# 1757: {active: 1, play: 1, text:"____ is something else Diamanda Hagan has to live with every day."}
# 1758: {active: 1, play: 1, text:"As part of a recent promotion, Japanese KFCs are now dressing their Colonel Sanders statues up as ____."}
# 1759: {active: 1, play: 1, text:"<NAME> Tries ____."}
# 1760: {active: 1, play: 1, text:"Enemies of Diamanda Hagan have been known to receive strange packages filled with ____."}
# 1761: {active: 1, play: 1, text:"What else does Diamanda Hagan have to live with every day?"}
# 1762: {active: 1, play: 1, text:"What's the real reason nobody has ever played the TGWTG Panel Drinking Game?"}
# 1763: {active: 1, play: 1, text:"When <NAME> isn't talking he's ____."}
# 1764: {active: 1, play: 1, text:"<NAME>'s latest family film is about a young boy befriending ____."}
# 1765: {active: 1, play: 1, text:"What is moé?"}
# 1766: {active: 1, play: 2, text:"Make a yaoi shipping."}
# 1767: {active: 1, play: 3, text:"On a night out, Golby will traditionally get into a fight with a ____ then have sex with a ____ before complaining about a hangover from too much ____."}
# 1768: {active: 1, play: 1, text:"At the last PAX, <NAME> and <NAME> had ____ thrown at them during 'Opening Band'."}
# 1769: {active: 1, play: 1, text:"What did the commenters bitch about next to Doug?"}
# 1770: {active: 1, play: 1, text:"The RDA chat knew <NAME> was trolling them when he played ____."}
# 1771: {active: 1, play: 3, text:"Every weekend, Golby likes to ____ then ____ before finally ____."}
# 1772: {active: 1, play: 3, text:"Every weekend, Golby enjoys drinking ____ before getting into a fight with ____ and having sex with ____."}
# 1773: {active: 1, play: 1, text:"<NAME> the Condor often doesn't talk on skype because of ____."}
# 1774: {active: 1, play: 1, text:"<NAME> C<NAME>i most definitely enjoys ____."}
# 1775: {active: 1, play: 1, text:"It's DJ <NAME> in the hizouse, playing ____ all night long!"}
# 1776: {active: 1, play: 2, text:"____ + ____ = <NAME>."}
# 1777: {active: 1, play: 1, text:"____ was the first thing to go when Hagan took over the world."}
# 1778: {active: 1, play: 1, text:"What broke <NAME> this week?"}
# 1779: {active: 1, play: 1, text:"In his latest review, Phelous was killed by ____."}
# 1780: {active: 1, play: 1, text:"This weekend, the nation of Haganistan will once again commence its annual celebration of ____. "}
# 1781: {active: 1, play: 1, text:"What is the real reason Demo Reel failed?"}
# 1782: {active: 1, play: 1, text:"To troll the RDA chat this time, <NAME> requested a song by ____."}
# 1783: {active: 1, play: 1, text:"<NAME> knew he didn't have a chance after trying to seduce Lupa with ____."}
# 1784: {active: 1, play: 1, text:"Turns out, that wasn't tea in MikeJ's cup, it was ____."}
# 1785: {active: 1, play: 1, text:"Viewers were shocked when <NAME>aw declared ____ the best song of the movie."}
# 1786: {active: 1, play: 1, text:"Well, I've read enough fanfic about ____ and Lupa to last a lifetime."}
# 1787: {active: 1, play: 1, text:"What does <NAME> like to sing about?"}
# 1788: {active: 1, play: 1, text:"What does <NAME> look like under his mask?"}
# 1789: {active: 1, play: 1, text:"What will <NAME> name her next hippo?"}
# 1790: {active: 1, play: 1, text:"Cindi suddenly turned into Steven after ____."}
# 1791: {active: 1, play: 1, text:"In the latest chapter of Toriko, our hero hunts down, kills, and eats a creature made entirely of ____."}
# 1792: {active: 1, play: 1, text:"The rarest Pokémon in my collection is ____."}
# 1793: {active: 1, play: 1, text:"Mamoru Oshii's latest film is a slow-paced, two hour-long cerebral piece about the horrors of ____."}
# 1794: {active: 1, play: 1, text:"The next big Tokusatsu show: 'Super Sentai ____ Ranger!'"}
# 1795: {active: 1, play: 1, text:"In the latest chapter of Golgo 13, he kills his target with ____."}
# 1796: {active: 1, play: 3, text:"In the latest episode of Case Closed, Conan deduces that it was ____ who killed ____ because of ____."}
# 1797: {active: 1, play: 1, text:"Behold the name of my Zanpakuto, ____!"}
# 1798: {active: 1, play: 1, text:"What do <NAME> and <NAME> like to do after a long day?"}
# 1799: {active: 1, play: 1, text:"Yoko Kanno's latest musical score features a song sung entirely by ____."}
# 1800: {active: 1, play: 1, text:"Who placed first in the most recent Shonen Jump popularity poll?"}
# 1801: {active: 1, play: 3, text:"In this episode of Master Ke<NAME>, Keaton builds ____ out of ____ and ____."}
# 1802: {active: 1, play: 1, text:"So just who is this <NAME> fellow, anyway?"}
# 1803: {active: 1, play: 1, text:"When <NAME> is alone and thinks that no one's looking, he secretly enjoys ____."}
# 1804: {active: 1, play: 1, text:"In her newest review, <NAME> finds herself in the body of ____."}
# 1805: {active: 1, play: 1, text:"<NAME>'s nickname for <NAME>'s older brother is ____."}
# 1806: {active: 1, play: 2, text:"____ has won the national Equestrian award for ____."}
# 1807: {active: 1, play: 1, text:"Every Morning, <NAME> Rises ____."}
# 1808: {active: 1, play: 1, text:"<NAME> was shocked to find ____ in her mailbox."}
# 1809: {active: 1, play: 1, text:"<NAME> didn't help in the fight against Chrysalis because she was too busy with ____."}
# 1810: {active: 1, play: 1, text:"Not many people know that <NAME> is also the voice of ____."}
# 1811: {active: 1, play: 1, text:"Everypony was shocked to discover that Scootaloo's cutie mark was ____."}
# 1812: {active: 1, play: 3, text:"In a fit of rage, <NAME> Cele<NAME> sent ____ to the ____ for ____."}
# 1813: {active: 1, play: 1, text:"<NAME>ville was shocked to discover ____ in Fluttershy's shed."}
# 1814: {active: 1, play: 1, text:"Prince Blueblood's cutie mark represents ____."}
# 1815: {active: 1, play: 1, text:"Rainbow Dash has always wanted ____."}
# 1816: {active: 1, play: 1, text:"Rainbow Dash is the only pony in all of Equestria who can ____."}
# 1817: {active: 1, play: 1, text:"Rainbow Dash received a concussion after flying into ____."}
# 1818: {active: 1, play: 1, text:"Super Speedy ____ Squeezy 5000."}
# 1819: {active: 1, play: 1, text:"Surprisingly, Canterlot has a museum of ____."}
# 1820: {active: 1, play: 1, text:"The Everfree forest is full of ____."}
# 1821: {active: 1, play: 1, text:"The national anthem of Equestria is ____."}
# 1822: {active: 1, play: 1, text:"The only way to get Opal in the bath is with ____."}
# 1823: {active: 1, play: 2, text:"The worst mishap caused by <NAME> was when she made ____ and ____ fall in love."}
# 1824: {active: 1, play: 1, text:"To much controversy, <NAME> made ____ illegal."}
# 1825: {active: 1, play: 2, text:"Today, <NAME> announced her official campaign position on ____ and ____. No pony was the least bit surprised."}
# 1826: {active: 1, play: 1, text:"Twilight got bored with the magic of friendship, and now studies the magic of ____."}
# 1827: {active: 1, play: 1, text:"Twilight Sparkle owns far more books on ____ than she'd like to admit."}
# 1828: {active: 1, play: 1, text:"If <NAME> spoke, what would he talk about?"}
# 1829: {active: 1, play: 1, text:"Wake up, <NAME>. Wake up and ____."}
# 1830: {active: 1, play: 1, text:"Without any warning, Pinkie Pie burst into a song about ____."}
# 1831: {active: 1, play: 1, text:"You're a human transported to Equestria! The first thing you'd look for is ____."}
# 1832: {active: 1, play: 1, text:"As a way of apologizing for a poorly received episode, <NAME> promised to review ____."}
# 1833: {active: 1, play: 1, text:"<NAME> has a new dance move called ____."}
# 1834: {active: 1, play: 1, text:"Even <NAME> thinks ____ is pretentious."}
# 1835: {active: 1, play: 1, text:"Here There Be ____."}
# 1836: {active: 1, play: 1, text:"Hey kids, I'm <NAME>, and I couldn't make ____ up if I tried."}
# 1837: {active: 1, play: 1, text:"Hey <NAME>, whatcha playin'?"}
# 1838: {active: 1, play: 1, text:"How is <NAME> going to creep out Ask That Guy this time? "}
# 1839: {active: 1, play: 1, text:"In his most recent Avatar vlog, <NAME>'s favorite thing about the episode was ____."}
# 1840: {active: 1, play: 1, text:"In the newest Cheap Damage, CR looks at the trading card game version of ____."}
# 1841: {active: 1, play: 1, text:"<NAME> almost named his show <NAME>enegade ____."}
# 1842: {active: 1, play: 1, text:"<NAME> proved he was still part of the site by____."}
# 1843: {active: 1, play: 1, text:"On the next WTFIWWY, Nash will give us a brief history of ____."}
# 1844: {active: 1, play: 1, text:"The last time Welshy and Film Brain were in a room together, they ended up ____."}
# 1845: {active: 1, play: 1, text:"This week, Nash's beer is made with ____."}
# 1846: {active: 1, play: 1, text:"What did <NAME>oug bring to the set of To Boldly Flee?"}
# 1847: {active: 1, play: 1, text:"What does Ven have to do now?"}
# 1848: {active: 1, play: 1, text:"What hot, trendy new dance will feature in Paw's next Dance Spectacular?"}
# 1849: {active: 1, play: 1, text:"What is Snowflame's only known weakness?"}
# 1850: {active: 1, play: 1, text:"What new upgrade did Nash give Laura?"}
# 1851: {active: 1, play: 1, text:"What will Nash try to kill next with his hammer?"}
# 1852: {active: 1, play: 1, text:"When <NAME> Orc turns into a werewolf, he likes to snack on ____."}
# 1853: {active: 1, play: 1, text:"When not reviewing or ruling Haganistan with an iron fist, Hagan's hobby is ____."}
# 1854: {active: 1, play: 1, text:"Who REALLY called <NAME> to help him snap out of his ennui?"}
# 1855: {active: 1, play: 1, text:"Whose ass did <NAME> kick this time?"}
# 1856: {active: 1, play: 1, text:"Why did <NAME> go to Chicago?"}
# 1857: {active: 1, play: 1, text:"Why doesn't <NAME> ever attend MAGFest?"}
# 1858: {active: 1, play: 1, text:"Why doesn't <NAME>m Brain have an actual reviewer costume?"}
# 1859: {active: 1, play: 2, text:"The MAGFest Nerf War took a dark turn when ____ was waylaid by ____."}
# 1860: {active: 1, play: 2, text:"For a late night snack, <NAME> made a sandwich of ____ and ____."}
# 1861: {active: 1, play: 2, text:"At ConBravo, ____ will be hosting a panel on ____."}
# 1862: {active: 1, play: 2, text:"Sad Panda is actually ____ and ____."}
# 1863: {active: 1, play: 2, text:"After ____, Phelous regenerated into ____. "}
# 1864: {active: 1, play: 1, text:"The stream broke when Ryuka stepped on the ____ key."}
# 1865: {active: 1, play: 1, text:"Krazy M<NAME> lost to ____!"}
# 1866: {active: 1, play: 1, text:"What would you do if <NAME>hm really did just die?"}
# 1867: {active: 1, play: 1, text:"JSmithOTI is referred to as a Scumlord, but his friends call him ____."}
# 1868: {active: 1, play: 1, text:"Follow MichaelALFox on Twitter and you can see pictures of ____."}
# 1869: {active: 1, play: 1, text:"After Mars, ____ is the next furthest planet from the sun."}
# 1870: {active: 1, play: 1, text:"What would <NAME>hm do?"}
# 1871: {active: 1, play: 1, text:"Northernlion's cat Ryuka is known for ____ while he records."}
# 1872: {active: 1, play: 1, text:"What gave <NAME>w<NAME>cker his gaming powers?"}
# 1873: {active: 1, play: 2, text:"It's true that Green9090 is ____, but we must all admit that <NAME>hm is better at ____"}
# 1874: {active: 1, play: 2, text:"Today on Crusader Kings 2, NL plays King ____ the ____."}
# 1875: {active: 1, play: 2, text:"After winning yet another race, <NAME> made ____ tweet about ____."}
# 1876: {active: 1, play: 1, text:"What can be found in Arin's chins?"}
# 1877: {active: 1, play: 1, text:"What do <NAME>umbo's magic words mean?"}
# 1878: {active: 1, play: 1, text:"What's better than Skyward Sword?"}
# 1879: {active: 1, play: 1, text:"What's the real reason <NAME> left?"}
# 1880: {active: 1, play: 1, text:"Who replaced <NAME> when he left GameGrumps?"}
# 1881: {active: 1, play: 1, text:"Why is Steam Train so controversial?"}
# 1882: {active: 1, play: 1, text:"This time on Guest Grumps, we have ____."}
# 1883: {active: 1, play: 1, text:"Top five games, go! 1? Mega Man X. 2-5? ____."}
# 1884: {active: 1, play: 1, text:"Next time on Game Grumps, ____!"}
# 1885: {active: 1, play: 1, text:"<NAME> and <NAME> suck at ____."}
# 1886: {active: 1, play: 1, text:"<NAME> and <NAME> win! They realize ____ is more important."}
# 1887: {active: 1, play: 1, text:"How many ____ does Mega Man get?"}
# 1888: {active: 1, play: 1, text:"Game Grumps: sponsored by ____."}
# 1889: {active: 1, play: 1, text:"____. Put that in, <NAME>."}
# 1890: {active: 1, play: 1, text:"'These new ____ t-shirts are gonna change some lives, <NAME>.'"}
# 1891: {active: 1, play: 1, text:"____ Grumps!"}
# 1892: {active: 1, play: 1, text:"____ is Jon's favorite video game of all time."}
# 1893: {active: 1, play: 1, text:"____ is not Jon's strong suit."}
# 1894: {active: 1, play: 2, text:"The Grumps' latest silly player names are ____ and ____."}
# 1895: {active: 1, play: 2, text:"In this corner, ____; in the other corner, ____; it's Game Grumps VS!"}
# 1896: {active: 1, play: 1, text:"____ is probably a Venusaur kind of guy."}
# 1897: {active: 1, play: 1, text:"If <NAME> was frog and you kissed him, what would he turn into?"}
# 1898: {active: 1, play: 1, text:"The next RvB cameo will be voiced by ____."}
# 1899: {active: 1, play: 1, text:"They questioned <NAME>'s sanity after finding ____ in his house."}
# 1900: {active: 1, play: 1, text:"What does <NAME>'s kid listen to?"}
# 1901: {active: 1, play: 1, text:"What makes <NAME> the angriest?"}
# 1902: {active: 1, play: 1, text:"What mysteries lie beyond <NAME>'s beard? "}
# 1903: {active: 1, play: 1, text:"What's in <NAME>avin's desk?"}
# 1904: {active: 1, play: 1, text:"Where does <NAME> belong?"}
# 1905: {active: 1, play: 1, text:"Why is <NAME> cool?"}
# 1906: {active: 1, play: 1, text:"Why was <NAME> screaming at <NAME>?"}
# 1907: {active: 1, play: 2, text:"Buzzfeed presents: 10 pictures of ____ that look like ____."}
}
| true | exports.numcards = !->
return Object.keys(exports.cards()).length
exports.getCard = (id) !->
return exports.cards()[id]
# New cards should be added/uncommented *after* the last uncommented card. That way, the
# plugin will automatically add the new cards to existing games.
exports.cards = !->
return {
1: {active: 1, play: 1, text:"Who stole the cookies from the cookie jar?"}
2: {active: 1, play: 1, text:"What is the next great Kickstarter project?"}
3: {active: 1, play: 1, text:"What's the next superhero?"}
4: {active: 1, play: 1, text:"____ 2012."}
5: {active: 1, play: 1, text:"____."}
6: {active: 1, play: 2, text:"Personals ad: Seeking a female who doesn't mind ____, might also be willing to try a male if they're ____."}
7: {active: 1, play: 1, text:"Why can't I sleep at night?"}
8: {active: 1, play: 1, text:"What's that smell?"}
9: {active: 1, play: 1, text:"What's that sound?"}
10: {active: 1, play: 1, text:"What ended my last relationship?"}
11: {active: 1, play: 1, text:"What is PI:NAME:<NAME>END_PI's guilty pleasure?"}
12: {active: 1, play: 1, text:"What's a girl's best friend?"}
13: {active: 1, play: 1, text:"What does PI:NAME:<NAME>END_PI prefer?"}
14: {active: 1, play: 1, text:"What's the most emo?"}
15: {active: 1, play: 1, text:"What are my parents hiding from me?"}
16: {active: 1, play: 1, text:"What will always get you laid?"}
17: {active: 1, play: 1, text:"What did I bring back from Mexico?"}
18: {active: 1, play: 1, text:"What don't you want to find in your Chinese food?"}
19: {active: 1, play: 1, text:"What will I bring back in time to convince people that I am a powerful wizard?"}
20: {active: 1, play: 1, text:"How am I maintaining my relationship status?"}
21: {active: 1, play: 1, text:"What gives me uncontrollable gas?"}
22: {active: 1, play: 1, text:"What do old people smell like? "}
23: {active: 1, play: 1, text:"What's my secret power?"}
24: {active: 1, play: 1, text:"What's there a ton of in heaven?"}
25: {active: 1, play: 1, text:"What would grandma find disturbing, yet oddly charming?"}
26: {active: 1, play: 1, text:"What did the U.S. airdrop to the children of Afghanistan?"}
27: {active: 1, play: 1, text:"What helps Obama unwind?"}
28: {active: 1, play: 1, text:"What did Vin Diesel eat for dinner?"}
29: {active: 1, play: 1, text:"Why am I sticky?"}
30: {active: 1, play: 1, text:"What gets better with age?"}
31: {active: 1, play: 1, text:"What's the crustiest?"}
32: {active: 1, play: 1, text:"What's Teach for America using to inspire inner city students to succeed?"}
33: {active: 1, play: 3, text:"Make a haiku."}
34: {active: 1, play: 1, text:"Why do I hurt all over?"}
35: {active: 1, play: 1, text:"What's my anti-drug?"}
36: {active: 1, play: 1, text:"What never fails to liven up the party?"}
37: {active: 1, play: 1, text:"What's the new fad diet?"}
38: {active: 1, play: 1, text:"I got 99 problems but ____ ain't one."}
39: {active: 1, play: 1, text:"TSA guidelines now prohibit ____ on airplanes."}
40: {active: 1, play: 1, text:"MTV's new reality show features eight washed-up celebrities living with ____."}
41: {active: 1, play: 1, text:"I drink to forget ____."}
42: {active: 1, play: 1, text:"I'm sorry, PI:NAME:<NAME>END_PI, but I couldn't complete my homework because of ____."}
43: {active: 1, play: 1, text:"During Picasso's often-overlooked Brown Period, he produced hundreds of paintings of ____."}
44: {active: 1, play: 1, text:"Alternative medicine is now embracing the curative powers of ____."}
45: {active: 1, play: 1, text:"Anthropologists have recently discovered a primitive tribe that worships ____."}
46: {active: 1, play: 1, text:"It's a pity that kids these days are all getting involved with ____."}
47: {active: 1, play: 1, text:"____. That's how I want to die."}
48: {active: 1, play: 1, text:"In the new Disney Channel Original Movie, PI:NAME:<NAME>END_PIana struggles with ____ for the first time."}
49: {active: 1, play: 1, text:"I wish I hadn't lost the instruction manual for ____."}
50: {active: 1, play: 1, text:"Instead of coal, Santa now gives the bad children ____."}
51: {active: 1, play: 1, text:"In 1,000 years, when paper money is but a distant memory, ____ will be our currency."}
52: {active: 1, play: 1, text:"A romantic, candlelit dinner would be incomplete without ____."}
53: {active: 1, play: 1, text:"Next from PI:NAME:<NAME>END_PI: PI:NAME:<NAME>END_PI and the Chamber of ____."}
54: {active: 1, play: 1, text:"____. Betcha can't have just one!"}
55: {active: 1, play: 1, text:"White people like ____."}
56: {active: 1, play: 1, text:"____. High five, bro."}
57: {active: 1, play: 1, text:"During sex, I like to think about ____."}
58: {active: 1, play: 1, text:"When I'm in prison, I'll have ____ smuggled in."}
59: {active: 1, play: 1, text:"When I am the President of the United States, I will create the Department of ____."}
60: {active: 1, play: 1, text:"Major League Baseball has banned ____ for giving players an unfair advantage."}
61: {active: 1, play: 1, text:"When I am a billionare, I shall erect a 50-foot statue to commemorate ____."}
62: {active: 1, play: 1, text:"____. It's a trap!"}
63: {active: 1, play: 1, text:"Coming to Broadway this season, ____: The Musical."}
64: {active: 1, play: 1, text:"Due to a PR fiasco, Walmart no longer offers ____."}
65: {active: 1, play: 1, text:"But before I kill you, Mr. PI:NAME:<NAME>END_PI, I must show you ____."}
66: {active: 1, play: 1, text:"When Pharaoh remained unmoved, PI:NAME:<NAME>END_PI called down a plague of ____."}
67: {active: 1, play: 1, text:"The class field trip was completely ruined by ____."}
68: {active: 1, play: 1, text:"In PI:NAME:<NAME>END_PI's final moments, he thought about ____."}
69: {active: 1, play: 1, text:"In an attempt to reach a wider audience, the Smithsonian Museum of Natural History has opened an interactive exhibit on ____."}
70: {active: 1, play: 1, text:"Studies show that lab rats navigate mazes 50% faster after being exposed to ____."}
71: {active: 1, play: 1, text:"I do not know with which weapons World War III will be fought, but World War IV will be fought with ____."}
72: {active: 1, play: 1, text:"Life was difficult for cavemen before ____."}
73: {active: 1, play: 1, text:"____: Good to the last drop."}
74: {active: 1, play: 1, text:"____: kid-tested, mother-approved."}
75: {active: 1, play: 2, text:"And the Academy Award for ____ goes to ____."}
76: {active: 1, play: 2, text:"For my next trick, I will pull ____ out of ____."}
77: {active: 1, play: 2, text:"____ is a slippery slope that leads to ____."}
78: {active: 1, play: 2, text:"In a world ravaged by ____, our only solace is ____."}
79: {active: 1, play: 2, text:"In his new summer comedy, PI:NAME:<NAME>END_PI is ____ trapped in the body of ____."}
80: {active: 1, play: 2, text:"I never truly understood ____ until I encountered ____."}
81: {active: 1, play: 2, text:"When I was tripping on acid, ____ turned into ____."}
82: {active: 1, play: 2, text:"That's right, I killed ____. How, you ask? ____."}
83: {active: 1, play: 3, text:"____ + ____ = ____."}
84: {active: 1, play: 1, text:"What is PI:NAME:<NAME>END_PI so curious about?"}
85: {active: 1, play: 1, text:"O Canada, we stand on guard for ____."}
86: {active: 1, play: 1, text:"Air Canada guidelines now prohibit ____ on airplanes."}
87: {active: 1, play: 1, text:"In an attempt to reach a wider audience, the Royal Ontario Museum has opened an interactive exhibit on ____."}
88: {active: 1, play: 2, text:"CTV presents ____, the story of ____."}
89: {active: 1, play: 1, text:"What's the Canadian government using to inspire rural students to succeed?"}
90: {active: 1, play: 1, text:"He who controls ____ controls the world."}
91: {active: 1, play: 1, text:"The CIA now interrogates enemy agents by repeatedly subjecting them to ____."}
92: {active: 1, play: 2, text:"Dear Sir or PI:NAME:<NAME>END_PI, We regret to inform you that the Office of ____ has denied your request for ____."}
93: {active: 1, play: 1, text:"In Rome, there are whisperings that the Vatican has a secret room devoted to ____."}
94: {active: 1, play: 1, text:"Science will never explain the origin of ____."}
95: {active: 1, play: 1, text:"When all else fails, I can always masturbate to ____."}
96: {active: 1, play: 1, text:"I learned the hard way that you can't cheer up a grieving friend with ____."}
97: {active: 1, play: 1, text:"In its new tourism campaign, PI:NAME:<NAME>END_PIroit proudly proclaims that it has finally eliminated ____."}
98: {active: 1, play: 2, text:"An international tribunal has found ____ guilty of ____."}
99: {active: 1, play: 1, text:"The socialist governments of Scandinavia have declared that access to ____ is a basic human right."}
100: {active: 1, play: 1, text:"In his new self-produced album, Kanye West raps over the sounds of ____."}
101: {active: 1, play: 1, text:"What's the gift that keeps on giving?"}
102: {active: 1, play: 1, text:"This season on Man vs. Wild, Bear Grylls must survive in the depths of the Amazon with only ____ and his wits."}
103: {active: 1, play: 1, text:"When I pooped, what came out of my butt?"}
104: {active: 1, play: 1, text:"In the distant future, historians will agree that ____ marked the beginning of America's decline."}
105: {active: 1, play: 2, text:"In a pinch, ____ can be a suitable substitute for ____."}
106: {active: 1, play: 1, text:"What has been making life difficult at the nudist colony?"}
107: {active: 1, play: 1, text:"What is the next big sideshow attraction?"}
108: {active: 1, play: 1, text:"Praise ____!"}
109: {active: 1, play: 2, text:"What's the next superhero/sidekick duo?"}
110: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI, why is PI:NAME:<NAME>END_PI crying?"}
111: {active: 1, play: 1, text:"And I would have gotten away with it, too, if it hadn't been for ____!"}
112: {active: 1, play: 1, text:"What brought the orgy to a grinding halt?"}
113: {active: 1, play: 1, text:"During his midlife crisis, my dad got really into ____."}
114: {active: 1, play: 2, text:"____ would be woefully incomplete without ____."}
115: {active: 1, play: 1, text:"Before I run for president, I must destroy all evidence of my involvement with ____."}
116: {active: 1, play: 1, text:"This is your captain speaking. Fasten your seatbelts and prepare for ____."}
117: {active: 1, play: 1, text:"The Five Stages of Grief: denial, anger, bargaining, ____, acceptance."}
118: {active: 1, play: 2, text:"My mom freaked out when she looked at my browser history and found ____.com/____."}
119: {active: 1, play: 3, text:"I went from ____ to ____, all thanks to ____."}
120: {active: 1, play: 1, text:"Members of New York's social elite are paying thousands of dollars just to experience ____."}
121: {active: 1, play: 1, text:"This month's Cosmo: 'Spice up your sex life by bringing ____ into the bedroom.'"}
122: {active: 1, play: 2, text:"If God didn't want us to enjoy ____, he wouldn't have given us ____."}
123: {active: 1, play: 1, text:"After months of debate, the Occupy Wall Street General Assembly could only agree on 'More ____!'"}
124: {active: 1, play: 2, text:"I spent my whole life working toward ____, only to have it ruined by ____."}
125: {active: 1, play: 1, text:"Next time on Dr. PI:NAME:<NAME>END_PI: How to talk to your child about ____."}
126: {active: 1, play: 1, text:"Only two things in life are certain: death and ____."}
127: {active: 1, play: 1, text:"Everyone down on the ground! We don't want to hurt anyone. We're just here for ____."}
128: {active: 1, play: 1, text:"The healing process began when I joined a support group for victims of ____."}
129: {active: 1, play: 1, text:"The votes are in, and the new high school mascot is ____."}
130: {active: 1, play: 2, text:"Before ____, all we had was ____."}
131: {active: 1, play: 1, text:"Tonight on 20/20: What you don't know about ____ could kill you."}
132: {active: 1, play: 2, text:"You haven't truly lived until you've experienced ____ and ____ at the same time."}
133: {active: 1, play: 1, text:"____? There's an app for that."}
134: {active: 1, play: 1, text:"Maybe she's born with it. Maybe it's ____."}
135: {active: 1, play: 1, text:"In L.A. County Jail, word is you can trade 200 cigarettes for ____."}
136: {active: 1, play: 1, text:"Next on ESPN2, the World Series of ____."}
137: {active: 1, play: 2, text:"Step 1: ____. Step 2: ____. Step 3: Profit."}
138: {active: 1, play: 1, text:"Life for American Indians was forever changed when the White Man introduced them to ____."}
139: {active: 1, play: 1, text:"On the third day of Christmas, my true love gave to me: three French hens, two turtle doves, and ____."}
140: {active: 1, play: 1, text:"Wake up, America. Christmas is under attack by secular liberals and their ____."}
141: {active: 1, play: 1, text:"Every Christmas, my uncle gets drunk and tells the story about ____."}
142: {active: 1, play: 1, text:"What keeps me warm during the cold, cold winter?"}
143: {active: 1, play: 1, text:"After blacking out during New Year's Eve, I was awoken by ____."}
144: {active: 1, play: 2, text:"____ Jesus is the Jesus of ____."}
145: {active: 1, play: 2, text:"____ ALL THE ____."}
146: {active: 1, play: 2, text:"There were A LOT of ____ doing ____."}
147: {active: 1, play: 1, text:"Simple dog ate and vomited ____."}
148: {active: 1, play: 1, text:"When I was 25, I won an award for ____."}
149: {active: 1, play: 1, text:"I'm more awesome than a T-rex because of ____."}
150: {active: 1, play: 1, text:"____ in my pants."}
151: {active: 1, play: 1, text:"Clean ALL the ____."}
152: {active: 1, play: 1, text:"The first rule of Jade Club is ____."}
153: {active: 1, play: 2, text:"The forum nearly broke when ____ posted ____ in The Dead Thread."}
154: {active: 1, play: 1, text:"No one likes me after I posted ____ in the TMI thread."}
155: {active: 1, play: 1, text:"____ for president!"}
156: {active: 1, play: 1, text:"I did ____, like a fucking adult."}
157: {active: 1, play: 2, text:"Domo travelled across ____ to win the prize of ____."}
158: {active: 1, play: 1, text:"After Blue posted ____ in chat, I never trusted his links again."}
159: {active: 1, play: 1, text:"Fuck you, I'm a ____."}
160: {active: 1, play: 1, text:"Cunnilungus and psychiatry brought us to ____."}
161: {active: 1, play: 2, text:"I CAN ____ ACROSS THE ____."}
162: {active: 1, play: 1, text:"____ is the only thing that matters."}
163: {active: 1, play: 1, text:"I'm an expert on ____."}
164: {active: 1, play: 1, text:"What can you always find in between the couch cushions?"}
165: {active: 1, play: 1, text:"I want ____ in my mouflon RIGHT MEOW."}
166: {active: 1, play: 1, text:"Don't get mad, get ____."}
167: {active: 1, play: 1, text:"Have fun, don't be ____."}
168: {active: 1, play: 1, text:"It's the end of ____ as we know it."}
169: {active: 1, play: 1, text:"____ is my worst habit."}
170: {active: 1, play: 1, text:"Everything's better with ____."}
171: {active: 1, play: 1, text:"What would you taste like?"}
172: {active: 1, play: 1, text:"What have you accomplished today?"}
173: {active: 1, play: 1, text:"What made you happy today?"}
174: {active: 1, play: 1, text:"Why are you frothing with rage?"}
175: {active: 1, play: 1, text:"What mildy annoyed you today?"}
176: {active: 1, play: 1, text:"We'll always have ____."}
177: {active: 1, play: 2, text:"____ uses ____. It is SUPER EFFECTIVE!"}
178: {active: 1, play: 1, text:"Let's all rock out to the sounds of ____."}
179: {active: 1, play: 1, text:"Take ____, it will last longer."}
180: {active: 1, play: 1, text:"You have my bow. AND MY ____."}
181: {active: 1, play: 2, text:"A wild ____ appeared! It used ____!"}
182: {active: 1, play: 2, text:"I thought being a ____ was the best thing ever, until I became a ____."}
183: {active: 1, play: 1, text:"Live long and ____."}
184: {active: 1, play: 1, text:"The victim was found with ____."}
185: {active: 1, play: 2, text:"If life gives you ____, make ____."}
186: {active: 1, play: 1, text:"Who needs a bidet when you have ____?"}
187: {active: 1, play: 1, text:"Kill it with ____!"}
188: {active: 1, play: 1, text:"My ____ is too big!"}
189: {active: 1, play: 3, text:"Best drink ever: One part ____, three parts ____, and a splash of ____."}
190: {active: 1, play: 1, text:"____ makes me uncomfortable."}
191: {active: 1, play: 1, text:"Stop, drop, and ____."}
192: {active: 1, play: 1, text:"Think before you ____."}
193: {active: 1, play: 2, text:"The hills are alive with ____ of ____."}
194: {active: 1, play: 1, text:"What is love without ____?"}
195: {active: 1, play: 2, text:"____ is the name of my ____ cover band."}
196: {active: 1, play: 1, text:"I have an idea even better than Kickstarter, and it's called ____starter."}
197: {active: 1, play: 1, text:"You have been waylaid by ____ and must defend yourself."}
198: {active: 1, play: 1, text:"Action stations! Action stations! Set condition one throughout the fleet and brace for ____!"}
199: {active: 1, play: 2, text:"____: Hours of fun. Easy to use. Perfect for ____!"}
200: {active: 1, play: 1, text:"Turns out that ____-Man was neither the hero we needed nor wanted."}
201: {active: 1, play: 1, text:"What left this stain on my couch?"}
202: {active: 1, play: 1, text:"A successful job interview begins with a firm handshake and ends with ____."}
203: {active: 1, play: 1, text:"Lovin' you is easy 'cause you're ____."}
204: {active: 1, play: 1, text:"Money can't buy me love, but it can buy me ____."}
205: {active: 1, play: 2, text:"Listen, son. If you want to get involved with ____, I won't stop you. Just steer clear of ____."}
206: {active: 1, play: 1, text:"During high school, I never really fit in until I found ____ club."}
207: {active: 1, play: 1, text:"Hey baby, come back to my place and I'll show you ____."}
208: {active: 1, play: 1, text:"Finally! A service that delivers ____ right to your door."}
209: {active: 1, play: 1, text:"My gym teacher got fired for adding ____ to the obstacle course."}
210: {active: 1, play: 2, text:"When you get right down to it, ____ is just ____."}
211: {active: 1, play: 1, text:"In the seventh circle of Hell, sinners must endure ____ for all eternity."}
212: {active: 1, play: 2, text:"After months of practice with ____, I think I'm finally ready for ____."}
213: {active: 1, play: 1, text:"The blind date was going horribly until we discovered our shared interest in ____."}
214: {active: 1, play: 1, text:"____. Awesome in theory, kind of a mess in practice."}
215: {active: 1, play: 2, text:"With enough time and pressure, ____ will turn into ____."}
216: {active: 1, play: 1, text:"I'm not like the rest of you. I'm too rich and busy for ____."}
217: {active: 1, play: 1, text:"And what did you bring for show and tell?"}
218: {active: 1, play: 2, text:"Having problems with ____? Try ____!"}
219: {active: 1, play: 1, text:"____.tumblr.com"}
220: {active: 1, play: 1, text:"What's the next Happy Meal toy?"}
221: {active: 1, play: 2, text:"My life is ruled by a vicious cycle of ____ and ____."}
222: {active: 1, play: 2, text:"After I saw ____, I needed ____."}
223: {active: 1, play: 1, text:"There's ____ in my soup."}
224: {active: 1, play: 1, text:"____ sounds like a great alternative rock band."}
225: {active: 1, play: 1, text:"____? Well, I won't look a gift horse in the mouth on that one."}
226: {active: 1, play: 1, text:"____. Everything else is uncivilized."}
227: {active: 1, play: 1, text:"'Hey everybody and welcome to Let's Look At ____!'"}
228: {active: 1, play: 1, text:"Best game of 2013? ____, of course."}
229: {active: 1, play: 1, text:"But that ____ has sailed."}
230: {active: 1, play: 1, text:"Fuck the haters, this is ____."}
231: {active: 1, play: 1, text:"Get in my ____ zone."}
232: {active: 1, play: 1, text:"How do you get your dog to stop humping your leg?"}
233: {active: 1, play: 1, text:"I can do ____ and die immediately afterward."}
234: {active: 1, play: 1, text:"Invaded the world of ____."}
235: {active: 1, play: 1, text:"It's ____, ya dangus!"}
236: {active: 1, play: 1, text:"Legend has it, the Thug of Porn was arrested for ____."}
237: {active: 1, play: 1, text:"Let's Look At: ____."}
238: {active: 1, play: 1, text:"More like the Duke of ____, right?"}
239: {active: 1, play: 1, text:"No one man should have all that ____."}
240: {active: 1, play: 1, text:"Only in Korea can you see ____."}
241: {active: 1, play: 1, text:"Praise the ____!"}
242: {active: 1, play: 1, text:"Roguelike? How about ___-like."}
243: {active: 1, play: 1, text:"Sometimes, a man's just gotta ____."}
244: {active: 1, play: 1, text:"The hero of the stream was ____."}
245: {active: 1, play: 1, text:"____? It's a DLC item."}
246: {active: 1, play: 1, text:"This new game is an interesting ____-like-like."}
247: {active: 1, play: 1, text:"We're rolling in ____!"}
248: {active: 1, play: 1, text:"Today's trivia topic is ____."}
249: {active: 1, play: 1, text:"What do you give to the CEO of Youtube as a gift?"}
250: {active: 1, play: 1, text:"Well there's nothing wrong with ____ by any stretch of the imagination."}
251: {active: 1, play: 1, text:"I'd sacrifice ____ at the Altar."}
252: {active: 1, play: 3, text:"The Holy Trinity: ____, ____, and ____!"}
253: {active: 1, play: 2, text:"____ was indicted on account of ____."}
254: {active: 1, play: 2, text:"____: The ____ Story."}
255: {active: 1, play: 2, text:"Hello everybody, welcome to a new episode of ____ plays ____."}
256: {active: 1, play: 1, text:"I've always wanted to become a voice actor, so I could play the role of ____."}
257: {active: 1, play: 1, text:"____. And now I'm bleeding."}
258: {active: 1, play: 1, text:"While the United States raced the Soviet Union to the moon, the Mexican government funneled millions of pesos into research on ____."}
259: {active: 1, play: 1, text:"My life for ____!"}
260: {active: 1, play: 1, text:"Who let the dogs out?"}
261: {active: 1, play: 1, text:"In his next movie, PI:NAME:<NAME>END_PI saves the world from ____."}
262: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI has revealed her new dress will be made of ____."}
263: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's new song is all about ____."}
264: {active: 1, play: 2, text:"The new fad diet is all about making people do ____ and eat ____."}
265: {active: 1, play: 1, text:"I whip my ____ back and forth."}
266: {active: 1, play: 1, text:"When North Korea gets ____, it will be the end of the world."}
267: {active: 1, play: 3, text:"Plan a three course meal."}
268: {active: 1, play: 1, text:"Tastes like ____."}
269: {active: 1, play: 1, text:"What is literally worse than Hitler?"}
270: {active: 1, play: 1, text:"____ ruined many people's childhood."}
271: {active: 1, play: 1, text:"Who needs college when you have ____."}
272: {active: 1, play: 1, text:"When short on money, you can always ____."}
273: {active: 1, play: 2, text:"The next pokemon will combine ____ and ____."}
274: {active: 1, play: 1, text:"Instead of playing Cards Against Humanity, you could be ____."}
275: {active: 1, play: 1, text:"One does not simply walk into ____."}
276: {active: 1, play: 1, text:"Welcome to my secret lair on ____."}
277: {active: 1, play: 1, text:"What is the answer to life's question?"}
278: {active: 1, play: 1, text:"I've got the whole world in my ____."}
279: {active: 1, play: 1, text:"I never thought ____ would be so enjoyable."}
280: {active: 1, play: 1, text:"In his second term, Obama will rid America of ____."}
281: {active: 1, play: 1, text:"What is Japan's national pastime?"}
282: {active: 1, play: 1, text:"Suck my ____."}
283: {active: 1, play: 1, text:"In the future, ____ will fuel our cars."}
284: {active: 1, play: 1, text:"The lion, the witch, and ____."}
285: {active: 1, play: 1, text:"In the next episode, PI:NAME:<NAME>END_PI gets introduced to ____. "}
286: {active: 1, play: 1, text:"____ Game of the Year Edition."}
287: {active: 1, play: 1, text:"What was going through Osama Bin Laden's head before he died?"}
288: {active: 1, play: 1, text:"In a news conference, Obama pulled out ____, to everyone's surprise."}
289: {active: 1, play: 1, text:"Nights filled with ____."}
290: {active: 1, play: 1, text:"If the anime industry is dying, what will be the final nail in it's coffin?"}
291: {active: 1, play: 2, text:"If a dog and a dolphin can get along, why not ____ and ____?"}
292: {active: 1, play: 2, text:"If I wanted to see ____, I'll stick with ____, thank you very much."}
293: {active: 1, play: 1, text:"Ladies and gentlemen, I give you ____... COVERED IN BEES!!!"}
294: {active: 1, play: 1, text:"Don't stand behind him, if you value your ____."}
295: {active: 1, play: 2, text:"Rock and Roll is nothing but ____ and the rage of ____!"}#
# 296: {active: 1, play: 1, text:"What the hell is 'Juvijuvibro'?!"}
# 297: {active: 1, play: 2, text:"When I was a kid, all we had in Lunchables were three ____ and ____."}
# 298: {active: 1, play: 2, text:"On its last dying breath, ____ sent out a cry for help. A bunch of ____ heard the cry."}
# 299: {active: 1, play: 1, text:"I also take ____ as payment for commissions."}
# 300: {active: 1, play: 1, text:"____ looks pretty in all the art, but have you seen one in real life?"}
# 301: {active: 1, play: 1, text:"How did I lose my virginity?"}
# 302: {active: 1, play: 1, text:"Here is the church, here is the steeple, open the doors, and there is ____."}
# 303: {active: 1, play: 1, text:"This is the way the world ends \ This is the way the world ends \ Not with a bang but with ____."}
# 304: {active: 1, play: 1, text:"In 1,000 years, when paper money is a distant memory, how will we pay for goods and services?"}
# 305: {active: 1, play: 1, text:"War! What is it good for?"}
# 306: {active: 1, play: 1, text:"What don't you want to find in your Kung Pao chicken?"}
# 307: {active: 1, play: 1, text:"The Smithsonian Museum of Natural History has just opened an exhibit on ____."}
# 308: {active: 1, play: 1, text:"At first I couldn't understand ____, but now it's my biggest kink."}
# 309: {active: 1, play: 1, text:"Long story short, I ended up with ____ in my ass."}
# 310: {active: 1, play: 1, text:"Don't knock ____ until you've tried it."}
# 311: {active: 1, play: 1, text:"Who knew I'd be able to make a living off of ____?"}
# 312: {active: 1, play: 1, text:"It's difficult to explain to friends and family why I know so much about ____."}
# 313: {active: 1, play: 1, text:"Once I started roleplaying ____, it was all downhill from there."}
# 314: {active: 1, play: 1, text:"____ are so goddamn cool."}
# 315: {active: 1, play: 1, text:"No, look, you don't understand. I REALLY like ____."}
# 316: {active: 1, play: 1, text:"I don't think my parents will ever accept that the real me is ____."}
# 317: {active: 1, play: 1, text:"I can't believe I spent most of my paycheck on ____."}
# 318: {active: 1, play: 2, text:"You can try to justify ____ all you want, but you don't have to be ____ to realize it's just plain wrong."}
# 319: {active: 1, play: 1, text:"I've been waiting all year for ____."}
# 320: {active: 1, play: 1, text:"I can't wait to meet up with my internet friends for ____."}
# 321: {active: 1, play: 3, text:"The next crossover will have ____ and ____ review ____."}
# 322: {active: 1, play: 1, text:"We all made a mistake when we ate ____ at MAGFest."}
# 323: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's next student film will focus on ____."}
# 324: {active: 1, play: 1, text:"____ will be the subject of the next TGWTG panel at MAGFest."}
# 325: {active: 1, play: 1, text:"WAIT! I have an idea! It involves using ____!"}
# 326: {active: 1, play: 1, text:"If you value your life, never mention ____ around Oancitizen."}
# 327: {active: 1, play: 2, text:"____ is only on the site because of ____."}
# 328: {active: 1, play: 2, text:"The newest fanfic trend is turning ____ into ____."}
# 329: {active: 1, play: 1, text:"Tom is good, but he's not ____ good."}
# 330: {active: 1, play: 1, text:"BENCH ALL THE ____."}
# 331: {active: 1, play: 1, text:"Hey guys, check out my ____ montage!"}
# 332: {active: 1, play: 1, text:"____ was completely avoidable!"}
# 333: {active: 1, play: 1, text:"____ will live!"}
# 334: {active: 1, play: 1, text:"____ should be on TGWTG."}
# 335: {active: 1, play: 1, text:"____! What are you doing here?"}
# 336: {active: 1, play: 1, text:"____! You know, for kids."}
# 337: {active: 1, play: 1, text:"I love ____. It's so bad."}
# 338: {active: 1, play: 1, text:"____. With onions."}
# 339: {active: 1, play: 1, text:"____ is the theme of this year's anniversary crossover."}
# 340: {active: 1, play: 1, text:"A ____ Credit Card!?"}
# 341: {active: 1, play: 3, text:"Fighting ____ by moonlight! Winning ____ by daylight! Never running from a real fight! She is the one named ____!"}
# 342: {active: 1, play: 1, text:"It's no secret. Deep down, everybody wants to fuck ____."}
# 343: {active: 1, play: 1, text:"Behold! My trap card, ____!"}
# 344: {active: 1, play: 1, text:"Blip checks are way smaller in January so I'll spend the month riffing on ____ to gain more views."}
# 345: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI still regrets the day he decided to do a Let's Play video for 'PI:NAME:<NAME>END_PI's ____ Adventure'."}
# 346: {active: 1, play: 1, text:"High and away on a wing and a prayer, who could it be? Believe it or not, it's just ____."}
# 347: {active: 1, play: 1, text:"I ____ so you don't have to."}
# 348: {active: 1, play: 1, text:"I AM THE VOICELESS. THE NEVER SHOULD. I AM ____."}
# 349: {active: 1, play: 1, text:"I prefer for MY exploitation films to have ____, thank you very much."}
# 350: {active: 1, play: 1, text:"I watch movies just to see if I can find a Big Lipped ____ Moment."}
# 351: {active: 1, play: 1, text:"I'm looking forward to Jesuotaku's playthrough of Fire Emblem: ____."}
# 352: {active: 1, play: 1, text:"After eating a Devil Fruit, I now have the power of ____."}
# 353: {active: 1, play: 1, text:"It was all going well until they found ____."}
# 354: {active: 1, play: 1, text:"JW confirms, you can play ____,"}
# 355: {active: 1, play: 1, text:"Next January, the Nostalgia Critic is doing ____ Month."}
# 356: {active: 1, play: 1, text:"No one wants to see your ____."}
# 357: {active: 1, play: 1, text:"Of Course! Don't you know anything about ____?"}
# 358: {active: 1, play: 1, text:"OH MY GOD THIS IS THE GREATEST ____ I'VE EVER SEEN IN MY LIFE!"}
# 359: {active: 1, play: 1, text:"On the other side of the Plot Hole, the Nostalgia Critic found ____."}
# 360: {active: 1, play: 1, text:"Reactions were mixed when ____ joined TGWTG."}
# 361: {active: 1, play: 1, text:"Sage has presented JO with the new ecchi series ____."}
# 362: {active: 1, play: 1, text:"Sean got his head stuck in ____."}
# 363: {active: 1, play: 1, text:"STOP OR I WILL ____."}
# 364: {active: 1, play: 1, text:"The invasion of Molassia was tragically thwarted by ____."}
# 365: {active: 1, play: 1, text:"The newest reviewer addition to the site specializes in ____."}
# 366: {active: 1, play: 1, text:"The next person to leave Channel Awesome will announce their departure via ____."}
# 367: {active: 1, play: 1, text:"The next Renegade Cut is about ____ in a beloved children's movie."}
# 368: {active: 1, play: 1, text:"The Nostalgia Critic will NEVER review ____."}
# 369: {active: 1, play: 1, text:"By far, the most mind-bogglingly awesome thing I've ever seen in anime is ____."}
# 370: {active: 1, play: 1, text:"My Little Sister Can't Be ____!"}
# 371: {active: 1, play: 1, text:"WE WERE FIGHTING LIKE ____."}
# 372: {active: 1, play: 1, text:"What doesn't go there?"}
# 373: {active: 1, play: 1, text:"What doesn't work that way?"}
# 374: {active: 1, play: 1, text:"What is in Sci Fi Guy's vest?"}
# 375: {active: 1, play: 1, text:"What the fuck is wrong with you?"}
# 376: {active: 1, play: 1, text:"What's holding up the site redesign?"}
# 377: {active: 1, play: 1, text:"What's really inside the Plot Hole?"}
# 378: {active: 1, play: 1, text:"What's up next on WTFIWWY?"}
# 379: {active: 1, play: 1, text:"When the JesuOtaku stream got to the 'awful part of the night,' the GreatSG video featured ____."}
# 380: {active: 1, play: 1, text:"Why can't Film Brain stop extending his final vowels?"}
# 381: {active: 1, play: 1, text:"90's Kid's favorite comic is ____."}
# 382: {active: 1, play: 1, text:"Because poor literacy is ____."}
# 383: {active: 1, play: 1, text:"He is a glitch. He is missing. He is ____."}
# 384: {active: 1, play: 1, text:"Of course! Don't you know anything about ___?"}
# 385: {active: 1, play: 1, text:"Snowflame feels no ____."}
# 386: {active: 1, play: 1, text:"Snowflame found a new love besides cocaine. What is it?"}
# 387: {active: 1, play: 1, text:"So let's dig into ____ #1."}
# 388: {active: 1, play: 1, text:"Where'd he purchase that?"}
# 389: {active: 1, play: 1, text:"When is the next History of Power Rangers coming out?"}
# 390: {active: 1, play: 1, text:"What is as low as the standards of the 90's Kid?"}
# 391: {active: 1, play: 1, text:"What delayed the next History of Power Rangers?"}
# 392: {active: 1, play: 1, text:"____ has the 'mount' keyword."}
# 393: {active: 1, play: 1, text:"You're so _____ I'll have to delete you."}
# 394: {active: 1, play: 1, text:"I got a new tattoo, it looks a bit like ____."}
# 395: {active: 1, play: 1, text:"What strange Korean delicacy will Mark enjoy today?"}
# 396: {active: 1, play: 1, text:"____ is camping my lane."}
# 397: {active: 1, play: 1, text:"The OGN was fun, but there was far too much ____ cosplay."}
# 398: {active: 1, play: 1, text:"'What are you thinking?' 'You know, ____ and stuff.'"}
# 399: {active: 1, play: 2, text:"Drunken games of Pretend You're Xyzzy lead to ____ and ____."}
# 400: {active: 1, play: 1, text:"Vegeta, what does the scouter say?"}
# 401: {active: 1, play: 1, text:"____. BELIEVE IT!"}
# 402: {active: 1, play: 1, text:"Make a contract with me, and become ____!"}
# 403: {active: 1, play: 1, text:"You guys are so wrong. Obviously, ____ is best waifu."}
# 404: {active: 1, play: 1, text:"THIS ____ HAS BEEN PASSED DOWN THE ARMSTRONG FAMILY LINE FOR GENERATIONS!!!"}
# 405: {active: 1, play: 2, text:"My favorite episode of ____ is the one with ____."}
# 406: {active: 1, play: 2, text:"This doujinshi I just bought has ____ and ____ getting it on, hardcore."}
# 407: {active: 1, play: 2, text:"On the next episode of Dragon Ball Z, ____ is forced to do the fusion dance with ____."}
# 408: {active: 1, play: 1, text:"You are already ____."}
# 409: {active: 1, play: 1, text:"Who the hell do you think I am?!"}
# 410: {active: 1, play: 1, text:"On the next episode of Dragon Ball Z, Goku has a fierce battle with ____."}
# 411: {active: 1, play: 1, text:"____. YOU SHOULD BE WATCHING."}
# 412: {active: 1, play: 1, text:"Most cats are ____."}
# 413: {active: 1, play: 2, text:"Fresh from Japan: The new smash hit single by ____ titled ____."}
# 414: {active: 1, play: 2, text:"____ vs. ____. BEST. FIGHT. EVER."}
# 415: {active: 1, play: 2, text:"So wait, ____ was actually ____? Wow, I didn't see that one coming!"}
# 416: {active: 1, play: 1, text:"Real men watch ____."}
# 417: {active: 1, play: 1, text:"When it comes to hentai, nothing gets me hotter than ____."}
# 418: {active: 1, play: 1, text:"Whenever I'm splashed with cold water, I turn into ____."}
# 419: {active: 1, play: 2, text:"No matter how you look at it, ultimately ____ is responsible for ____."}
# 420: {active: 1, play: 1, text:"S-Shut up!! I-It's not like I'm ____ or anything."}
# 421: {active: 1, play: 2, text:"The English dub of ____ sucks worse than ____."}
# 422: {active: 1, play: 1, text:"Congratulations, ____."}
# 423: {active: 1, play: 1, text:"By far the best panel at any anime convention is the one for ____."}
# 424: {active: 1, play: 1, text:"One thing you almost never see in anime is ____."}
# 425: {active: 1, play: 1, text:"What do I hate most about anime?"}
# 426: {active: 1, play: 1, text:"What do I love most about anime?"}
# 427: {active: 1, play: 1, text:"This morning, hundreds of Japanese otaku lined up outside their favorite store to buy the limited collector's edition of ____."}
# 428: {active: 1, play: 1, text:"Every now and then, I like to participate in the time-honored Japanese tradition of ____."}
# 429: {active: 1, play: 1, text:"There are guilty pleasures. And then there's ____."}
# 430: {active: 1, play: 1, text:"Watch it! Or I'll take your ____."}
# 431: {active: 1, play: 1, text:"New from Studio GAINAX: ____ the Animation."}
# 432: {active: 1, play: 1, text:"Using my power of Geass, I command you to do... THIS!"}
# 433: {active: 1, play: 1, text:"Chicks. Dig. ____. Nice."}
# 434: {active: 1, play: 1, text:"When it comes to Japanese cuisine, there's simply nothing better than ____."}
# 435: {active: 1, play: 1, text:"In the name of the moon, I will punish ____!"}
# 436: {active: 1, play: 3, text:"Just announced: The brand new anime adaptation of ____, starring ____ as the voice of ____."}
# 437: {active: 1, play: 1, text:"Don't worry, he's okay! He survived thanks to ____."}
# 438: {active: 1, play: 1, text:"____. Goddammit, Japan."}
# 439: {active: 1, play: 1, text:"Welcome home, PI:NAME:<NAME>END_PI! Is there anything your servant girl can bring you today?"}
# 440: {active: 1, play: 1, text:"I have never in my life laughed harder than the first time I watched ____."}
# 441: {active: 1, play: 1, text:"Take this! My love, my anger, and all of my ____!"}
# 442: {active: 1, play: 1, text:"Karaoke night! I'm totally gonna sing my favorite song, ____."}
# 443: {active: 1, play: 1, text:"Digimon! Digivolve to: ____-mon!"}
# 444: {active: 1, play: 1, text:"Now! Face my ultimate attack!"}
# 445: {active: 1, play: 3, text:"From the twisted mind of Nabeshin: An anime about ____, ____, and ____."}
# 446: {active: 1, play: 1, text:"____. Only on Toonami"}
# 447: {active: 1, play: 1, text:"I am in despair! ____ has left me in despair!"}
# 448: {active: 1, play: 2, text:"The new manga from ____ is about a highschool girl discovering ____."}
# 449: {active: 1, play: 1, text:"To save the world, you must collect all 7 ____."}
# 450: {active: 1, play: 1, text:"Sasuke has ____ implants."}
# 451: {active: 1, play: 1, text:"In truth, the EVA units are actually powered by the souls of ____."}
# 452: {active: 1, play: 3, text:"Dreaming! Don't give it up ____! Dreaming! Don't give it up ____! Dreaming! Don't give it up ____!"}
# 453: {active: 1, play: 1, text:"Lupin the III's latest caper involves him trying to steal ____."}
# 454: {active: 1, play: 1, text:"A piece of ____ is missing."}
# 455: {active: 1, play: 1, text:"At least he didn't fuck ____."}
# 456: {active: 1, play: 2, text:"Hello, and welcome to Atop ____, where ____ burns."}
# 457: {active: 1, play: 1, text:"No matter how I look at it, it's your fault I'm not ____!"}
# 458: {active: 1, play: 1, text:"Hello, I'm the Nostalgia Critic. I remember ____ so you don't have to!"}
# 459: {active: 1, play: 1, text:"Taking pride in one's collection of ____."}
# 460: {active: 1, play: 3, text:"If you are able to deflect ____ with ____, we refer to it as 'Frying ____'."}
# 461: {active: 1, play: 1, text:"They are the prey, and we are the ____."}
# 462: {active: 1, play: 1, text:"Did you hear about the guy that smuggled ____ into the hotel?"}
# 463: {active: 1, play: 1, text:"The new Gurren Lagann blurays from Aniplex will literally cost you ____."}
# 464: {active: 1, play: 1, text:"The most overused anime cliche is ____."}
# 465: {active: 1, play: 1, text:"The inspiration behind the latest hit show is ____."}
# 466: {active: 1, play: 1, text:"While writing Dragon Ball, PI:NAME:<NAME>END_PIama would occasionally take a break from working to enjoy ____."}
# 467: {active: 1, play: 1, text:"The show was great, until ____ showed up."}
# 468: {active: 1, play: 1, text:"Nothing ruins a good anime faster than ____."}
# 469: {active: 1, play: 1, text:"People die when they are ____."}
# 470: {active: 1, play: 2, text:"I want to be the very best, like no one ever was! ____ is my real test, ____ is my cause!"}
# 471: {active: 1, play: 1, text:"Okay, I'll admit it. I would totally go gay for ____."}
# 472: {active: 1, play: 2, text:"Who are you callin' ____ so short he can't see over his own ____?!?!"}
# 473: {active: 1, play: 1, text:"If you ask me, there need to be more shows about ____."}
# 474: {active: 1, play: 1, text:"____. That is the kind of man I was."}
# 475: {active: 1, play: 1, text:"I'm sorry! I'm sorry! I didn't mean to accidentally walk in on you while you were ____!"}
# 476: {active: 1, play: 2, text:"After a long, arduous battle, ____ finally met their end by ____."}
# 477: {active: 1, play: 1, text:"This is our final battle. Mark my words, I will defeat you, ____!"}
# 478: {active: 1, play: 1, text:"You used ____. It's super effective!"}
# 479: {active: 1, play: 1, text:"The best English dub I've ever heard is the one for ____."}
# 480: {active: 1, play: 1, text:"I know of opinions and all that, but I just don't understand how anyone could actually enjoy ____."}
# 481: {active: 1, play: 1, text:"____. HE DEDD."}
# 482: {active: 1, play: 1, text:"She'll thaw out if you try ____."}
# 483: {active: 1, play: 1, text:"You see, I'm simply ____."}
# 484: {active: 1, play: 1, text:"Truly and without question, ____ is the manliest of all men."}
# 485: {active: 1, play: 1, text:"WANTED: $50,000,000,000 reward for the apprehension of____."}
# 486: {active: 1, play: 1, text:"This year, I totally lucked out and found ____ in the dealer's room."}
# 487: {active: 1, play: 1, text:"How did I avoid your attack? Simple. By ____."}
# 488: {active: 1, play: 1, text:"If I was a magical girl, my cute mascot sidekick would be ____."}
# 489: {active: 1, play: 2, text:"From the creators of Tiger & Bunny: ____ & ____!!"}
# 490: {active: 1, play: 1, text:"In the future of 199X, the barrier between our world and the demon world is broken, and thousands of monsters invade our realm to feed upon ____."}
# 491: {active: 1, play: 2, text:"Animation studio ____ is perhaps best known for ____."}
# 492: {active: 1, play: 1, text:"____. So kawaii!! <3 <3"}
# 493: {active: 1, play: 1, text:"The most annoying kind of anime fans are ____."}
# 494: {active: 1, play: 1, text:"Cooking is so fun! Cooking is so fun! Now it's time to take a break and see what we have done! ____. YAY! IT'S READY!!"}
# 495: {active: 1, play: 2, text:"My favorite hentai is the one where ____ is held down and violated by ____."}
# 496: {active: 1, play: 1, text:"The government of Japan recently passed a law that effectively forbids all forms of ____."}
# 497: {active: 1, play: 1, text:"This year, I'm totally gonna cosplay as ____."}
# 498: {active: 1, play: 1, text:"Coming to Neon Alley: ____, completely UNCUT & UNCENSORED."}
# 499: {active: 1, play: 1, text:"No matter how many times I see it, ____ always brings a tear to my eye."}
# 500: {active: 1, play: 1, text:"Of my entire collection, my most prized possession is ____."}
# 501: {active: 1, play: 1, text:"Someday when I have kids, I want to share with them the joys of ____."}
# 502: {active: 1, play: 1, text:"So, what have you learned from all of this?"}
# 503: {active: 1, play: 1, text:"The World Line was changed when I sent a D-mail to myself about ____."}
# 504: {active: 1, play: 1, text:"After years of searching, the crew of the Thousand Sunny finally found out that the One Piece is actually ____."}
# 505: {active: 1, play: 1, text:"When I found all 7 Dragon Balls, Shenron granted me my wish for ____."}
# 506: {active: 1, play: 2, text:"The best part of my ____ costume is ____."}
# 507: {active: 1, play: 1, text:"Cards Against Anime: It's more fun than ____!"}
# 508: {active: 1, play: 2, text:"On the mean streets of Tokyo, everyone knows that ____ is the leader of the ________ Gang."}
# 509: {active: 1, play: 1, text:"He might just save the universe, if he only had some ____!"}
# 510: {active: 1, play: 5, text:"Make a harem."}
# 511: {active: 1, play: 6, text:"Make a dub cast. ____ as ____, ____ as ____, & ____ as ____."}
# 512: {active: 1, play: 1, text:"Dr. PI:NAME:<NAME>END_PI, please hurry! The patient is suffering from a terminal case of ____!"}
# 513: {active: 1, play: 1, text:"I'M-A FIRIN' MAH ____!"}
# 514: {active: 1, play: 3, text:"Make a love triangle."}
# 515: {active: 1, play: 2, text:"This ____ of mine glows with an awesome power! Its ____ tells me to defeat you!"}
# 516: {active: 1, play: 1, text:"Yo-Ho-Ho! He took a bite of ____."}
# 517: {active: 1, play: 1, text:"Scientists have reverse engineered alien technology that unlocks the secrets of ____."}
# 518: {active: 1, play: 1, text:"It is often argued that our ancestors would have never evolved without the aid of ____."}
# 519: {active: 1, play: 1, text:"The sad truth is, that at the edge of the universe, there is nothing but ____."}
# 520: {active: 1, play: 1, text:"The 1930's is often regarded as the golden age of ____."}
# 521: {active: 1, play: 2, text:"____ a day keeps ____ away."}
# 522: {active: 1, play: 1, text:"There is a time for peace, a time for war, and a time for ____."}
# 523: {active: 1, play: 1, text:"If a pot of gold is at one end of the rainbow, what is at the other?"}
# 524: {active: 1, play: 1, text:"A fortune teller told me I will live a life filled with ____."}
# 525: {active: 1, play: 1, text:"The Himalayas are filled with many perils, such as ____."}
# 526: {active: 1, play: 1, text:"The road to success is paved with ____."}
# 527: {active: 1, play: 1, text:"I work out so I can look good when I'm ____."}
# 528: {active: 1, play: 1, text:"And on his farm he had ____, E-I-E-I-O!"}
# 529: {active: 1, play: 1, text:"Genius is 10% inspiration and 90% ____."}
# 530: {active: 1, play: 1, text:"I will not eat them Sam-I-Am. I will not eat ____."}
# 531: {active: 1, play: 1, text:"What's the time? ____ time!"}
# 532: {active: 1, play: 1, text:"____ is the root of all evil."}
# 533: {active: 1, play: 1, text:"The primitive villagers were both shocked and amazed when I showed them ____."}
# 534: {active: 1, play: 1, text:"And it is said his ghost still wanders these halls, forever searching for his lost ____."}
# 535: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PIney presents ____, on ice!"}
# 536: {active: 1, play: 1, text:"The best part of waking up is ____ in your cup."}
# 537: {active: 1, play: 1, text:"Though PI:NAME:<NAME>END_PI invented the lightbulb, he is also known for giving us ____."}
# 538: {active: 1, play: 2, text:"PI:NAME:<NAME>END_PI sat on her tuffet, eating her ____ and ____."}
# 539: {active: 1, play: 1, text:"What do I keep hidden in the crawlspace?"}
# 540: {active: 1, play: 1, text:"Go-Go-Gadget, ____!"}
# 541: {active: 1, play: 1, text:"I qualify for this job because I have several years experience in the field of ____."}
# 542: {active: 1, play: 1, text:"We just adopted ____ from the pound."}
# 543: {active: 1, play: 1, text:"It was the happiest day of my life when I became the proud parent of ____."}
# 544: {active: 1, play: 1, text:"I finally realized I hit rock bottom when I started digging through dumpsters for ____."}
# 545: {active: 1, play: 1, text:"With a million times the destructive force of all our nuclear weapons combined, no one was able to survive ____."}
# 546: {active: 1, play: 2, text:"You have been found guilty of 5 counts of ____, and 13 counts of ____."}
# 547: {active: 1, play: 1, text:"And the award for the filthiest scene in an adult film goes to '5 women and ____.'"}
# 548: {active: 1, play: 1, text:"'Why PI:NAME:<NAME>END_PI', said Little Red Riding Hood, 'What big ____ you have!'"}
# 549: {active: 1, play: 1, text:"Pay no attention to ____ behind the curtain!"}
# 550: {active: 1, play: 1, text:"Who would have guessed that the alien invasion would be easily thwarted by ____."}
# 551: {active: 1, play: 1, text:"With Democrats and Republicans in a dead heat, the election was snatched by ____ party."}
# 552: {active: 1, play: 1, text:"Mama always said life was like ____."}
# 553: {active: 1, play: 1, text:"Who could have guessed that the alien invasion would be easily thwarted by ____."}
# 554: {active: 1, play: 1, text:"With the Democrats and Republicans in a dead heat, the election was snatched by the ____ party."}
# 555: {active: 1, play: 1, text:"The panel I'm looking forward to most at AC this year is..."}
# 556: {active: 1, play: 1, text:"My Original Character's name is ____."}
# 557: {active: 1, play: 1, text:"My secret tumblr account where I post nothing but ____."}
# 558: {active: 1, play: 1, text:"Only my internet friends know that I fantasize about ____."}
# 559: {active: 1, play: 1, text:"Everyone really just goes to the cons for ____."}
# 560: {active: 1, play: 1, text:"It all started with ____."}
# 561: {active: 1, play: 2, text:"I'll roleplay ____, you can be ____."}
# 562: {active: 1, play: 2, text:"I'm no longer allowed near ____ after the incident with ____."}
# 563: {active: 1, play: 1, text:"I've been into ____ since before I hit puberty, I just didn't know what it meant."}
# 564: {active: 1, play: 1, text:"Realizing, too late, the implications of your interest in ____ as a child."}
# 565: {active: 1, play: 1, text:"Whoa, I might fantasize about ____, but I'd never actually go that far in real life."}
# 566: {active: 1, play: 1, text:"I realized they were a furry when they mentioned ____."}
# 567: {active: 1, play: 1, text:"Everyone on this site has such strong opinions about ____."}
# 568: {active: 1, play: 1, text:"My landlord had a lot of uncomfortable questions for me when when he found ____ in my bedroom while I was at work."}
# 569: {active: 1, play: 2, text:"I'm not even aroused by normal porn anymore, I can only get off to ____ or ____."}
# 570: {active: 1, play: 1, text:"____? Oh, yeah, I could get my mouth around that."}
# 571: {active: 1, play: 1, text:"What wouldn't I fuck?"}
# 572: {active: 1, play: 1, text:"When I thought I couldn't go any lower, I realized I would probably fuck ____."}
# 573: {active: 1, play: 1, text:"I knew my boyfriend was a keeper when he said he'd try ____, just for me."}
# 574: {active: 1, play: 2, text:"Fuck ____, get ____."}
# 575: {active: 1, play: 1, text:"I would bend over for ____."}
# 576: {active: 1, play: 1, text:"I think having horns would make ____ complicated."}
# 577: {active: 1, play: 1, text:"In my past life, I was ____."}
# 578: {active: 1, play: 1, text:"____ is my spirit animal."}
# 579: {active: 1, play: 1, text:"____. This is what my life has come to."}
# 580: {active: 1, play: 1, text:"I'm not even sad that I devote at least six hours of each day to ____."}
# 581: {active: 1, play: 1, text:"I never felt more accomplished than when I realized I could fit ____ into my ass."}
# 582: {active: 1, play: 1, text:"Yeah, I know I have a lot of ____ in my favorites, but I'm just here for the art."}
# 583: {active: 1, play: 1, text:"I'm not a 'furry,' I prefer to be called ____."}
# 584: {active: 1, play: 1, text:"Okay, ____? Pretty much the cutest thing ever."}
# 585: {active: 1, play: 1, text:"____. Yeah, that's a pretty interesting way to die."}
# 586: {active: 1, play: 1, text:"I didn't believe the rumors about ____, until I saw the videos."}
# 587: {active: 1, play: 1, text:"I knew I needed to leave the fandom when I realized I was ____."}
# 588: {active: 1, play: 1, text:"After being a furry for so long, I can never see ____ without getting a little aroused."}
# 589: {active: 1, play: 1, text:"It's really hard not to laugh at ____."}
# 590: {active: 1, play: 1, text:"If my parents ever found ____, I'd probably be disowned."}
# 591: {active: 1, play: 1, text:"____ ruined the fandom."}
# 592: {active: 1, play: 1, text:"The most recent item in my search history."}
# 593: {active: 1, play: 1, text:"Is it weird that I want to rub my face on ____?"}
# 594: {active: 1, play: 1, text:"My love for you is like ____. BERSERKER!"}
# 595: {active: 1, play: 2, text:"Last time I took bath salts, I ended up ____ in ____."}
# 596: {active: 1, play: 2, text:"Tara taught me that if you're going to engage in ____, then ____ isn't a good idea."}
# 597: {active: 1, play: 1, text:"The website was almost called 'thatguywith____.com'."}
# 598: {active: 1, play: 1, text:"They even took ____! Who does that?!"}
# 599: {active: 1, play: 1, text:"You may be a robot, but I AM ____!"}
# 600: {active: 1, play: 2, text:"Northernlion's doctor diagnosed him today with ____, an unfortunate condition that would lead to ____."}
# 601: {active: 1, play: 2, text:"And now we're going to be fighting ____ on ____."}
# 602: {active: 1, play: 2, text:"The comment section was nothing but ____ arguing about ____."}
# 603: {active: 1, play: 1, text:"IT'S ____ TIME!"}
# 604: {active: 1, play: 2, text:"It has been said... That there are entire forests of ____, made from the sweetest ____."}
# 605: {active: 1, play: 1, text:"Attention, duelists: My hair is ____."}
# 606: {active: 1, play: 1, text:"What do otaku smell like?"}
# 607: {active: 1, play: 1, text:"And from Kyoto Animation, a show about cute girls doing ____."}
# 608: {active: 1, play: 1, text:"Anime has taught me that classic literature can always be improved by adding ____."}
# 609: {active: 1, play: 1, text:"The moé debate was surprisingly civil until someone mentioned ____."}
# 610: {active: 1, play: 1, text:"That's not a squid! It's ____!"}
# 611: {active: 1, play: 2, text:"The Chocolate Underground stopped the Good For You Party by capturing their ____ and exposing their leader as ____."}
# 612: {active: 1, play: 1, text:"Who cares about the printing press, did that medieval peasant girl just invent ____?!"}
# 613: {active: 1, play: 2, text:"Eating ____ gave me ____."}
# 614: {active: 1, play: 1, text:"The reason I go to church is to learn about ____."}
# 615: {active: 1, play: 2, text:"Show me on ____, where he ____."}
# 616: {active: 1, play: 2, text:"I wouldn't ____ you with ____."}
# 617: {active: 1, play: 1, text:"All attempts at ____, have met with failure and crippling economic sanctions."}
# 618: {active: 1, play: 1, text:"Despite our Administration's best efforts, we are still incapable of ____."}
# 619: {active: 1, play: 1, text:"Technology improves every day. One day soon, surfing the web will be replaced by ____."}
# 620: {active: 1, play: 1, text:"Choosy Moms Choose ____."}
# 621: {active: 1, play: 1, text:"At camp, we'd scare each other by telling stories about ____ around the fire."}
# 622: {active: 1, play: 1, text:"Big Mac sleeps soundly whenever ____ is with him."}
# 623: {active: 1, play: 1, text:"____ is best pony."}
# 624: {active: 1, play: 3, text:"____ should ____ ____."}
# 625: {active: 1, play: 1, text:"____? That's future Spike's problem."}
# 626: {active: 1, play: 1, text:"After a wild night of crusPI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PIbloom learned that ____ was her super special talent."}
# 627: {active: 1, play: 1, text:"After a wild night of partying, Fluttershy awakens to find ____ in her bed."}
# 628: {active: 1, play: 1, text:"After living for thousands of years Celestia can only find pleasure in ____."}
# 629: {active: 1, play: 1, text:"Aloe and Lotus have been experimenting with a radical treatment that utilizes the therapeutic properties of ____."}
# 630: {active: 1, play: 1, text:"BUY SOME ____!"}
# 631: {active: 1, play: 1, text:"CUTIE MARK CRUSADERS; ____! YAY!"}
# 632: {active: 1, play: 1, text:"Daring Do and the quest for ____."}
# 633: {active: 1, play: 1, text:"Dear PI:NAME:<NAME>END_PI, Today I learned about ____. "}
# 634: {active: 1, play: 1, text:"Despite everypony's expectations, PI:NAME:<NAME>END_PI's cutie mark ended up being ____."}
# 635: {active: 1, play: 1, text:"Equestrian researchers have discovered that ____ is The 7th Element of Harmony."}
# 636: {active: 1, play: 2, text:"In a stroke of unparalleled evil, Discord turned ____ into ____."}
# 637: {active: 1, play: 1, text:"In a world without humans, saddles are actually made for ____."}
# 638: {active: 1, play: 1, text:"Inexplicably, the only thing the parasprites wouldn't eat was ____."}
# 639: {active: 1, play: 1, text:"It turns out Hitler's favorite pony was ____."}
# 640: {active: 1, play: 1, text:"It's not a boulder! It's ____!"}
# 641: {active: 1, play: 1, text:"My cutie mark would be ____."}
# 642: {active: 1, play: 1, text:"Nothing makes Pinkie smile more than ____."}
# 643: {active: 1, play: 1, text:"Giggle at ____!"}
# 644: {active: 1, play: 2, text:"I never knew what ____ could be, until you all shared its ____ with me."}
# 645: {active: 1, play: 1, text:"I'd like to be ____."}
# 646: {active: 1, play: 2, text:"Once upon a time, the land of Equestria was ruled by ____ and ____."}
# 647: {active: 1, play: 1, text:"Ponyville is widely known for ____."}
# 648: {active: 1, play: 1, text:"Rarity has a long forgotten line of clothing inspired by ____."}
# 649: {active: 1, play: 1, text:"Rarity was supposed to have a song about ____, but it was cut."}
# 650: {active: 1, play: 1, text:"Rarity's latest dress design was inspired by ____."}
# 651: {active: 1, play: 1, text:"Should the Elements of Harmony fail, ____ is to be used as a last resort."}
# 652: {active: 1, play: 1, text:"____. That is my fetish."}
# 653: {active: 1, play: 1, text:"The Elements of Harmony were originally the Elements of ____."}
# 654: {active: 1, play: 1, text:"When Luna got to the moon, she was greeted with ____."}
# 655: {active: 1, play: 1, text:"____? Oh murr."}
# 656: {active: 1, play: 3, text:"Who dunnit? ____ with ____ in ____."}
# 657: {active: 1, play: 1, text:"When Spike is asleep, Twilight likes to read books about ____."}
# 658: {active: 1, play: 1, text:"Why are you making chocolate pudding at 4 in the morning?"}
# 659: {active: 1, play: 1, text:"The newest feature of the Xbox One is ____."}
# 660: {active: 1, play: 1, text:"PS3: It only does ____."}
# 661: {active: 1, play: 1, text:"The new TF2 promo items are based on ____."}
# 662: {active: 1, play: 1, text:"All you had to do was follow the damn ____, CJ!"}
# 663: {active: 1, play: 1, text:"Liquid! How can you still be alive?"}
# 664: {active: 1, play: 1, text:"What can change the nature of a man?"}
# 665: {active: 1, play: 1, text:" Microsoft revealed that the Xbox One's demos had actually been running on ____ "}
# 666: {active: 1, play: 1, text:"What if ____ was a girl?"}
# 667: {active: 1, play: 1, text:"What did I preorder at gamestop?"}
# 668: {active: 1, play: 1, text:"____ confirmed for Super Smash Bros!"}
# 669: {active: 1, play: 1, text:"Based ____."}
# 670: {active: 1, play: 1, text:"The newest IP from Nintendo, Super ____ Bros. "}
# 671: {active: 1, play: 1, text:"____ only, no items, Final Destination. "}
# 672: {active: 1, play: 1, text:"Enjoy ____ while you play your Xbox one!"}
# 673: {active: 1, play: 1, text:"The future of gaming lies with the ____."}
# 674: {active: 1, play: 1, text:"The best way to be comfy when playing video games is with ____."}
# 675: {active: 1, play: 1, text:"____ has no games."}
# 676: {active: 1, play: 1, text:"PC gamers have made a petition to get ____ on their platform."}
# 677: {active: 1, play: 1, text:"The new Nintendo ____ is a big gimmick. "}
# 678: {active: 1, play: 1, text:"implying you aren't ____"}
# 679: {active: 1, play: 1, text:"WHAT IS A MAN?"}
# 680: {active: 1, play: 2, text:"What is a ___ but a ____?"}
# 681: {active: 1, play: 1, text:"WE WILL DRAG THIS ___ INTO THE 21ST CENTURY."}
# 682: {active: 1, play: 1, text:"All your ____ are belong to us"}
# 683: {active: 1, play: 1, text:"I'm in ur base, ____"}
# 684: {active: 1, play: 1, text:"Pop Quiz: Beatles Song- ___ terday."}
# 685: {active: 1, play: 1, text:" ___ would like to play."}
# 686: {active: 1, play: 1, text:"A mod of doom was made that was based off of ____."}
# 687: {active: 1, play: 1, text:"I really didn't like what they did with the ____ Movie adaption."}
# 688: {active: 1, play: 1, text:"'HEY, GOLLEN PALACE? HOW U SAY ____ IN CHINESE?'"}
# 689: {active: 1, play: 1, text:"Pumpkin doesn't want this."}
# 690: {active: 1, play: 1, text:"NEXT TIME ON GAME GRUMPS: ____."}
# 691: {active: 1, play: 1, text:"I used to be an adventurer like you, until ____."}
# 692: {active: 1, play: 1, text:"Yeah, well, my dad works for ____."}
# 693: {active: 1, play: 1, text:"Kotaku addresses sexism in ____ in their latest article."}
# 694: {active: 1, play: 1, text:"Get double XP for Halo 3 with purchase of ____."}
# 695: {active: 1, play: 1, text:"Sorry PI:NAME:<NAME>END_PI, but ____ is in another castle."}
# 696: {active: 1, play: 1, text:"LoL stole their new character design off of ____."}
# 697: {active: 1, play: 1, text:"____ is the cancer killing video games."}
# 698: {active: 1, play: 1, text:"Suffer, like ____ did."}
# 699: {active: 1, play: 1, text:"It's like ____ with guns!"}
# 700: {active: 1, play: 1, text:"Is a man not entitiled to ____?"}
# 701: {active: 1, play: 1, text:"____ has changed."}
# 702: {active: 1, play: 1, text:"But you can call me ____ the ____. Has a nice ring to it dontcha think?"}
# 703: {active: 1, play: 1, text:"Objective: ____"}
# 704: {active: 1, play: 1, text:"EA Sports! It's ____."}
# 705: {active: 1, play: 1, text:"____ is waiting for your challenge!"}
# 706: {active: 1, play: 1, text:"____ sappin' my sentry. "}
# 707: {active: 1, play: 1, text:"I'm here to ____ and chew bubble gum, and I'm all out of gum."}
# 708: {active: 1, play: 1, text:"I've covered ____, you know."}
# 709: {active: 1, play: 1, text:"It's dangerous to go alone! Take this:"}
# 710: {active: 1, play: 1, text:"You were almost a ____ sandwich!"}
# 711: {active: 1, play: 1, text:"That's the second biggest ____ I've ever seen!"}
# 712: {active: 1, play: 1, text:"____. ____ never changes."}
# 713: {active: 1, play: 1, text:"____ has changed. "}
# 714: {active: 1, play: 1, text:"You have been banned. Reason: ____."}
# 715: {active: 1, play: 1, text:"The newest trope against women in video games: ____."}
# 716: {active: 1, play: 1, text:"Fans started a kickstarter for a new ____ game. "}
# 717: {active: 1, play: 1, text:"Huh? What was that noise?"}
# 718: {active: 1, play: 1, text:"Viral marketers are trying to push the new ____."}
# 719: {active: 1, play: 1, text:"I wouldn't call it a Battlestation, more like a ____."}
# 720: {active: 1, play: 1, text:"____: Gotta go fast!"}
# 721: {active: 1, play: 1, text:"The best final fantasy game was ____."}
# 722: {active: 1, play: 1, text:"I love the ____, it's so bad"}
# 723: {active: 1, play: 1, text:"Valve is going to make ____ 2 before they release Half Life 3."}
# 724: {active: 1, play: 1, text:"____ is a pretty cool guy"}
# 725: {active: 1, play: 1, text:"Ah! Your rival! What was his name again?"}
# 726: {active: 1, play: 2, text:"Why is the ____ fandom the worst?"}
# 727: {active: 1, play: 1, text:"Achievement Unlocked: ____ !"}
# 728: {active: 1, play: 1, text:"I'm ____ under the table right now!"}
# 729: {active: 1, play: 1, text:"brb guys, ____ break"}
# 730: {active: 1, play: 1, text:"OH MY GOD JC, A ____"}
# 731: {active: 1, play: 1, text:"wooooooow, it took all 3 of you to ____"}
# 732: {active: 1, play: 1, text:"Rev up those ____, because I am sure hungry for one- HELP! HELP!"}
# 733: {active: 1, play: 1, text:"____ is 2deep and edgy for you."}
# 734: {active: 1, play: 1, text:"Only casuals like ____."}
# 735: {active: 1, play: 1, text:"The princess is in another ____"}
# 736: {active: 1, play: 1, text:"I have the bigger ____."}
# 737: {active: 1, play: 1, text:"____ TEAM RULES!!"}
# 738: {active: 1, play: 1, text:"When you see it... you don't see ____."}
# 739: {active: 1, play: 1, text:"HEY, GOLLEN PALACE? HOW U SAY ____ IN CHINESE?"}
# 740: {active: 1, play: 1, text:"WHAT THE FUCK DID YOU SAY ABOUT ME YOU ____?"}
# 741: {active: 1, play: 1, text:"This will be the 6th time we've posted ____; we've become increasingly efficient at it."}
# 742: {active: 1, play: 1, text:"appealing to a larger audience"}
# 743: {active: 1, play: 1, text:"we must embrace ____ and burn it as fuel for out journey."}
# 744: {active: 1, play: 1, text:"In Kingdom Hearts, DPI:NAME:<NAME>END_PId Duck will be replaced with ____ ."}
# 745: {active: 1, play: 1, text:"____ is a lie."}
# 746: {active: 1, play: 1, text:"Because of the lastest school shooting, ____ is being blamed for making kids too violent."}
# 747: {active: 1, play: 1, text:"Here lies ____: peperony and chease"}
# 748: {active: 1, play: 1, text:"Throwaway round: Get rid of those shit cards you don't want. Thanks for all the suggestions, /v/"}
# 749: {active: 1, play: 1, text:"The president has been kidnapped by ____. Are you a bad enough dude to rescue the president?"}
# 750: {active: 1, play: 1, text:"We ____ now."}
# 751: {active: 1, play: 1, text:"What is the new mustard paste?"}
# 752: {active: 1, play: 2, text:"All you had to do was ____ the damn ____!"}
# 753: {active: 1, play: 2, text:"The new ititeration in the Call of Duty franchise has players fighting off ____ deep in the jungles of ____ "}
# 754: {active: 1, play: 2, text:"Check your privilege, you ____ ____."}
# 755: {active: 1, play: 2, text:"Jill, here's a ____. It might come in handy if you, the master of ____, take it with you. "}
# 756: {active: 1, play: 2, text:"____ is a pretty cool guy, eh ____ and doesn't afraid of anything."}
# 757: {active: 1, play: 2, text:"It's like ____with ____!"}
# 758: {active: 1, play: 1, text:"I never thought I'd be comfortable with ____, but now it's pretty much the only thing I masturbate to."}
# 759: {active: 1, play: 1, text:"My next fursuit will have ____."}
# 760: {active: 1, play: 2, text:"I'm writing a porn comic about ____ and ____. "}
# 761: {active: 1, play: 1, text:"I tell everyone that I make my money off 'illustration,' when really, I just draw ____."}
# 762: {active: 1, play: 1, text:"Oh, you're an artist? Could you draw ____ for me?"}
# 763: {active: 1, play: 1, text:"Everyone thinks they're so great, but the only thing they're good at drawing is ____."}
# 764: {active: 1, play: 1, text:"They're just going to spend all that money on ____."}
# 765: {active: 1, play: 1, text:"While everyone else seems to have a deep, instinctual fear of ____, it just turns me on."}
# 766: {active: 1, play: 2, text:"Lying about having ____ to get donations, which you spend on ____."}
# 767: {active: 1, play: 1, text:"It's not bestiality, it's ____."}
# 768: {active: 1, play: 1, text:"Everyone thinks that because I'm a furry, I'm into ____. Unfortunately, they're right."}
# 769: {active: 1, play: 1, text:"I'm only gay for ____."}
# 770: {active: 1, play: 1, text:"Excuse you, I'm a were-____."}
# 771: {active: 1, play: 1, text:"If you like it, then you should put ____ on it."}
# 772: {active: 1, play: 1, text:"My girlfriend won't let me do ____."}
# 773: {active: 1, play: 1, text:"The most pleasant surprise I've had this year."}
# 774: {active: 1, play: 2, text:"I knew I had a problem when I had to sell ____ to pay for ____."}
# 775: {active: 1, play: 1, text:"I'm about 50% ____."}
# 776: {active: 1, play: 1, text:"____: Horrible tragedy, or sexual opportunity?"}
# 777: {active: 1, play: 1, text:"It's a little worrying that I have to compare the size of ____ to beverage containers."}
# 778: {active: 1, play: 2, text:"Hey, you guys wanna come back to my place? I've got ____ and ____."}
# 779: {active: 1, play: 1, text:"Jizzing all over ____."}
# 780: {active: 1, play: 1, text:"It's just that much creepier when 40-year-old men are into ____."}
# 781: {active: 1, play: 1, text:"____ is no substitute for social skills, but it's a start."}
# 782: {active: 1, play: 1, text:"The real reason I got into the fandom? ____."}
# 783: {active: 1, play: 1, text:"____ are definitely the new huskies."}
# 784: {active: 1, play: 1, text:"I remember when ____ was just getting started."}
# 785: {active: 1, play: 1, text:"When no one else is around, sometimes I consider doing things with ____."}
# 786: {active: 1, play: 1, text:"Actually coming inside ____."}
# 787: {active: 1, play: 1, text:"I don't know how we got on the subject of dragon cocks, but it probably started with ____."}
# 788: {active: 1, play: 1, text:"____ is a shining example of what those with autism can really do."}
# 789: {active: 1, play: 1, text:"It is my dream to be covered with ____."}
# 790: {active: 1, play: 2, text:"____ fucking ____. Now that's hot."}
# 791: {active: 1, play: 2, text:"Would you rather suck ____, or get dicked by ____?"}
# 792: {active: 1, play: 2, text:"It never fails to liven up the workplace when you ask your coworkers if they'd rather have sex with ____ or ____."}
# 793: {active: 1, play: 1, text:"HELLO FPI:NAME:<NAME>END_PIRIEND, HOWL ARE YOU DOING?"}
# 794: {active: 1, play: 2, text:"What are the two worst cards in your hand right now?"}
# 795: {active: 1, play: 1, text:"Nobody believes me when I tell that one story about walking in on ____."}
# 796: {active: 1, play: 2, text:"You don't know who ____ is? They're the one that draws ____."}
# 797: {active: 1, play: 1, text:"You sometimes wish you'd encounter ____ while all alone, in the woods. With a bottle of lube."}
# 798: {active: 1, play: 1, text:"I used to avoid talking about ____, but now it's just a part of normal conversation with my friends."}
# 799: {active: 1, play: 1, text:"The most controversial game at PAX this year is an 8-bit indie platformer about ____. (38/44)"}
# 800: {active: 1, play: 2, text:"Zecora is a well known supplier of ____ and ____."}
# 801: {active: 1, play: 1, text:"There was a riot at the Gearbox panel when they gave the attendees ____. (41/44)"}
# 802: {active: 1, play: 1, text:"The most controversial game at PAX this year is an 8-bit indie platformer about ____."}
# 803: {active: 1, play: 1, text:"What made Spock cry?"}
# 804: {active: 1, play: 1, text:"____: Achievement unlocked."}
# 805: {active: 1, play: 1, text:"What's the latest bullshit that's troubling this quaint fantasy town?"}
# 806: {active: 1, play: 1, text:"____ didn't make it onto the first AT4W DVD."}
# 807: {active: 1, play: 1, text:"____ is part of the WTFIWWY wheelhouse."}
# 808: {active: 1, play: 1, text:"____ is the subject of the Critic's newest review."}
# 809: {active: 1, play: 1, text:"____ is the subject of the missing short from The Uncanny Valley."}
# 810: {active: 1, play: 1, text:"____ needs more gay."}
# 811: {active: 1, play: 1, text:"____ wound up in this week's top WTFIWWY story."}
# 812: {active: 1, play: 1, text:"After getting snowed in at MAGfest, the reviewers were stuck with ____."}
# 813: {active: 1, play: 1, text:"ALL OF ____."}
# 814: {active: 1, play: 1, text:"Being done with My Little Pony, 8-Bit Mickey has moved onto ____."}
# 815: {active: 1, play: 1, text:"Birdemic 3: ____"}
# 816: {active: 1, play: 1, text:"Florida's new crazy is about ____."}
# 817: {active: 1, play: 1, text:"Hello, I'm a ____."}
# 818: {active: 1, play: 1, text:"IT'S NOT ____!"}
# 819: {active: 1, play: 1, text:"It's not nudity if there's ____."}
# 820: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's next sexual conquest is ____."}
# 821: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI had a long day at work, so tonight he'll stream ____."}
# 822: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI rejected yet another RDA request for ____."}
# 823: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's recent rant about Microsoft led to ____."}
# 824: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's Reviewer Spotlight featured ____."}
# 825: {active: 1, play: 1, text:"New rule in the RDA Drinking Game: Every time ____ happens, take a shot!"}
# 826: {active: 1, play: 1, text:"The best Bad Movie Beatdown sketch is where Film Brain ropes Lordhebe into ____."}
# 827: {active: 1, play: 1, text:"The controversy over ad-blocking could be easily solved by ____."}
# 828: {active: 1, play: 1, text:"The easiest way to counteract a DMCA takedown notice is with ____."}
# 829: {active: 1, play: 1, text:"The new site that will overtake TGWTG is ____."}
# 830: {active: 1, play: 1, text:"The newest Rap Libs makes extensive use of the phrase '____.'"}
# 831: {active: 1, play: 1, text:"The theme of this week's WTFIWWY is ____."}
# 832: {active: 1, play: 1, text:"What is literally the only thing tastier than a dragon's soul?"}
# 833: {active: 1, play: 1, text:"What is the name of the next new Channel Awesome contributor?"}
# 834: {active: 1, play: 1, text:"What killed PI:NAME:<NAME>END_PI's son?"}
# 835: {active: 1, play: 1, text:"What made Dodger ban someone from the RDA chat this week?"}
# 836: {active: 1, play: 2, text:"The next TGWTG porn spoof? ____ with ____!"}
# 837: {active: 1, play: 2, text:"Putting ____ in ____? That doesn't go there!"}
# 838: {active: 1, play: 2, text:"In trying to ban ____, Florida accidentally banned ____."}
# 839: {active: 1, play: 2, text:"If ____ got to direct an Uncanny Valley short, it would have featured ____."}
# 840: {active: 1, play: 2, text:"At MAGFest, ____ will host a panel focusing on ____."}
# 841: {active: 1, play: 2, text:"'Greetings, dear listeners. Won't you join ____ for ____?'"}
# 842: {active: 1, play: 2, text:"I'm going to die watching ____ review ____."}
# 843: {active: 1, play: 2, text:"In a new latest announcement video, ____ has announced an appearance at ____."}
# 844: {active: 1, play: 2, text:"____ and ____ would make awesome siblings."}
# 845: {active: 1, play: 2, text:"Some fangirls lay awake all night thinking of ____ and ____ together."}
# 846: {active: 1, play: 2, text:"In my new show, I review ____ while dressed like ____."}
# 847: {active: 1, play: 2, text:"Luke's newest character is ____, the Inner ____."}
# 848: {active: 1, play: 2, text:"Good evening! I am ____ of ____."}
# 849: {active: 1, play: 2, text:"____ is the reason that ____ picked 'AIDS.'"}
# 850: {active: 1, play: 3, text:"Nash's newest made-up curse word is ____-____-____! "}
# 851: {active: 1, play: 3, text:"Using alchemy, combine ____ and ____ to make ____! "}
# 852: {active: 1, play: 3, text:"Nash will build his next contraption with just ____, ____, and ____."}
# 853: {active: 1, play: 3, text:" ____ did ____ to avoid ____."}
# 854: {active: 1, play: 3, text:"Make a WTFIWWY story."}
# 855: {active: 1, play: 1, text:"Dang it, ____!"}
# 856: {active: 1, play: 1, text:"____ was full of leeches."}
# 857: {active: 1, play: 1, text:"Pimp your ___!"}
# 858: {active: 1, play: 1, text:"My apologies to the ____ estate."}
# 859: {active: 1, play: 1, text:"What interrupted the #NLSS?"}
# 860: {active: 1, play: 1, text:"Travel by ____."}
# 861: {active: 1, play: 1, text:"Say that to my face one more time and I'll start ____."}
# 862: {active: 1, play: 1, text:"Oh my god, he's using ____ magic!"}
# 863: {active: 1, play: 1, text:"____ has invaded!"}
# 864: {active: 1, play: 1, text:"We're having technical difficulties due to ____."}
# 865: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI is known for his MLG online play. What people don't know is that he's also MLG at ____."}
# 866: {active: 1, play: 1, text:"The next movie reading will be of ____."}
# 867: {active: 1, play: 1, text:"How did Northernlion unite Scotland?"}
# 868: {active: 1, play: 1, text:"Green loves the new Paranautical Activity item ____, but keeps comparing it to the crossbow."}
# 869: {active: 1, play: 1, text:"____ is really essential to completing the game."}
# 870: {active: 1, play: 1, text:"My channel is youtube.com/____."}
# 871: {active: 1, play: 1, text:"Hello anybody, I am ____Patrol."}
# 872: {active: 1, play: 2, text:"I have ____, can you ____ me?"}
# 873: {active: 1, play: 2, text:"____! Get off the ____!"}
# 874: {active: 1, play: 2, text:"My name is ____ and today we'll be checking out ____."}
# 875: {active: 1, play: 2, text:"That's the way ____ did it, that's the way ____ does it, and it''s worked out pretty well so far."}
# 876: {active: 1, play: 3, text:"This time on ____ vs. ____, we're playing ____."}
# 877: {active: 1, play: 1, text:"Welcome back to ____."}
# 878: {active: 1, play: 1, text:"Welcome to Sonic Team! We make ____, I think!"}
# 879: {active: 1, play: 1, text:"What am I willing to put up with today?"}
# 880: {active: 1, play: 1, text:"What is the boopinest shit?"}
# 881: {active: 1, play: 1, text:"WHAT THE FUCK IS A ____?!"}
# 882: {active: 1, play: 1, text:"When I look in the mirror I see ____."}
# 883: {active: 1, play: 1, text:"Who's an asshole?"}
# 884: {active: 1, play: 1, text:"WOOP WOOP WOOP I'M A ____!"}
# 885: {active: 1, play: 1, text:"You know what fan mail makes me the happiest every time I see it? It's the ones where people are like, '____.' "}
# 886: {active: 1, play: 1, text:"You're ruining my integrity! ____ won't hire me now!"}
# 887: {active: 1, play: 1, text:"I've been ____ again!"}
# 888: {active: 1, play: 1, text:"Rolling around at the speed of ____!"}
# 889: {active: 1, play: 1, text:"Use your ____!"}
# 890: {active: 1, play: 1, text:"Look at this guy, he's like ____."}
# 891: {active: 1, play: 1, text:"Look, it's ____!"}
# 892: {active: 1, play: 1, text:"Nightshade: The Claws of ____."}
# 893: {active: 1, play: 1, text:"Number one! With a bullet! Zoom in on the ____!"}
# 894: {active: 1, play: 1, text:"Oh, it's ____!"}
# 895: {active: 1, play: 1, text:"One slice of ____ please."}
# 896: {active: 1, play: 1, text:"Pikachu, use your ____ attack!"}
# 897: {active: 1, play: 1, text:"Put a hole in that ____!"}
# 898: {active: 1, play: 1, text:"Real talk? ____."}
# 899: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's mom called him to tell him about ____."}
# 900: {active: 1, play: 1, text:"Kirby has two iconic abilities: suck and ____."}
# 901: {active: 1, play: 1, text:"Listen to the ____ on this shit."}
# 902: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI believes that the most important part of any video game is ____."}
# 903: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI can't get enough of ____."}
# 904: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI can't survive air travel without ____."}
# 905: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI just wants to touch ____."}
# 906: {active: 1, play: 1, text:"Is there anything to gain from this?"}
# 907: {active: 1, play: 1, text:"It's no use! Take ____!"}
# 908: {active: 1, play: 1, text:"If the ____ wasn't there, I would do. But it's there, so it's not."}
# 909: {active: 1, play: 1, text:"How many nose hairs does ____ have?"}
# 910: {active: 1, play: 1, text:"I certainly can't do it without you, and I know you can't do it without ____!"}
# 911: {active: 1, play: 1, text:"I tell you once, I tell you twice! ____ is good for economy!"}
# 912: {active: 1, play: 1, text:"I wanna put my ____ in her!"}
# 913: {active: 1, play: 1, text:"I'm not even SELLING ____!"}
# 914: {active: 1, play: 1, text:"Do you remember the episode where PI:NAME:<NAME>END_PI caught a ____?"}
# 915: {active: 1, play: 1, text:"Don't throw ____! It's expensive to somebody!"}
# 916: {active: 1, play: 1, text:"Dude, real talk? ____."}
# 917: {active: 1, play: 1, text:"Eat your ____, son."}
# 918: {active: 1, play: 1, text:"Egoraptor's fiancee is actually a ____."}
# 919: {active: 1, play: 1, text:"Everybody wants to know about me, but they don't know about my ____."}
# 920: {active: 1, play: 1, text:"Fool me once, I'm mad. Fool me twice? How could you. Fool me three times, you're officially ____."}
# 921: {active: 1, play: 1, text:"For my first attack, I will juggle ____ to impress you."}
# 922: {active: 1, play: 1, text:"Fuck, I found a ____."}
# 923: {active: 1, play: 1, text:"Give ____ a chance! He'll grow on you!"}
# 924: {active: 1, play: 1, text:"____? Ten-outta-ten!"}
# 925: {active: 1, play: 1, text:"____. I AAAAAAIN’T HAVIN’ THAT SHIT!"}
# 926: {active: 1, play: 1, text:"____. It's no use!"}
# 927: {active: 1, play: 1, text:"____. MILLIONS ARE DEAD!!!"}
# 928: {active: 1, play: 1, text:"____. This is like one of my Japanese animes!"}
# 929: {active: 1, play: 1, text:"...What the bloody hell are you two talking about?!"}
# 930: {active: 1, play: 1, text:"'You want cheese pizza?' 'No. ____.'"}
# 931: {active: 1, play: 1, text:"And then, as a fuckin' goof, I'd put a hole in ____."}
# 932: {active: 1, play: 1, text:"And there it was...Kirby had finally met the ____ of the lost city."}
# 933: {active: 1, play: 1, text:"It took hours to edit ____ into the video."}
# 934: {active: 1, play: 1, text:"Arin believes that the most important part of any video game is ____."}
# 935: {active: 1, play: 1, text:"Arin has an adverse reaction to ____."}
# 936: {active: 1, play: 1, text:"Barry entertains himself by watching old episodes of ____."}
# 937: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI, add ____ into the video!"}
# 938: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI, we need a replay on ____."}
# 939: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI! SHOW ____ AGAIN!"}
# 940: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's sheer skill at ____ is unmatched."}
# 941: {active: 1, play: 1, text:"I don't like the ____ flavor."}
# 942: {active: 1, play: 1, text:"____ don't even cost this less!"}
# 943: {active: 1, play: 1, text:"____ has aged really well."}
# 944: {active: 1, play: 1, text:"____ is GREAT GREAT GREAT!"}
# 945: {active: 1, play: 1, text:"____ Train!"}
# 946: {active: 1, play: 1, text:"____ WINS!"}
# 947: {active: 1, play: 1, text:"____: Better than deer shit!"}
# 948: {active: 1, play: 2, text:"Welcome back to ____ ____!"}
# 949: {active: 1, play: 2, text:"Real talk? Is that ____ ____?"}
# 950: {active: 1, play: 2, text:"Look at that ____-ass ____!"}
# 951: {active: 1, play: 2, text:"JON'S ____, SHOW US YOUR ____."}
# 952: {active: 1, play: 2, text:"If you don't know what ____ is, you can't go to ____."}
# 953: {active: 1, play: 2, text:"IF I CAN'T BE ____, I SURE AS HELL CAN BE ____!!"}
# 954: {active: 1, play: 2, text:"COME ON AND ____, AND WELCOME TO THE ____!"}
# 955: {active: 1, play: 3, text:"If ____ evolved from ____, why the fuck is there still ____, dude?!"}
# 956: {active: 1, play: 3, text:"____? Pretty smart. ____? Pretty fuckin' smart. ____? FUCKING GENIUS!!!!"}
# 957: {active: 1, play: 1, text:"____ is the greatest Canadian."}
# 958: {active: 1, play: 1, text:"____ is the worst on the Podcast."}
# 959: {active: 1, play: 1, text:"____. That's top."}
# 960: {active: 1, play: 1, text:"After getting wasted at PAX, PI:NAME:<NAME>END_PI announced that 'I am ____!'"}
# 961: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI sucks ____."}
# 962: {active: 1, play: 1, text:"Close up of my ____."}
# 963: {active: 1, play: 1, text:"Come to Fort ____!"}
# 964: {active: 1, play: 1, text:"Describe yourself in one word/phrase."}
# 965: {active: 1, play: 1, text:"Detective ____ is down!"}
# 966: {active: 1, play: 1, text:"Does our house say 'We love ____?'"}
# 967: {active: 1, play: 1, text:"Dude, I got sixteen ____!"}
# 968: {active: 1, play: 1, text:"Fight, fight, fight, ____?"}
# 969: {active: 1, play: 1, text:"Fuck it, I mean ____, right?"}
# 970: {active: 1, play: 1, text:"I'ma smother you in my ____!"}
# 971: {active: 1, play: 1, text:"If you could fuck anyone in the world, who would you choose?"}
# 972: {active: 1, play: 1, text:"If you could have any superpower, what would it be?"}
# 973: {active: 1, play: 1, text:"If you were allowed to do one illegal thing, what would it be? "}
# 974: {active: 1, play: 1, text:"It's a ____ out there."}
# 975: {active: 1, play: 1, text:"It's not my fault. Somebody put ____ in my way."}
# 976: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI plays ____."}
# 977: {active: 1, play: 1, text:"Let's do ____ again! This is fun!"}
# 978: {active: 1, play: 1, text:"Lindsay could fuck up ____."}
# 979: {active: 1, play: 1, text:"LLLLLLLLLLLLLET'S ____!"}
# 980: {active: 1, play: 1, text:"My ____ is trying to die."}
# 981: {active: 1, play: 1, text:"On tonight's Let's Play, the AH crew plays ____."}
# 982: {active: 1, play: 1, text:"People like ____."}
# 983: {active: 1, play: 1, text:"RT Recap, featuring ____!"}
# 984: {active: 1, play: 1, text:"Shout out to ____!"}
# 985: {active: 1, play: 1, text:"Shout out to my mom. Called my Teddy Bear ____."}
# 986: {active: 1, play: 1, text:"So, I was just walking along, until suddenly ____ came along and attacked me."}
# 987: {active: 1, play: 1, text:"Thanks to ____ for this week's theme song."}
# 988: {active: 1, play: 1, text:"This week on AHWU, ____."}
# 989: {active: 1, play: 1, text:"This week on Immersion, we are going to test ____."}
# 990: {active: 1, play: 1, text:"What are fire hydrants called in England?"}
# 991: {active: 1, play: 1, text:"What is Game Night?"}
# 992: {active: 1, play: 1, text:"What is the meaning of life?"}
# 993: {active: 1, play: 1, text:"What is the saddest thing you've ever seen?"}
# 994: {active: 1, play: 1, text:"What is the worst thing anyone could say in front of the police?"}
# 995: {active: 1, play: 1, text:"What is your biggest feature?"}
# 996: {active: 1, play: 1, text:"What is your favorite book?"}
# 997: {active: 1, play: 1, text:"What is your mating call?"}
# 998: {active: 1, play: 1, text:"What makes Caboose angry?"}
# 999: {active: 1, play: 1, text:"What would be your chosen catchphrase?"}
# 1000: {active: 1, play: 1, text:"Where are we going for lunch?"}
# 1001: {active: 1, play: 1, text:"Who has a fake Internet girlfriend?"}
# 1002: {active: 1, play: 1, text:"Why are we here?"}
# 1003: {active: 1, play: 1, text:"Would you guys still like me if my name was ____?"}
# 1004: {active: 1, play: 1, text:"You threw it against the wall like a ____!"}
# 1005: {active: 1, play: 2, text:"____ is ____ as dicks."}
# 1006: {active: 1, play: 2, text:"____ is the best ____ ever. Of all time."}
# 1007: {active: 1, play: 2, text:"____ wins! ____ is a horse!"}
# 1008: {active: 1, play: 2, text:"If you got $1,000,000 per week, would you ____, but in the next day, you'd have to ____?"}
# 1009: {active: 1, play: 2, text:"My name is ____, and I hate ____!"}
# 1010: {active: 1, play: 2, text:"No one in the office expected the bromance between ____ and ____."}
# 1011: {active: 1, play: 2, text:"Select two cards to create your team name."}
# 1012: {active: 1, play: 3, text:"This week on VS, ____ challenges ____ to a game of ____."}
# 1013: {active: 1, play: 3, text:"The war's over. We're holding a parade in ____'s honor. ____ drives the float, and ____ is in charge of confetti."}
# 1014: {active: 1, play: 1, text:"What's a paladin?"}
# 1015: {active: 1, play: 1, text:"One of these days i'm just gonna shit my ____."}
# 1016: {active: 1, play: 1, text:"You need to ____ your asshole, it's vital to this operation."}
# 1017: {active: 1, play: 1, text:"I'm sorry PI:NAME:<NAME>END_PI, but I must ____ you."}
# 1018: {active: 1, play: 1, text:"In this week's gauntlet, Tehsmarty challenges ChilledChaos to ____."}
# 1019: {active: 1, play: 1, text:"In this week's gauntlet, ChilledChaos challenges Tehsmarty to ____."}
# 1020: {active: 1, play: 1, text:"I AM THE ____ CZAR!!!"}
# 1021: {active: 1, play: 1, text:"ZeRoyalViking's up and coming game company, 'ZEA' accredits their success to ____."}
# 1022: {active: 1, play: 1, text:"Tehsmarty loves the smell of ____ in the morning."}
# 1023: {active: 1, play: 1, text:"The Creatures' next member is ____."}
# 1024: {active: 1, play: 1, text:"Come on and slam, and welcome to the ____."}
# 1025: {active: 1, play: 1, text:"____, the one you want to get DDoS'd"}
# 1026: {active: 1, play: 2, text:"Why are there six ____ when there are only four ____?"}
# 1027: {active: 1, play: 1, text:"GaLmHD is so pro at almost every game he plays yet he can`t play____!"}
# 1028: {active: 1, play: 1, text:"Smarty's darkest fear is ____."}
# 1029: {active: 1, play: 1, text:"Pewdiepie's going to play ____!?"}
# 1030: {active: 1, play: 1, text:"And here we have ____. Strike it's weakness for MASSIVE damage!"}
# 1031: {active: 1, play: 1, text:"But PI:NAME:<NAME>END_PI! Why do you think that ____?"}
# 1032: {active: 1, play: 1, text:"In the next episode of Press Heart to Continue: Dodger talks about ____."}
# 1033: {active: 1, play: 1, text:"What did PI:NAME:<NAME>END_PIken do this time to break ARMA III? "}
# 1034: {active: 1, play: 1, text:"What was the big prize this time around at the Thrown Controllers panel?"}
# 1035: {active: 1, play: 1, text:"What did PI:NAME:<NAME>END_PI or PI:NAME:<NAME>END_PI find in the fridge today?"}
# 1036: {active: 1, play: 1, text:"In ____ We Trust."}
# 1037: {active: 1, play: 1, text:"When PI:NAME:<NAME>END_PI finally removed his horsemask on the livestream, we saw ____."}
# 1038: {active: 1, play: 1, text:"I give this game a rating of ____."}
# 1039: {active: 1, play: 1, text:"What did PI:NAME:<NAME>END_PI overreact to on his channel today?"}
# 1040: {active: 1, play: 1, text:"This time on Brutalmoose's Top 10, his guest was ____."}
# 1041: {active: 1, play: 1, text:"Only Totalbiscuit would spend an hour long video discussing ____."}
# 1042: {active: 1, play: 1, text:"Last Thursday, PI:NAME:<NAME>END_PI was identified in public and she proceeded to ____."}
# 1043: {active: 1, play: 1, text:"On this episode of PKA Woody and Wings talk about ____."}
# 1044: {active: 1, play: 1, text:"Bro's Angels. We ____ hard."}
# 1045: {active: 1, play: 1, text:"TotalBiscuit's top hat is actually ____. "}
# 1046: {active: 1, play: 2, text:"GTA shenanigans would not be GTA shenanigans without Seananners dropping ____ on ____."}
# 1047: {active: 1, play: 2, text:"Knowing Chilled's knowledge with Minecraft, he'll probably use ____ on ____ in his next video."}
# 1048: {active: 1, play: 2, text:"Oh great, ____ is doing another ____ game LP."}
# 1049: {active: 1, play: 2, text:"In his new Co-op work SSoHPKC will be playing ____ with ____."}
# 1050: {active: 1, play: 2, text:"My name is-a ____ and i likea da ____."}
# 1051: {active: 1, play: 1, text:"In today's Driftor in-depth episode we shall look at ____."}
# 1052: {active: 1, play: 1, text:"The Xbox One's DRM policy isn't half as bad as ____."}
# 1053: {active: 1, play: 1, text:"What will YouTube add in its next unneeded update?"}
# 1054: {active: 1, play: 1, text:"Two Best Friends Play ____."}
# 1055: {active: 1, play: 1, text:"There was a riot at the Gearbox panel when they gave the attendees ____."}
# 1056: {active: 1, play: 1, text:"In the new DLC for Mass Effect, Shepard must save the galaxy from ____."}
# 1057: {active: 1, play: 1, text:"No Enforcer wants to manage the panel on ____."}
# 1058: {active: 1, play: 1, text:"What's fun until it gets weird?"}
# 1059: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's new film tells the story of a precocious child coming to terms with ____."}
# 1060: {active: 1, play: 1, text:"I'm sorry, sir, but we don't allow ____ at the country club."}
# 1061: {active: 1, play: 1, text:"How am I compensating for my tiny penis?"}
# 1062: {active: 1, play: 1, text:"You've seen the bearded lady! You've seen the ring of fire! Now, ladies and gentlemen, feast your eyes upon ____!"}
# 1063: {active: 1, play: 1, text:"She's up all night for good fun. I'm up all night for ____."}
# 1064: {active: 1, play: 1, text:"Dear Leader PI:NAME:<NAME>END_PI, our village praises your infinite wisdom with a humble offering of ____."}
# 1065: {active: 1, play: 1, text:"Man, this is bullshit. Fuck ____."}
# 1066: {active: 1, play: 3, text:"You guys, I saw this crazy movie last night. It opens on ____, and then there's some stuff about ____, and then it ends with ____."}
# 1067: {active: 1, play: 2, text:"In return for my soul, the Devil promised me ____, but all I got was ____."}
# 1068: {active: 1, play: 1, text:"The Japanese have developed a smaller, more efficient version of ____."}
# 1069: {active: 1, play: 1, text:"Alright, bros. Our frat house is condemned, and all the hot slampieces are over at Gamma Phi. The time has come to commence Operation ____."}
# 1070: {active: 1, play: 1, text:"This is the prime of my life. I'm young, hot, and full of ____."}
# 1071: {active: 1, play: 1, text:"I'm pretty sure I'm high right now, because I'm absolutely mesmerized by ____."}
# 1072: {active: 1, play: 1, text:"It lurks in the night. It hungers for flesh. This summer, no one is safe from ____."}
# 1073: {active: 1, play: 2, text:"If you can't handle ____, you'd better stay away from ____."}
# 1074: {active: 1, play: 2, text:"Forget everything you know about ____, because now we've supercharged it with ____!"}
# 1075: {active: 1, play: 2, text:"Honey, I have a new role-play I want to try tonight! You can be ____, and I'll be ____."}
# 1076: {active: 1, play: 2, text:"This year's hottest album is '____' by ____."}
# 1077: {active: 1, play: 2, text:"Every step towards ____ gets me a little closer to ____."}
# 1078: {active: 1, play: 1, text:"Do not fuck with me! I am literally ____ right now."}
# 1079: {active: 1, play: 1, text:"2 AM in the city that never sleeps. The door swings open and she walks in, legs up to here. Something in her eyes tells me she's looking for ____."}
# 1080: {active: 1, play: 1, text:"As king, how will I keep the peasants in line?"}
# 1081: {active: 1, play: 2, text:"I am become ____, destroyer of ____!"}
# 1082: {active: 1, play: 2, text:"In the beginning, there was ____. And the Lord said, 'Let there be ____.'"}
# 1083: {active: 1, play: 2, text:"____ will never be the same after ____."}
# 1084: {active: 1, play: 2, text:"We never did find ____, but along the way we sure learned a lot about ____."}
# 1085: {active: 1, play: 2, text:"____ may pass, but ____ will last forever."}
# 1086: {active: 1, play: 2, text:"Adventure. Romance. ____. From Paramount Pictures, '____.'"}
# 1087: {active: 1, play: 1, text:"The seldomly mentioned 4th little pig built his house out of ____."}
# 1088: {active: 1, play: 1, text:"Mom, I swear! Despite its name, ____ is NOT a porno!"}
# 1089: {active: 1, play: 2, text:"Oprah's book of the month is '____ For ____: A Story of Hope.'"}
# 1090: {active: 1, play: 2, text:"But wait, there's more! If you order ____ in the next 15 minutes, we'll throw in ____ absolutely free!"}
# 1091: {active: 1, play: 1, text:"Blessed are you, Lord our God, creator of the universe, who has granted us ____."}
# 1092: {active: 1, play: 2, text:"That fucking idiot ____ ragequit the fandom over ____."}
# 1093: {active: 1, play: 1, text:"Because they are forbidden from masturbating, Mormons channel their repressed sexual energy into ____."}
# 1094: {active: 1, play: 1, text:"I really hope my grandmother doesn't ask me to explain ____ again."}
# 1095: {active: 1, play: 1, text:"What's the one thing that makes an elf instantly ejaculate?"}
# 1096: {active: 1, play: 1, text:"GREETINGS HUMANS. I AM ____ BOT. EXECUTING PROGRAM"}
# 1097: {active: 1, play: 1, text:"Kids these days with their iPods and their Internet. In my day, all we needed to pass the time was ____."}
# 1098: {active: 1, play: 1, text:"I always ____ ass - razor1000."}
# 1099: {active: 1, play: 1, text:"____ for temperature. "}
# 1100: {active: 1, play: 1, text:"Not asking for upvotes but ____."}
# 1101: {active: 1, play: 1, text:"I got ____ to the frontpage "}
# 1102: {active: 1, play: 1, text:"I know this is going to get downvoted to hell but ____."}
# 1103: {active: 1, play: 1, text:"I know this is a selfie but ____."}
# 1104: {active: 1, play: 1, text:"Imgur: where the points don’t matter and the ____ is made up."}
# 1105: {active: 1, play: 1, text:"If you could stop ____, that’d be greeeeattt. "}
# 1106: {active: 1, play: 1, text:"ERMAGERD! ____."}
# 1107: {active: 1, play: 1, text:"Not sure if Imgur reference or ____."}
# 1108: {active: 1, play: 1, text:"Having a bit of fun with the new ____."}
# 1109: {active: 1, play: 1, text:"Press 0 twice for ____."}
# 1110: {active: 1, play: 1, text:"No, no, you leave ____. We no like you."}
# 1111: {active: 1, play: 1, text:"FOR ____!!!!"}
# 1112: {active: 1, play: 2, text:"If ____ happens because of ____, I will eat my socks."}
# 1113: {active: 1, play: 1, text:"Put that ____ back where it came from or so help me."}
# 1114: {active: 1, play: 1, text:"Yer a wizard ____"}
# 1115: {active: 1, play: 1, text:"Am I the only one around here who ____?"}
# 1116: {active: 1, play: 2, text:"Confession Bear: When I was 6, I ____ on my ____."}
# 1117: {active: 1, play: 1, text:"Actual Advice Mallard: Always ____."}
# 1118: {active: 1, play: 1, text:"For every upvote I will ____."}
# 1119: {active: 1, play: 1, text:"____. Awkward boner. "}
# 1120: {active: 1, play: 1, text:"____. Forever Alone."}
# 1121: {active: 1, play: 1, text:"____. TOO SAD AND TOO TINY!"}
# 1122: {active: 1, play: 2, text:"I’ve never seen anyone so ____ while ____."}
# 1123: {active: 1, play: 1, text:"OH MY GOD ____. ARE YOU FUCKING KIDDING ME!?"}
# 1124: {active: 1, play: 1, text:"You know nothing ____."}
# 1125: {active: 1, play: 1, text:"Most of the time you can only fit one____ in there."}
# 1126: {active: 1, play: 1, text:"That ____ tasted so bad, I needed a Jolly Rancher. "}
# 1127: {active: 1, play: 2, text:"I don’t always ____. But when I do____.."}
# 1128: {active: 1, play: 1, text:"+1 for ____."}
# 1129: {active: 1, play: 1, text:"SAY GOODBYE TO____."}
# 1130: {active: 1, play: 1, text:"When I found ____ in usersubmitted, I was flabbergasted. "}
# 1131: {active: 1, play: 1, text:"France is ____"}
# 1132: {active: 1, play: 2, text:"The ____ for this ____ is TOO DAMN HIGH. "}
# 1133: {active: 1, play: 1, text:"Any love for ____?"}
# 1134: {active: 1, play: 1, text:"In Japan, ____ is the new sexual trend."}
# 1135: {active: 1, play: 2, text:"I love bacon as much as ____ loves ____."}
# 1136: {active: 1, play: 2, text:"A hipster needs a ____ as much as a fish needs a ____."}
# 1137: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI is a ____."}
# 1138: {active: 1, play: 1, text:"Are you my ____?"}
# 1139: {active: 1, play: 1, text:"Weasley is our ____."}
# 1140: {active: 1, play: 1, text:"I have a bad feeling about ____."}
# 1141: {active: 1, play: 1, text:"I am a leaf on the ____."}
# 1142: {active: 1, play: 1, text:"That was more awkward than ____."}
# 1143: {active: 1, play: 1, text:"Boardgame Online is more fun than ____."}
# 1144: {active: 1, play: 2, text:"I hate My Little Pony more than ____ hates ____."}
# 1145: {active: 1, play: 2, text:"I love My Little Pony more than ____ loves ____."}
# 1146: {active: 1, play: 1, text:"Cat gifs are cuter than ____. "}
# 1147: {active: 1, play: 1, text:"If it fits, I ____. "}
# 1148: {active: 1, play: 1, text:"____. My moon and my stars. "}
# 1149: {active: 1, play: 1, text:"A ____ always pays his debts. "}
# 1150: {active: 1, play: 1, text:"My ovaries just exploded because of ____. "}
# 1151: {active: 1, play: 1, text:"Chewie, ____ it!"}
# 1152: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI has no ____. "}
# 1153: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI is ____!!"}
# 1154: {active: 1, play: 3, text:"The court finds the defendant, ____, guilty of ____, and sentences them to a lifetime of ____."}
# 1155: {active: 1, play: 3, text:"____ ____ Divided By ____."}
# 1156: {active: 1, play: 2, text:"____ adds a thread in the Anti-____ group, and everybody loses their fucking minds."}
# 1157: {active: 1, play: 1, text:"____ is Best Pony."}
# 1158: {active: 1, play: 2, text:"____ is the least autistic ____ on Fimfiction."}
# 1159: {active: 1, play: 2, text:"____ posted that they're not working on fics for a while, because ____."}
# 1160: {active: 1, play: 2, text:"____ signalled the end of the ____ Age of FiMfiction.net."}
# 1161: {active: 1, play: 1, text:"____ signalled the end of the Golden Age of FiMfiction.net."}
# 1162: {active: 1, play: 1, text:"____ was a strong stallion."}
# 1163: {active: 1, play: 3, text:"____, ____, and ____ in a sexy circlejerk."}
# 1164: {active: 1, play: 3, text:"A clopfic about ____ with ____, and ____ is a sexy orphan."}
# 1165: {active: 1, play: 2, text:"An alternate universe where ____ is instead ____."}
# 1166: {active: 1, play: 2, text:"Fallout Equestria is ____ and tends to overdramaticize its ____."}
# 1167: {active: 1, play: 1, text:"Hey, let's cross over ____ and MLP! Why the fuck not?"}
# 1168: {active: 1, play: 3, text:"I commissioned a picture of ____ violating ____ with ____'s dick."}
# 1169: {active: 1, play: 1, text:"I hope someone writes a fic about ____ because I am too fucking lazy to do it myself."}
# 1170: {active: 1, play: 2, text:"I just read a fic where ____ was fucking ____."}
# 1171: {active: 1, play: 1, text:"I just started the ____verse."}
# 1172: {active: 1, play: 1, text:"I swear I'm going to quit the fandom if ____ happens."}
# 1173: {active: 1, play: 1, text:"If only people bothered to read Ezn's ____ Guide!"}
# 1174: {active: 1, play: 1, text:"knighty's new blogpost is about ____"}
# 1175: {active: 1, play: 1, text:"My ____ Pony"}
# 1176: {active: 1, play: 1, text:"My Little Dashie? How about My Little ____?"}
# 1177: {active: 1, play: 2, text:"My OTP is ____ and ____."}
# 1178: {active: 1, play: 1, text:"Oh, fuck, someone made a group about ____."}
# 1179: {active: 1, play: 1, text:"Oh, look, ____ made a fan group for themselves."}
# 1180: {active: 1, play: 2, text:"RainbowBob's newest clopfic: ____ X ____"}
# 1181: {active: 1, play: 1, text:"Remember when ____ was on every page?"}
# 1182: {active: 1, play: 1, text:"Short Skirts and ____."}
# 1183: {active: 1, play: 3, text:"Someone should write a clopfic of ____ fucking ____, using ____ as lubricant."}
# 1184: {active: 1, play: 1, text:"The ____ Bureau."}
# 1185: {active: 1, play: 2, text:"The ____ Group of ____ Excellence."}
# 1186: {active: 1, play: 2, text:"The cardinal sin of FiMFic noobs: _____ without ______"}
# 1187: {active: 1, play: 2, text:"The Incredible ____ Of A Winning ____."}
# 1188: {active: 1, play: 2, text:"There's a crossover fic about ____ and ____ in the FB."}
# 1189: {active: 1, play: 3, text:"____: ____ in fiction, ____ on the tabletop."}
# 1190: {active: 1, play: 2, text:"I proxy ____ using a second-hand ____."}
# 1191: {active: 1, play: 1, text:"Next up: LPI:NAME:<NAME>END_PI LPI:NAME:<NAME>END_PIander's paints ____."}
# 1192: {active: 1, play: 1, text:"The citizens of Innsmouth are really ____!"}
# 1193: {active: 1, play: 1, text:"I am Angry, Angry about ____."}
# 1194: {active: 1, play: 2, text:"In respect to your chapter, the Blood Ravens have dedicated one of their____to ____."}
# 1195: {active: 1, play: 1, text:"Roll for ____."}
# 1196: {active: 1, play: 1, text:"I prepared ____ this morning."}
# 1197: {active: 1, play: 1, text:"The bard nearly got us killed when he rolled to seduce ____."}
# 1198: {active: 1, play: 1, text:"____ causes the Paladin to fall"}
# 1199: {active: 1, play: 2, text:"The door to the FLGS opens and a ____ walks in!"}
# 1200: {active: 1, play: 1, text:"GW stores no longer stock____"}
# 1201: {active: 1, play: 1, text:"The price on ____ Has doubled!"}
# 1202: {active: 1, play: 1, text:"____ falls, everyone dies."}
# 1203: {active: 1, play: 1, text:"My GM just made his girlfriend a ____ character. How fucked are we?"}
# 1204: {active: 1, play: 1, text:"If you buy a camel, Crazy Hassan is adding in free ____ this week only!"}
# 1205: {active: 1, play: 1, text:"Around elves, watch ____"}
# 1206: {active: 1, play: 2, text:"The only good ____ is a dead ____"}
# 1207: {active: 1, play: 1, text:"...And then he killed the Tarasque with a ____"}
# 1208: {active: 1, play: 1, text:"There is a ____ on the roof."}
# 1209: {active: 1, play: 1, text:"What are we going to argue about today?"}
# 1210: {active: 1, play: 1, text:"I got a box today. What's inside? ____"}
# 1211: {active: 1, play: 1, text:"Roll ____ circumference"}
# 1212: {active: 1, play: 3, text:"What I made: ____. What the Dungeon Master saw: ____. What I played: ____"}
# 1213: {active: 1, play: 2, text:"____ vs. ____: Critical Hit!"}
# 1214: {active: 1, play: 1, text:"Then the barbarian drank from the ____-filled fountain"}
# 1215: {active: 1, play: 1, text:"____: That was a thing."}
# 1216: {active: 1, play: 1, text:"preferring 3D women over ____"}
# 1217: {active: 1, play: 1, text:"Where we're going, we won't need ____ to see"}
# 1218: {active: 1, play: 1, text:"You encounter a Gazebo. You respond with ____"}
# 1219: {active: 1, play: 1, text:"D&D: 6th edition will feature ____ as a main race!"}
# 1220: {active: 1, play: 1, text:"Your Natural 1 summons ____."}
# 1221: {active: 1, play: 1, text:"It would have taken ____ to..... CREEEEEEEEEED!"}
# 1222: {active: 1, play: 1, text:"Can ____ bloom on the battlefield?"}
# 1223: {active: 1, play: 1, text:"____? That's ULTRA heretical"}
# 1224: {active: 1, play: 1, text:"So I made my chapter insignia ____"}
# 1225: {active: 1, play: 1, text:"In the grim darkness of the far future there is only ____"}
# 1226: {active: 1, play: 1, text:"2e or ____"}
# 1227: {active: 1, play: 2, text:"Blood for the blood god! ____ for the ____!"}
# 1228: {active: 1, play: 1, text:"____. we don't need other boards anymore!"}
# 1229: {active: 1, play: 1, text:"____ just fucked us"}
# 1230: {active: 1, play: 2, text:"The guard looks a troubled, uncomfortable glare, like a man who must explain to his ____, that's its dreams of becoming ____ will never happen."}
# 1231: {active: 1, play: 1, text:"Dwarf Fortress needs more ____"}
# 1232: {active: 1, play: 1, text:"My ____ are moving on their own"}
# 1233: {active: 1, play: 1, text:"Welcome to the ____ Quest Thread."}
# 1234: {active: 1, play: 1, text:"You should never let your bard ____."}
# 1235: {active: 1, play: 1, text:"That one guy in my group always rolls a chaotic neutral ____."}
# 1236: {active: 1, play: 1, text:"The lich's phylactery is a ____!"}
# 1237: {active: 1, play: 1, text:"Macha was dismayed to find out that ____."}
# 1238: {active: 1, play: 1, text:"Never fire ____ at the bulkhead!"}
# 1239: {active: 1, play: 1, text:"____ is the only way I can forget about 4e."}
# 1240: {active: 1, play: 1, text:"I sure hope no one notices that I inserted my ____ fetish into the game."}
# 1241: {active: 1, play: 2, text:"Behold! White Wolf's newest game: ____: the ____."}
# 1242: {active: 1, play: 1, text:"For our upcoming FATAL game, I've assigned ____ as your new character."}
# 1243: {active: 1, play: 2, text:"The GM has invited his new ____ to join the game. They'll be playing ____."}
# 1244: {active: 1, play: 1, text:"0/10 would not ____."}
# 1245: {active: 1, play: 1, text:"The ____ guides my blade."}
# 1246: {active: 1, play: 1, text:"Don't touch me ____!"}
# 1247: {active: 1, play: 1, text:"Mountain, Black lotus, sac, to cast ____."}
# 1248: {active: 1, play: 2, text:"____ followed by gratuitous ____ is how I got kicked out off my last group."}
# 1249: {active: 1, play: 1, text:"Everybody was surprised when the king's trusted adviser turned out to be ____."}
# 1250: {active: 1, play: 3, text:"You and ____ must stop ____ with the ancient artifact ____."}
# 1251: {active: 1, play: 1, text:"Elf ____ Wat do?"}
# 1252: {active: 1, play: 1, text:"Magic the Gathering's next set is themed around ____."}
# 1253: {active: 1, play: 1, text:"We knew the game was off to a good start when the GM didn't veto a player's decision to play as ____."}
# 1254: {active: 1, play: 1, text:"My Kriegers came in a box of ____!"}
# 1255: {active: 1, play: 1, text:"I had to kill a party member when wasted 2 hours by ____."}
# 1256: {active: 1, play: 1, text:"We found ____in the Dragon's hoard."}
# 1257: {active: 1, play: 1, text:"What's on today's agenda for the mage guild meeting?"}
# 1258: {active: 1, play: 1, text:"____ is the only way to fix 3.5."}
# 1259: {active: 1, play: 1, text:"What is the BBEG's secret weapon?"}
# 1260: {active: 1, play: 1, text:"Ach! Hans run! It's the ____!"}
# 1261: {active: 1, play: 1, text:"The enemy's ____ is down."}
# 1262: {active: 1, play: 1, text:"Only fags play mono____."}
# 1263: {active: 1, play: 1, text:"What is better than 3D women?"}
# 1264: {active: 1, play: 1, text:"I kept getting weird looks at FNM when I brought my new ____ card sleeves."}
# 1265: {active: 1, play: 1, text:"I like to dress up like ____ and hit people with foam swords."}
# 1266: {active: 1, play: 2, text:"You've been cursed by the witch! Your ____ has turned into a ____!"}
# 1267: {active: 1, play: 1, text:"The adventure was going fine until the BBEG put ____ in our path."}
# 1268: {active: 1, play: 1, text:"Your BBEG is actually ____!"}
# 1269: {active: 1, play: 1, text:"The last straw was the Chaotic Neutral buying a case of ____."}
# 1270: {active: 1, play: 1, text:"What won't the Bard fuck?."}
# 1271: {active: 1, play: 1, text:"____! what was that?"}
# 1272: {active: 1, play: 1, text:"You roll 00 for your magical mishap and turn into ____."}
# 1273: {active: 1, play: 1, text:"You fool! you fell victim to one of the classic blunders: ____."}
# 1274: {active: 1, play: 1, text:"...and then the bastard pulled out ____ and placed it on the table."}
# 1275: {active: 1, play: 3, text:"What is your OT3?"}
# 1276: {active: 1, play: 1, text:"I cast magic missile at ____."}
# 1277: {active: 1, play: 2, text:"Wait! I'm a ____! Let me tell you about my ____!"}
# 1278: {active: 1, play: 2, text:"Whenever we run ____, it's customary that ____ pays for the group's pizza."}
# 1279: {active: 1, play: 1, text:"My most shameful orgasm was the time I masturbated to ____."}
# 1280: {active: 1, play: 1, text:"I got an STD from ____."}
# 1281: {active: 1, play: 1, text:"____ is serious business."}
# 1282: {active: 1, play: 1, text:"If you don't pay your Comcast cable bill, they will send ____ after you."}
# 1283: {active: 1, play: 1, text:"Mewtwo achieved a utopian society when he eliminated ____ once and for all."}
# 1284: {active: 1, play: 1, text:"The only thing that caused more of a shitfit than Mewtwo's new form is ____."}
# 1285: {active: 1, play: 1, text:"The idiots in that one room at the Westin finally got kicked out of Anthrocon for ____."}
# 1286: {active: 1, play: 1, text:"Furaffinity went down for 48 hours because of ____."}
# 1287: {active: 1, play: 1, text:"Anthrocon was ruined by ____."}
# 1288: {active: 1, play: 1, text:"I unwatched his FurAffinity page because he kept posting ____."}
# 1289: {active: 1, play: 1, text:"You don't want to find ____ in your Furnando's Lasagna Wrap."}
# 1290: {active: 1, play: 2, text:"____ ruined the ____ fandom for all eternity."}
# 1291: {active: 1, play: 2, text:"I was fapping to ____, but ____ walked in on me."}
# 1292: {active: 1, play: 1, text:"In recent tech news, computers are now being ruined by ____."}
# 1293: {active: 1, play: 3, text:"Yu-Gi-Oh players were shocked when the win condition of holding 5 Exodia pieces was replaced by ____, ____, and ____. "}
# 1294: {active: 1, play: 3, text:"What are the worst 3 cards in your hand right now?"}
# 1295: {active: 1, play: 1, text:"____ makes the Homestuck fandom uncomfortable."}
# 1296: {active: 1, play: 2, text:"____ stays awake at night, crying over ____."}
# 1297: {active: 1, play: 1, text:"____. It keeps happening!"}
# 1298: {active: 1, play: 1, text:"'Sacred leggings' was a mistranslation. The Sufferer actually died in Sacred ____."}
# 1299: {active: 1, play: 1, text:"After throwing ____ at Karkat's head, PI:NAME:<NAME>END_PI made the intriguing discover that troll horns are very sensitive."}
# 1300: {active: 1, play: 1, text:"AG: Who needs luck when you have ____?"}
# 1301: {active: 1, play: 1, text:"All ____. All of it!"}
# 1302: {active: 1, play: 1, text:"Alternia's political system was based upon ____."}
# 1303: {active: 1, play: 1, text:"Believe it or not, Kankri's biggest trigger is ____."}
# 1304: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI likes ____, but only ironically."}
# 1305: {active: 1, play: 1, text:"Equius beats up Eridan for ____."}
# 1306: {active: 1, play: 1, text:"Feferi secretly hates ____."}
# 1307: {active: 1, play: 1, text:"For PI:NAME:<NAME>END_PI's latest ad campaign/brainwashing scheme, she is using ____ as inspiration."}
# 1308: {active: 1, play: 1, text:"For his birthday, PI:NAME:<NAME>END_PI gave PI:NAME:<NAME>END_PI ____."}
# 1309: {active: 1, play: 1, text:"Fuckin' ____. How do they work?"}
# 1310: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI not only likes using his clubs for juggling and strifing, he also uses them for____."}
# 1311: {active: 1, play: 1, text:"Getting a friend to read Homestuck is like ____."}
# 1312: {active: 1, play: 1, text:"How do I live without ____?"}
# 1313: {active: 1, play: 2, text:"PI:NAME:<NAME>END_PI died on his quest bed and rose as the fully realized ____ of ____."}
# 1314: {active: 1, play: 2, text:"PI:NAME:<NAME>END_PIussPI:NAME:<NAME>END_PI unintentionally revealed that Homestuck will end with ____ and ____ consummating their relationship at last."}
# 1315: {active: 1, play: 1, text:"I am ____. It's me."}
# 1316: {active: 1, play: 1, text:"I finally became Tumblr famous when I released a gifset of ____."}
# 1317: {active: 1, play: 1, text:"I just found ____ in my closet it is like fucking christmas up in here."}
# 1318: {active: 1, play: 1, text:"I warned you about ____, bro! I told you, dog!"}
# 1319: {active: 1, play: 1, text:"In the final battle, PI:NAME:<NAME>END_PI distracts Lord English by showing him ____."}
# 1320: {active: 1, play: 1, text:"It's hard, being ____. It's hard and no one understands."}
# 1321: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI is a good boy. And he loves ____."}
# 1322: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI may not be a homosexual, but he has a serious thing for ____."}
# 1323: {active: 1, play: 1, text:"Kanaya reached into her dead lusus's stomach and retrieved ____."}
# 1324: {active: 1, play: 1, text:"Kanaya tells Karkat about ____ to cheer him up."}
# 1325: {active: 1, play: 1, text:"Karkat gave our universe ____."}
# 1326: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI have decided to teach PI:NAME:<NAME>END_PIri about the wonders of ____."}
# 1327: {active: 1, play: 1, text:"Little did they know, the key to defeating Lord English was actually ____."}
# 1328: {active: 1, play: 1, text:"Little known fact: PI:NAME:<NAME>END_PI's stitching is actually made out of ____."}
# 1329: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI baked a cake for PI:NAME:<NAME>END_PI to commemorate ____."}
# 1330: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PIta only likes Karkat for his ____."}
# 1331: {active: 1, play: 2, text:"Nepeta's secret OTP is ____ with ____."}
# 1332: {active: 1, play: 1, text:"The next thing PI:NAME:<NAME>END_PIussie will turn into a sex joke will be ____."}
# 1333: {active: 1, play: 2, text:"Nobody was surprised to find ____ under Jade's skirt. The surprise was she used it for/on ____."}
# 1334: {active: 1, play: 1, text:"The only way to beat PI:NAME:<NAME>END_PI in an eating contest is to put ____ on the table."}
# 1335: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI made PI:NAME:<NAME>END_PI a sweater to cover his ____."}
# 1336: {active: 1, play: 1, text:"Problem PI:NAME:<NAME>END_PI had a hard time investigating ____."}
# 1337: {active: 1, play: 1, text:"The real reason PI:NAME:<NAME>END_PI stabbed PI:NAME:<NAME>END_PI was to punish her for ____."}
# 1338: {active: 1, play: 1, text:"Rose was rather disgusted when she started reading about ____."}
# 1339: {active: 1, play: 1, text:"The secret way to achieve God Tier is to die on top of ____."}
# 1340: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PIzi can top anyone except ____."}
# 1341: {active: 1, play: 1, text:"The thing that made PI:NAME:<NAME>END_PI break his vow of celibacy was ____."}
# 1342: {active: 1, play: 1, text:"Turns out, pre-entry prototyping with ____ was not the best idea."}
# 1343: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI killed PI:NAME:<NAME>END_PIidermom with ____."}
# 1344: {active: 1, play: 2, text:"Vriska roleplays ____ with PI:NAME:<NAME>END_PIerezi as ____."}
# 1345: {active: 1, play: 1, text:"Vriska's greatest regret is ____."}
# 1346: {active: 1, play: 2, text:"Wear ____. Be ____."}
# 1347: {active: 1, play: 1, text:"What did PI:NAME:<NAME>END_PI get Dirk for his birthday?"}
# 1348: {active: 1, play: 1, text:"What is the worst thing that PI:NAME:<NAME>END_PIzi ever licked?"}
# 1349: {active: 1, play: 1, text:"What makes your kokoro go 'doki doki'?"}
# 1350: {active: 1, play: 1, text:"What's in the box, PI:NAME:<NAME>END_PI?"}
# 1351: {active: 1, play: 1, text:"When a bucket is unavailable, trolls with use ____."}
# 1352: {active: 1, play: 1, text:"When PI:NAME:<NAME>END_PI received ____ from his Bro for his 9th birthday, be felt a little warm inside."}
# 1353: {active: 1, play: 1, text:"The hole in Kanaya's stomach is so large, she can fit ____ in it."}
# 1354: {active: 1, play: 1, text:"where doing it man. where MAKING ____ HAPEN!"}
# 1355: {active: 1, play: 1, text:"Your name is PI:NAME:<NAME>END_PI and boy do you love ____!"}
# 1356: {active: 1, play: 1, text:"____. On the roof. Now."}
# 1357: {active: 1, play: 1, text:"____ totally makes me question my sexuality."}
# 1358: {active: 1, play: 1, text:"Whenever I see ____ on MSPARP, I disconnect immediately."}
# 1359: {active: 1, play: 1, text:"Calliborn wants you to draw pornography of ____."}
# 1360: {active: 1, play: 1, text:"They found some more last episodes! They were found in ____."}
# 1361: {active: 1, play: 1, text:"The Doctor did it! He saved the world again! This time using a ____."}
# 1362: {active: 1, play: 1, text:"I'd give up ____ to travel with The Doctor."}
# 1363: {active: 1, play: 1, text:"The next Doctor Who spin-off is going to be called ____."}
# 1364: {active: 1, play: 1, text:"Who should be the 13th Doctor?"}
# 1365: {active: 1, play: 1, text:"The Chameleon circuit is working again...somewhat. Instead of a phone booth, the TARDIS is now a ____."}
# 1366: {active: 1, play: 1, text:"Originally, the 50th special was going to have ____ appear, but the BBC decided against it in the end."}
# 1367: {active: 1, play: 1, text:"After we watch an episode, I've got some ____-flavored Jelly Babies to hand out."}
# 1368: {active: 1, play: 1, text:"Wibbly-wobbly, timey-wimey ____."}
# 1369: {active: 1, play: 1, text:"What's going to be The Doctor's new catchphrase?"}
# 1370: {active: 1, play: 1, text:"Bowties are ____."}
# 1371: {active: 1, play: 1, text:"Old and busted: EXTERMINATE! New hotness: ____."}
# 1372: {active: 1, play: 1, text:"There's a new dance on Gallifrey. It's called the ____."}
# 1373: {active: 1, play: 1, text:"They announced a new LEGO Doctor Who game! Rumor has it that ____ is an unlockable character."}
# 1374: {active: 1, play: 1, text:"FUN FACT: The Daleks were originally shaped to look like ____."}
# 1375: {active: 1, play: 1, text:"At this new Doctor Who themed restaurant, you can get a free ____ if you can eat a plate of bangers and mash in under 3 minutes."}
# 1376: {active: 1, play: 1, text:"Who is going to be The Doctor's next companion?"}
# 1377: {active: 1, play: 1, text:"I think the BBC is losing it. They just released a Doctor Who themed ____."}
# 1378: {active: 1, play: 1, text:"It's a little known fact that if you send a ____ to the BBC, they will send you a picture of The Doctor."}
# 1379: {active: 1, play: 1, text:"I was ok with all the BAD WOLF graffiti, until someone wrote it on ____."}
# 1380: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI, I can't leave you alone for a minute! I turn around and you're trying to seduce ____."}
# 1381: {active: 1, play: 1, text:"In all of space and time you decide that ____ is a good choice?!"}
# 1382: {active: 1, play: 1, text:"Adipose were thought to be made of fat, but are really made of ____."}
# 1383: {active: 1, play: 1, text:"I hear the next thing that will cause The Doctor to regenerate is ____."}
# 1384: {active: 1, play: 1, text:"Honey badger don't give a ____!"}
# 1385: {active: 1, play: 1, text:"My next video turorial covers ____."}
# 1386: {active: 1, play: 1, text:"We found a map PI:NAME:<NAME>END_PI! A map to ____ Mountain!"}
# 1387: {active: 1, play: 1, text:"For the love of GOD, and all that is HOLY, ____!!"}
# 1388: {active: 1, play: 1, text:"The new Operating System will be called ____."}
# 1389: {active: 1, play: 2, text:"I used to be an adventurer like you, then I took a/an ____ in the ____."}
# 1390: {active: 1, play: 1, text:"You've got to check out ____ Fluxx!"}
# 1391: {active: 1, play: 1, text:"Call of Duty Modern Warfare 37: War of ____!"}
# 1392: {active: 1, play: 1, text:"In brightest day, in blackest night, no ____ shall escape my sight."}
# 1393: {active: 1, play: 1, text:"Yes, Mr. Death... I'll play you a game! But not chess! My game is ____."}
# 1394: {active: 1, play: 1, text:"I cannot preach hate and warfare when I am a disciple of ____."}
# 1395: {active: 1, play: 1, text:"With great power comes great ____."}
# 1396: {active: 1, play: 1, text:"Don't make me ____. You wouldn't like me when I'm ____."}
# 1397: {active: 1, play: 1, text:"Fighting a never-ending battle for truth, justice, and the American ____!"}
# 1398: {active: 1, play: 2, text:"Faster than a speeding ____! More powerful than a ____!"}
# 1399: {active: 1, play: 1, text:"Able to leap ____ in a single bound! "}
# 1400: {active: 1, play: 2, text:"Disguised as ____, mild-mannered ____. "}
# 1401: {active: 1, play: 1, text:"Patriotism doesn't automatically equal ____."}
# 1402: {active: 1, play: 1, text:"I'm loyal to nothing, General - except the ____."}
# 1403: {active: 1, play: 1, text:"Alright you Primitive Screwheads, listen up! You see this? This... is my ____!"}
# 1404: {active: 1, play: 1, text:"Shop smart. Shop ____."}
# 1405: {active: 1, play: 1, text:"Hail to the ____, baby."}
# 1406: {active: 1, play: 1, text:"Good. Bad. I'm the guy with the ____."}
# 1407: {active: 1, play: 1, text:"How will we stop an army of the dead at our castle walls?"}
# 1408: {active: 1, play: 1, text:"I seek The Holy ____."}
# 1409: {active: 1, play: 1, text:"I see you have the machine that goes ____."}
# 1410: {active: 1, play: 1, text:"Every sperm is ____."}
# 1411: {active: 1, play: 1, text:"An African or European ____?"}
# 1412: {active: 1, play: 1, text:"Well you can't expect to wield supreme executive power just 'cause some watery tart threw a ____ at you!"}
# 1413: {active: 1, play: 1, text:"'____!' 'It's only a model.'"}
# 1414: {active: 1, play: 1, text:"Good night. Sleep well. I'll most likely ____ you in the morning."}
# 1415: {active: 1, play: 1, text:"I am The Dread Pirate ____."}
# 1416: {active: 1, play: 2, text:"Do you want me to send you back to where you were, ____ in ____?"}
# 1417: {active: 1, play: 1, text:"I see ____ people"}
# 1418: {active: 1, play: 1, text:"____? We don't need no stinking ____!"}
# 1419: {active: 1, play: 1, text:"These aren't the ____ you're looking for."}
# 1420: {active: 1, play: 1, text:"We're gonna need a bigger ____."}
# 1421: {active: 1, play: 1, text:"Beavis and Butthead Do ____."}
# 1422: {active: 1, play: 1, text:"I, for one, welcome our new ____ overlords."}
# 1423: {active: 1, play: 2, text:"You know, there's a million fine looking women in the world, dude. But they don't all bring you ____ at work. Most of 'em just ____."}
# 1424: {active: 1, play: 1, text:"Teenage Mutant Ninja ____."}
# 1425: {active: 1, play: 1, text:"Achy Breaky ____."}
# 1426: {active: 1, play: 1, text:"I'm not a ____, but I play one on TV"}
# 1427: {active: 1, play: 3, text:"____'s latest music video features a dozen ____ on ____."}
# 1428: {active: 1, play: 1, text:"____. Like a boss!"}
# 1429: {active: 1, play: 3, text:"In Soviet ____, ____ ____s you."}
# 1430: {active: 1, play: 1, text:"____. It's not just for breakfast anymore."}
# 1431: {active: 1, play: 1, text:"____. It's what's for dinner!"}
# 1432: {active: 1, play: 1, text:"____. Part of this nutritious breakfast."}
# 1433: {active: 1, play: 1, text:"____. Breakfast of champions!"}
# 1434: {active: 1, play: 1, text:"Where's the beef?"}
# 1435: {active: 1, play: 1, text:"Oh my god! They killed ____!"}
# 1436: {active: 1, play: 1, text:"I am not fat! I'm just ____."}
# 1437: {active: 1, play: 1, text:"Two by two, hands of ____."}
# 1438: {active: 1, play: 2, text:"____ was sent to save ____."}
# 1439: {active: 1, play: 1, text:"The anxiously awaited new season of Firefly is rumoured to kick off with an action packed scene, featuring River Tam's amazing feats of ____!"}
# 1440: {active: 1, play: 2, text:"I swear by my pretty floral ____, I will ____ you."}
# 1441: {active: 1, play: 1, text:"Wendy's ____ & Juicy."}
# 1442: {active: 1, play: 2, text:"I HATE it when ____(s) crawl(s) up my ____!"}
# 1443: {active: 1, play: 2, text:"At ____, where every day is ____ day!"}
# 1444: {active: 1, play: 1, text:"____ at last! ____ at last! Thank God almighty, I'm ____ at last! "}
# 1445: {active: 1, play: 1, text:"I have a dream that one day this nation will rise up and live out the true meaning of its creed:"}
# 1446: {active: 1, play: 2, text:"This year's ____ guest of honour is ____."}
# 1447: {active: 1, play: 1, text:"This will be the greatest ____con ever!"}
# 1448: {active: 1, play: 2, text:"____ is the new ____."}
# 1449: {active: 1, play: 1, text:"Bitches LOVE ____!"}
# 1450: {active: 1, play: 1, text:"The only good ____ is a dead ____."}
# 1451: {active: 1, play: 2, text:"A vote for ____ is a vote for ____."}
# 1452: {active: 1, play: 1, text:"Thou shalt not____."}
# 1453: {active: 1, play: 1, text:"I am the King of ____!"}
# 1454: {active: 1, play: 1, text:"Team ____!"}
# 1455: {active: 1, play: 1, text:"We went to a workshop on tantric ____."}
# 1456: {active: 1, play: 1, text:"My safeword is ____."}
# 1457: {active: 1, play: 2, text:"I like ____, but ____ is a hard limit!"}
# 1458: {active: 1, play: 2, text:"I ____, therefore I ____."}
# 1459: {active: 1, play: 1, text:"Welcome to my secret lair. I call it The Fortress of ____."}
# 1460: {active: 1, play: 1, text:"These are my minions of ____!"}
# 1461: {active: 1, play: 1, text:"____ doesn't need to be judged right now."}
# 1462: {active: 1, play: 2, text:"____ is a terrible thing to do to the ____!"}
# 1463: {active: 1, play: 2, text:"____ & ____: Worst mods ever."}
# 1464: {active: 1, play: 1, text:"/____ all over this post."}
# 1465: {active: 1, play: 1, text:"/____ delicately from the butt."}
# 1466: {active: 1, play: 1, text:"/slides hand up your ____."}
# 1467: {active: 1, play: 1, text:"____ is not an island."}
# 1468: {active: 1, play: 1, text:"____ runs into the forest, screaming."}
# 1469: {active: 1, play: 1, text:"____ was better before the anon meme."}
# 1470: {active: 1, play: 1, text:"We'd love to have you at ____ Island!"}
# 1471: {active: 1, play: 1, text:"Bad news guys, my parents found that thread involving ____."}
# 1472: {active: 1, play: 1, text:"But what are your thoughts on ____?"}
# 1473: {active: 1, play: 1, text:"Chaos ensued when Wankgate banned ____."}
# 1474: {active: 1, play: 1, text:"Cute, fun and ____."}
# 1475: {active: 1, play: 1, text:"Does anyone ____? I feel like the only one."}
# 1476: {active: 1, play: 1, text:"Excuse me, but I identify as ____."}
# 1477: {active: 1, play: 1, text:"Great, another ____ event."}
# 1478: {active: 1, play: 1, text:"How can there be a group of people more ____ than us?"}
# 1479: {active: 1, play: 1, text:"How's my driving?"}
# 1480: {active: 1, play: 1, text:"I can only ____ if I feel a deep emotional connection."}
# 1481: {active: 1, play: 1, text:"I can't believe we just spent a whole page wanking about ____."}
# 1482: {active: 1, play: 1, text:"I have a PHD in ____."}
# 1483: {active: 1, play: 1, text:"I just benchpressed, like, 14 ____."}
# 1484: {active: 1, play: 1, text:"I predict ____ will close by the end of the year."}
# 1485: {active: 1, play: 2, text:"I randomly began to ____ and ____ came galloping up the stairs."}
# 1486: {active: 1, play: 1, text:"I see Wankgate's bitching about ____ again."}
# 1487: {active: 1, play: 1, text:"I'm literally shaking and ____ right now."}
# 1488: {active: 1, play: 1, text:"I'm married to ____ on the astral plane."}
# 1489: {active: 1, play: 1, text:"I'm really into ____, so please don't kinkshame."}
# 1490: {active: 1, play: 1, text:"I'm sad we lost ____ in the exodus from LJ to DW."}
# 1491: {active: 1, play: 1, text:"I'm starting a game where the characters are stuck in ____."}
# 1492: {active: 1, play: 1, text:"I'm taking commissions for ____!"}
# 1493: {active: 1, play: 1, text:"How dare you not warn for ____! Don't you know how triggering that is?"}
# 1494: {active: 1, play: 3, text:"In this world, sexual roles are divided into three categories: the ____, the ____, and the ____"}
# 1495: {active: 1, play: 1, text:"It's ____ o'clock."}
# 1496: {active: 1, play: 1, text:"ITT: ____."}
# 1497: {active: 1, play: 1, text:"Join my new game about ____!"}
# 1498: {active: 1, play: 1, text:"Keep fucking that ____."}
# 1499: {active: 1, play: 1, text:"Let me tell you about ____."}
# 1500: {active: 1, play: 1, text:"Log in and ____."}
# 1501: {active: 1, play: 2, text:"My favorite thread is the one where ____ has kinky sex with ____."}
# 1502: {active: 1, play: 2, text:"My headcanon is that ____ is ____."}
# 1503: {active: 1, play: 2, text:"My OTP: ____ x ____."}
# 1504: {active: 1, play: 2, text:"New game idea! You're kidnapped by ____ and forced into ____."}
# 1505: {active: 1, play: 1, text:"no actually i don't care at all, i don't even ____. :))))"}
# 1506: {active: 1, play: 1, text:"OMG you guys I have so many feels about ____!"}
# 1507: {active: 1, play: 2, text:"Only ____ would play from ____."}
# 1508: {active: 1, play: 1, text:"Raising money for ____! Please replurk!"}
# 1509: {active: 1, play: 1, text:"RPAnons made me ____."}
# 1510: {active: 1, play: 1, text:"SHUT UP ABOUT YOUR ____."}
# 1511: {active: 1, play: 1, text:"Signal boosting for ____!"}
# 1512: {active: 1, play: 2, text:"Since ____ is on hiatus, fans have migrated to ____."}
# 1513: {active: 1, play: 1, text:"Someone just stuck their head out of the window and screamed '____'s UP!'"}
# 1514: {active: 1, play: 1, text:"Someone left a ____ out in the rain."}
# 1515: {active: 1, play: 1, text:"That ____. You know, *that* one."}
# 1516: {active: 1, play: 1, text:"The ____ is happy."}
# 1517: {active: 1, play: 1, text:"The perfect username for my next character: ____."}
# 1518: {active: 1, play: 1, text:"The thing I hate most about RP is ____."}
# 1519: {active: 1, play: 1, text:"Their ____ are of age."}
# 1520: {active: 1, play: 1, text:"There are too many memes about ____."}
# 1521: {active: 1, play: 1, text:"There is no ____ in Holly Heights."}
# 1522: {active: 1, play: 1, text:"We need a new post. This one smells like ____."}
# 1523: {active: 1, play: 1, text:"Why was I asked for app revisions?"}
# 1524: {active: 1, play: 1, text:"Why was I banned?"}
# 1525: {active: 1, play: 1, text:"Who apps ____ to a sex game?"}
# 1526: {active: 1, play: 1, text:"Who should I play next?"}
# 1527: {active: 1, play: 1, text:"You can't fist ____."}
# 1528: {active: 1, play: 1, text:"You sound ____, tbh."}
# 1529: {active: 1, play: 1, text:"Azerbaijan, Land of ____."}
# 1530: {active: 1, play: 1, text:"There's rumours of a country buying votes with ____."}
# 1531: {active: 1, play: 3, text:"Your ideal interval act."}
# 1532: {active: 1, play: 2, text:"This performance contains flashing images, ____ and ____."}
# 1533: {active: 1, play: 2, text:"Serbia entered magical girls. How horribly will their contract end?"}
# 1534: {active: 1, play: 2, text:"HELLO EUROPE, ____ CALLING! 12 POINTS GO TO ____!"}
# 1535: {active: 1, play: 1, text:"____. As guaranteed as Cyprus giving Greece 12 points."}
# 1536: {active: 1, play: 1, text:"Women kissing each other on stage, men kissing each other on stage, what next?"}
# 1537: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI goes from Eurovision winner, to participant, to score reader. Her next job is ____."}
# 1538: {active: 1, play: 2, text:"The correct procedure for listening to Fairytale is:"}
# 1539: {active: 1, play: 1, text:"Nothing can bring down Ruslana's chippy mood,, not even ____."}
# 1540: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI' chronic marrying spree added ____ to her victims list."}
# 1541: {active: 1, play: 1, text:"The BBC have decided to dig up another old relic and send ____ to represent the UK."}
# 1542: {active: 1, play: 1, text:"A (few) word(s) synonymous with Eurovision fans: ____"}
# 1543: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI is a man of many talents; he wins Eurovisions and ____."}
# 1544: {active: 1, play: 1, text:"Misheard lyrics of Verjamem resulted in people thinking PI:NAME:<NAME>END_PI Boto screeched ____."}
# 1545: {active: 1, play: 1, text:"This country has declined to participate due to ____."}
# 1546: {active: 1, play: 1, text:"I'm in loooooooove with a fairytaaaale, even thouuugh it ____."}
# 1547: {active: 1, play: 2, text:"In an attempt to foster friendly attitudes between ESC entrants, the host country made them ____ and ____."}
# 1548: {active: 1, play: 3, text:"The winning act had ____ and ____ as the singer belted out lyrics about ____."}
# 1549: {active: 1, play: 3, text:"Everybody out of the god damn way. You've got a heart full of ____, a soul full of ____, and a body full of ____."}
# 1550: {active: 1, play: 1, text:"____ would be a good name for a band."}
# 1551: {active: 1, play: 1, text:"____ wouldn't be funny if not for the irony."}
# 1552: {active: 1, play: 1, text:"Help, I'm trapped in a ____ factory!"}
# 1553: {active: 1, play: 1, text:"None of the places I floated to had ____."}
# 1554: {active: 1, play: 1, text:"____. My normal method is useless here."}
# 1555: {active: 1, play: 1, text:"We had a ____ party, but it turned out not to be very much fun."}
# 1556: {active: 1, play: 1, text:"My hobby: ____."}
# 1557: {active: 1, play: 1, text:"____ makes terrible pillow talk."}
# 1558: {active: 1, play: 1, text:"What is the best way to protect yourself from Velociraptors?"}
# 1559: {active: 1, play: 1, text:"I'm pretty sure you can't send ____ through the mail."}
# 1560: {active: 1, play: 1, text:"I'm like ____, except with love."}
# 1561: {active: 1, play: 3, text:"Spoiler Alert! ____ kills ____ with ____!"}
# 1562: {active: 1, play: 2, text:"I didn't actually want you to be ____; I just wanted you to be ____."}
# 1563: {active: 1, play: 1, text:"Do you really expect ____? No, PI:NAME:<NAME>END_PI. I expect you to die!"}
# 1564: {active: 1, play: 1, text:"What do we miss most from the internet in 1998?"}
# 1565: {active: 1, play: 1, text:"All of my algorithms were really just disguised ____."}
# 1566: {active: 1, play: 1, text:"Waking up would be a lot easier if ____ didn't look so much like you."}
# 1567: {active: 1, play: 1, text:"____? No, I'm not really into Pokémon."}
# 1568: {active: 1, play: 2, text:"I got a lot more interested in ____ when I made the connection to ____."}
# 1569: {active: 1, play: 1, text:"Dreaming about ____ in Cirque du Soleil."}
# 1570: {active: 1, play: 1, text:"When I eat ____, I like to pretend I'm a Turing machine."}
# 1571: {active: 1, play: 1, text:"Freestyle rapping is really just ____."}
# 1572: {active: 1, play: 1, text:"It turns out God created the universe using ____."}
# 1573: {active: 1, play: 1, text:"Human intelligence decreases with increasing proximity to ____."}
# 1574: {active: 1, play: 2, text:"If I could rearrange the alphabet, I'd put ____ and ____ together."}
# 1575: {active: 1, play: 1, text:"The #1 Programmer's excuse for legitimately slacking off: ____."}
# 1576: {active: 1, play: 2, text:"I like alter songs by replacing ____ with ____."}
# 1577: {active: 1, play: 2, text:"Ebay review: Instead of ____, package contained ____. Would not buy again."}
# 1578: {active: 1, play: 1, text:"Social rule 99.1: If friends spend more than 60 minutes deciding what to do, they must default to ____."}
# 1579: {active: 1, play: 1, text:"____ linked to Acne! 95% confidence."}
# 1580: {active: 1, play: 1, text:"How many Google results are there for 'Died in a ____ accident?'"}
# 1581: {active: 1, play: 1, text:"Real Programmers use ____."}
# 1582: {active: 1, play: 1, text:"After finding Higgs-Boson, I can always use the LHC for ____."}
# 1583: {active: 1, play: 1, text:"My health declined when I realized I could eat ____ whenever I wanted."}
# 1584: {active: 1, play: 2, text:"____ is just applied ____."}
# 1585: {active: 1, play: 1, text:"What's my favorite unit of measurement?"}
# 1586: {active: 1, play: 1, text:"In the extended base metaphor, shortstop is ____."}
# 1587: {active: 1, play: 2, text:"I don't actually care about ____, I just like ____."}
# 1588: {active: 1, play: 1, text:"Why do you have a crossbow in your desk?"}
# 1589: {active: 1, play: 3, text:"I set up script to buy things on ebay for $1, but then it bought ____, ____, and ____."}
# 1590: {active: 1, play: 1, text:"I can extrude ____, but I can't retract it."}
# 1591: {active: 1, play: 2, text:"____'s fetish: ____."}
# 1592: {active: 1, play: 1, text:"Now I have to live my whole life pretending ____ never happened. It's going to be a fun 70 years."}
# 1593: {active: 1, play: 1, text:"My new favorite game is Strip ____."}
# 1594: {active: 1, play: 1, text:"Did you know you can just buy ____?"}
# 1595: {active: 1, play: 3, text:"Take me down to the ____, where the ____ is green and the ____ are pretty."}
# 1596: {active: 1, play: 1, text:"____. That's right. Shit just got REAL."}
# 1597: {active: 1, play: 1, text:"Just because I have ____ doesn't mean you could milk me now. I'd have to be lactating."}
# 1598: {active: 1, play: 1, text:"2009 called? Did you warn them about ____?"}
# 1599: {active: 1, play: 1, text:"I'm going to name my child ____."}
# 1600: {active: 1, play: 1, text:"3D printers sound great until you receive spam containing actual ____."}
# 1601: {active: 1, play: 2, text:"Until I see more data, I'm going to assume ____ causes ____."}
# 1602: {active: 1, play: 1, text:"Did you know November is ____ Awareness Month?"}
# 1603: {active: 1, play: 1, text:"University Researchers create life in lab! ____ blamed!"}
# 1604: {active: 1, play: 1, text:"If you really hate someone, teach them to recognize ____."}
# 1605: {active: 1, play: 1, text:"____. So it has come to this."}
# 1606: {active: 1, play: 1, text:"Hey baby, wanna come back to my sex ____?"}
# 1607: {active: 1, play: 2, text:"The past is a foreign country... with ____ and ____!"}
# 1608: {active: 1, play: 2, text:"What role has social media played in ____? Well, it's certainly made ____ stupider."}
# 1609: {active: 1, play: 1, text:"____. It works in Kerbal Space Program."}
# 1610: {active: 1, play: 1, text:"____ is too big for small talk."}
# 1611: {active: 1, play: 1, text:"What did I suggest to the IAU for a new planet name?"}
# 1612: {active: 1, play: 2, text:"By 2019, ____ will be outnumbered by ____."}
# 1613: {active: 1, play: 1, text:"New movie this summer: ____ beats up everyone."}
# 1614: {active: 1, play: 1, text:"Revealed: Why He Really Resigned! Pope Benedict's Secret Struggle with ____!"}
# 1615: {active: 1, play: 2, text:"Here's what you can expect for the new year. Out: ____. In: ____."}
# 1616: {active: 1, play: 2, text:"According to the Daleks, ____ is better at ____."}
# 1617: {active: 1, play: 1, text:"I can't believe Netflix is using ____ to promote House of Cards."}
# 1618: {active: 1, play: 1, text:"I'm not going to lie. I despise ____. There, I said it."}
# 1619: {active: 1, play: 1, text:"A wise man said, 'Everything is about sex. Except sex. Sex is about ____.'"}
# 1620: {active: 1, play: 1, text:"Our relationship is strictly professional. Let's not complicate things with ____."}
# 1621: {active: 1, play: 2, text:"Because you enjoyed ____, we thought you'd like ____."}
# 1622: {active: 1, play: 1, text:"We're not like other news organizations. Here at Slugline, we welcome ____ in the office. "}
# 1623: {active: 1, play: 1, text:"Cancel all my meetings. We've got a situation with ____ that requires my immediate attention."}
# 1624: {active: 1, play: 1, text:"If you need him to, PI:NAME:<NAME>END_PI can pull some strings and get you ____, but it'll cost you."}
# 1625: {active: 1, play: 2, text:"Corruption. Betrayal. ____. Coming soon to Netflix, 'House of ____.'"}
# 1626: {active: 1, play: 1, text:"I filled my apartment with ____."}
# 1627: {active: 1, play: 2, text:"It's fun to mentally replace the word ____ with ____."}
# 1628: {active: 1, play: 1, text:"Next on GSN: 'The $100,000 ____.'"}
# 1629: {active: 1, play: 2, text:"Much ____. So ____. Wow."}
# 1630: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI have panned ____ as 'poorly conceived' and 'sloppily executed.'"}
# 1631: {active: 1, play: 1, text:"Up next on Nickelodeon: 'Clarissa Explains ____.'"}
# 1632: {active: 1, play: 1, text:"How did PI:NAME:<NAME>END_PI get her groove back?"}
# 1633: {active: 1, play: 1, text:"Believe it or not, PI:NAME:<NAME>END_PI can do a dead-on impression of ____."}
# 1634: {active: 1, play: 1, text:"It's Morphin' Time! Mastadon! Pterodactyl! Triceratops! Sabertooth Tiger! ____!"}
# 1635: {active: 1, play: 1, text:"Tonight on SNICK: 'Are You Afraid of ____?'"}
# 1636: {active: 1, play: 1, text:"What the hell?! They added a 6/6 with flying, trample, and ____."}
# 1637: {active: 1, play: 1, text:"I'm a bitch, I'm a lover, I'm a child, I'm ____."}
# 1638: {active: 1, play: 1, text:"____ was totally worth the trauma."}
# 1639: {active: 1, play: 2, text:"Let me tell you about my new startup. It's basically ____, but for ____."}
# 1640: {active: 1, play: 1, text:"Unfortunately, Neo, no one can be told what ____ is. You have to see it for yourself."}
# 1641: {active: 1, play: 1, text:"(Heavy breathing) Luke, I am ____."}
# 1642: {active: 1, play: 1, text:"You think you have defeated me? Well, let's see how you handle ____!"}
# 1643: {active: 1, play: 2, text:"____ is way better in ____ mode."}
# 1644: {active: 1, play: 2, text:"Nickelodeon's next kids' game show is '____', hosted by ____."}
# 1645: {active: 1, play: 1, text:"____ probably tastes better than Quiznos."}
# 1646: {active: 1, play: 1, text:"The Discovery Channel presents: ____ week."}
# 1647: {active: 1, play: 1, text:"Like ____, State Farm is there."}
# 1648: {active: 1, play: 1, text:"The Discovery Channel presents: ____ week."}
# 1649: {active: 1, play: 1, text:"Like ____, State Farm is there."}
# 1650: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's little-known first show was called 'The Joy of ____.'"}
# 1651: {active: 1, play: 1, text:"During my first game of D&D, I accidentally summoned ____."}
# 1652: {active: 1, play: 2, text:"In PI:NAME:<NAME>END_PI's new movie, PI:NAME:<NAME>END_PI discovers that ____ had really been ____ all along."}
# 1653: {active: 1, play: 1, text:"After PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI brought ____ to all the people of New Orleans."}
# 1654: {active: 1, play: 2, text:"PI:NAME:<NAME>END_PI's new three-hour action epic pits ____ against ____."}
# 1655: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI enjoys ____ on his food."}
# 1656: {active: 1, play: 1, text:"My new favorite porn star is PI:NAME:<NAME>END_PI '____' PI:NAME:<NAME>END_PI."}
# 1657: {active: 1, play: 1, text:"In his newest and most difficult stunt, PI:NAME:<NAME>END_PI must escape from ____."}
# 1658: {active: 1, play: 1, text:"Little Miss MuffPI:NAME:<NAME>END_PI Sat on a tuffet, Eating her curds and ____."}
# 1659: {active: 1, play: 1, text:"My country, 'tis of thee, sweet land of ____."}
# 1660: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI was ruined for me forever when my mom had to act out ____."}
# 1661: {active: 1, play: 1, text:"After the earthquake, PI:NAME:<NAME>END_PI brought ____ to the people of Haiti."}
# 1662: {active: 1, play: 1, text:"This holiday season, PI:NAME:<NAME>END_PI must overcome his fear of ____ to save Christmas."}
# 1663: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI is ____."}
# 1664: {active: 1, play: 1, text:"Dogimo would give up ____ to type a six sentence paragraph in a thread."}
# 1665: {active: 1, play: 1, text:"We need to talk about your whole gallon of ____."}
# 1666: {active: 1, play: 2, text:"A mod war about ____ occurred during ____."}
# 1667: {active: 1, play: 2, text:"____ was banned from tinychat because of ____."}
# 1668: {active: 1, play: 1, text:"Roses and her hammer collection defeated an entire squadron of ____."}
# 1669: {active: 1, play: 1, text:"Yaar's mother is ____."}
# 1670: {active: 1, play: 1, text:"VS: Where the ____ happens!"}
# 1671: {active: 1, play: 1, text:"____? FRY. EYES."}
# 1672: {active: 1, play: 1, text:"I'm under the ____."}
# 1673: {active: 1, play: 1, text:"Alcoholic games of Clue® lead to ____."}
# 1674: {active: 1, play: 1, text:"In the final round of this year's Omegathon, Omeganauts must face off in a game of ____."}
# 1675: {active: 1, play: 1, text:"I don't know exactly how I got the PAX plague, but I suspect it had something to do with ____."}
# 1676: {active: 1, play: 1, text:"Call the law offices of PI:NAME:<NAME>END_PIstein & Goldstein, because no one should have to tolerate ____ in the workplace."}
# 1677: {active: 1, play: 1, text:"To prepare for his upcoming role, PI:NAME:<NAME>END_PI immersed himself in the world of ____."}
# 1678: {active: 1, play: 1, text:"As part of his daily regimen, PI:NAME:<NAME>END_PI sets aside 15 minutes for ____."}
# 1679: {active: 1, play: 1, text:"As part of his contract, Prince won't perform without ____ in his dressing room."}
# 1680: {active: 1, play: 1, text:"____ caused Northernlion to take stupid damage."}
# 1681: {active: 1, play: 1, text:"____ Is the best item in The Binding of Isaac."}
# 1682: {active: 1, play: 1, text:"____ is the worst item in The Binding of Isaac."}
# 1683: {active: 1, play: 1, text:"____ is/are Northernlion's worst nightmare."}
# 1684: {active: 1, play: 1, text:"____: The Northernlion Story."}
# 1685: {active: 1, play: 1, text:"As always, I will ____ you next time!"}
# 1686: {active: 1, play: 2, text:"Lifetime® presents ____, the story of ____."}
# 1687: {active: 1, play: 1, text:"Dear PI:NAME:<NAME>END_PI, I'm having some trouble with ____ and would like your advice."}
# 1688: {active: 1, play: 1, text:"Even ____ is/are better at video games than Northernlion."}
# 1689: {active: 1, play: 1, text:"Everything's coming up ____."}
# 1690: {active: 1, play: 1, text:"Finding something like ____ would turn this run around."}
# 1691: {active: 1, play: 1, text:"I don't even see ____ anymore; all I see are blondes, brunettes, redheads..."}
# 1692: {active: 1, play: 1, text:"I'm in the permanent ____ state."}
# 1693: {active: 1, play: 1, text:"If sloth ____ are wrong I don’t want to be right."}
# 1694: {active: 1, play: 1, text:"JSmithOTI: Total ____."}
# 1695: {active: 1, play: 1, text:"Northernlion's latest novelty Twitter account is @____."}
# 1696: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI has been facing ridicule for calling ____ a rogue-like."}
# 1697: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI always forgets the name of ____."}
# 1698: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's refusal to Let's Play ____ was probably a good call."}
# 1699: {active: 1, play: 1, text:"Of all the things that PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI have in common, they bond together through their mutual love of ____."}
# 1700: {active: 1, play: 1, text:"Oh god, I can't believe we ate ____ at PAX."}
# 1701: {active: 1, play: 1, text:"One thing PI:NAME:<NAME>END_PI was right about was ____."}
# 1702: {active: 1, play: 1, text:"Recently, PI:NAME:<NAME>END_PIion has felt woefully insecure due to ____."}
# 1703: {active: 1, play: 1, text:"The stream was going well until ____."}
# 1704: {active: 1, play: 1, text:"The Youtube chat proved ineffective, so instead we had to communicate via ____."}
# 1705: {active: 1, play: 1, text:"Whenever I ___, take a drink."}
# 1706: {active: 1, play: 1, text:"The only way NL is ever going to make it to Hell in Spelunky is by using ____."}
# 1707: {active: 1, play: 1, text:"Welcome back to The Binding of Isaac. Today's challenge run will be based on ____."}
# 1708: {active: 1, play: 1, text:"Fox would still be here if not for ____."}
# 1709: {active: 1, play: 3, text:"I wasn't even that drunk! I just had some ____, ____, and ____."}
# 1710: {active: 1, play: 1, text:"What does Alucard have nightmares about?"}
# 1711: {active: 1, play: 2, text:"I beat Blue Baby with only ____ and ____!"}
# 1712: {active: 1, play: 2, text:"Northernlion has alienated fans of ____ by calling them ____."}
# 1713: {active: 1, play: 2, text:"Northernlion was fired from his teaching job and had to flee South Korea after an incident involving ____ and ____."}
# 1714: {active: 1, play: 3, text:"My original species combines ____ and ____. It's called ____."}
# 1715: {active: 1, play: 1, text:"Don't slow down in East Cleveland or ____."}
# 1716: {active: 1, play: 1, text:"Grand Theft Auto™: ____."}
# 1717: {active: 1, play: 2, text:"____ and ____ are the new hot couple."}
# 1718: {active: 1, play: 1, text:"What will Xyzzy take over the world with?"}
# 1719: {active: 1, play: 1, text:"Who is GLaDOS's next test subject?"}
# 1720: {active: 1, play: 1, text:"The next Assassin's Creed game will take place in ____."}
# 1721: {active: 1, play: 2, text:"I wouldn't fuck ____ with ____'s dick."}
# 1722: {active: 1, play: 1, text:"In the next Punch Out!!, ____ will be the secret final boss."}
# 1723: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI demands more ____ in StarCraft®."}
# 1724: {active: 1, play: 1, text:"To top One More Day, future comic writers will use ____ to break up a relationship."}
# 1725: active: 1, {play: 1, text:"The real reason MAGFest was ruined was ____."}
# 1726: {active: 1, play: 2, text:"For the next Anniversary event, the TGWTG producers must battle ____ to get ____."}
# 1727: {active: 1, play: 2, text:"I write slash fanfiction pairing ____ with ____."}
# 1728: {active: 1, play: 2, text:"Next time on Obscurus Lupa Presents: ' ____ IV: The Return of ____'."}
# 1729: {active: 1, play: 2, text:"Todd in the Shadows broke the Not a Rhyme button when the singer tried to rhyme ____ with ____."}
# 1730: {active: 1, play: 2, text:"Welshy is to ____ as Sad Panda is to ____."}
# 1731: {active: 1, play: 1, text:"What is hidden in Linkara's hat?"}
# 1732: {active: 1, play: 1, text:"What was the first sign that Linkara was turning evil?"}
# 1733: {active: 1, play: 1, text:"When interviewing Linkara, be sure to ask him about ____!"}
# 1734: {active: 1, play: 3, text:"Write Linkara's next storyline as a haiku."}
# 1735: {active: 1, play: 1, text:"The reason Linkara doesn't like milk in his cereal is ____."}
# 1736: {active: 1, play: 1, text:"The secret of Linkara's magic gun is ____."}
# 1737: {active: 1, play: 2, text:"I asked Linkara to retweet ____, but instead, he retweeted ____."}
# 1738: {active: 1, play: 2, text:"Linkara's next story arc will involve him defeating ____ with the power of ____."}
# 1739: {active: 1, play: 1, text:"Being fed up with reviewing lamps, what obscure topic did Linkara review next?"}
# 1740: {active: 1, play: 1, text:"Why does Linkara have all of those Cybermats?"}
# 1741: {active: 1, play: 1, text:"At his next con appearance, Linkara will cosplay as ____."}
# 1742: {active: 1, play: 1, text:"What does Linkara eat with his chicken strips?"}
# 1743: {active: 1, play: 2, text:"____ and ____ are in the worst comic Linkara ever read."}
# 1744: {active: 1, play: 1, text:"____ is the reason Linkara doesn't like to swear."}
# 1745: {active: 1, play: 1, text:"The only thing Linkara would sell his soul for is ____."}
# 1746: {active: 1, play: 1, text:"In a surprise twist, the villain of Linkara's next story arc turned out to be ____."}
# 1747: {active: 1, play: 1, text:"Linkara now prefers to say ____ in lieu of 'fuck'."}
# 1748: {active: 1, play: 1, text:"____ will be Linkara's next cosplay."}
# 1749: {active: 1, play: 1, text:"An intervention was staged for PI:NAME:<NAME>END_PIara after ____ was discovered in his hat."}
# 1750: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PIara was shocked when he found out Insano was secretly ____."}
# 1751: {active: 1, play: 1, text:"Linkara's Yu-Gi-Oh deck is built up with nothing but ____."}
# 1752: {active: 1, play: 1, text:"Why was Radio Dead Air shut down this time?"}
# 1753: {active: 1, play: 1, text:"During his childhood, PI:NAME:<NAME>END_PIí produced hundreds of paintings of ____."}
# 1754: {active: 1, play: 2, text:"Rumor has it that PI:NAME:<NAME>END_PI's favorite delicacy is ____ stuffed with ____."}
# 1755: {active: 1, play: 1, text:"____, by Bad Dragon™."}
# 1756: {active: 1, play: 2, text:"Arlo P. Arlo's newest weapon combines ____ and ____!"}
# 1757: {active: 1, play: 1, text:"____ is something else Diamanda Hagan has to live with every day."}
# 1758: {active: 1, play: 1, text:"As part of a recent promotion, Japanese KFCs are now dressing their Colonel Sanders statues up as ____."}
# 1759: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI Tries ____."}
# 1760: {active: 1, play: 1, text:"Enemies of Diamanda Hagan have been known to receive strange packages filled with ____."}
# 1761: {active: 1, play: 1, text:"What else does Diamanda Hagan have to live with every day?"}
# 1762: {active: 1, play: 1, text:"What's the real reason nobody has ever played the TGWTG Panel Drinking Game?"}
# 1763: {active: 1, play: 1, text:"When PI:NAME:<NAME>END_PI isn't talking he's ____."}
# 1764: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's latest family film is about a young boy befriending ____."}
# 1765: {active: 1, play: 1, text:"What is moé?"}
# 1766: {active: 1, play: 2, text:"Make a yaoi shipping."}
# 1767: {active: 1, play: 3, text:"On a night out, Golby will traditionally get into a fight with a ____ then have sex with a ____ before complaining about a hangover from too much ____."}
# 1768: {active: 1, play: 1, text:"At the last PAX, PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI had ____ thrown at them during 'Opening Band'."}
# 1769: {active: 1, play: 1, text:"What did the commenters bitch about next to Doug?"}
# 1770: {active: 1, play: 1, text:"The RDA chat knew PI:NAME:<NAME>END_PI was trolling them when he played ____."}
# 1771: {active: 1, play: 3, text:"Every weekend, Golby likes to ____ then ____ before finally ____."}
# 1772: {active: 1, play: 3, text:"Every weekend, Golby enjoys drinking ____ before getting into a fight with ____ and having sex with ____."}
# 1773: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI the Condor often doesn't talk on skype because of ____."}
# 1774: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI CPI:NAME:<NAME>END_PIi most definitely enjoys ____."}
# 1775: {active: 1, play: 1, text:"It's DJ PI:NAME:<NAME>END_PI in the hizouse, playing ____ all night long!"}
# 1776: {active: 1, play: 2, text:"____ + ____ = PI:NAME:<NAME>END_PI."}
# 1777: {active: 1, play: 1, text:"____ was the first thing to go when Hagan took over the world."}
# 1778: {active: 1, play: 1, text:"What broke PI:NAME:<NAME>END_PI this week?"}
# 1779: {active: 1, play: 1, text:"In his latest review, Phelous was killed by ____."}
# 1780: {active: 1, play: 1, text:"This weekend, the nation of Haganistan will once again commence its annual celebration of ____. "}
# 1781: {active: 1, play: 1, text:"What is the real reason Demo Reel failed?"}
# 1782: {active: 1, play: 1, text:"To troll the RDA chat this time, PI:NAME:<NAME>END_PI requested a song by ____."}
# 1783: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI knew he didn't have a chance after trying to seduce Lupa with ____."}
# 1784: {active: 1, play: 1, text:"Turns out, that wasn't tea in MikeJ's cup, it was ____."}
# 1785: {active: 1, play: 1, text:"Viewers were shocked when PI:NAME:<NAME>END_PIaw declared ____ the best song of the movie."}
# 1786: {active: 1, play: 1, text:"Well, I've read enough fanfic about ____ and Lupa to last a lifetime."}
# 1787: {active: 1, play: 1, text:"What does PI:NAME:<NAME>END_PI like to sing about?"}
# 1788: {active: 1, play: 1, text:"What does PI:NAME:<NAME>END_PI look like under his mask?"}
# 1789: {active: 1, play: 1, text:"What will PI:NAME:<NAME>END_PI name her next hippo?"}
# 1790: {active: 1, play: 1, text:"Cindi suddenly turned into Steven after ____."}
# 1791: {active: 1, play: 1, text:"In the latest chapter of Toriko, our hero hunts down, kills, and eats a creature made entirely of ____."}
# 1792: {active: 1, play: 1, text:"The rarest Pokémon in my collection is ____."}
# 1793: {active: 1, play: 1, text:"Mamoru Oshii's latest film is a slow-paced, two hour-long cerebral piece about the horrors of ____."}
# 1794: {active: 1, play: 1, text:"The next big Tokusatsu show: 'Super Sentai ____ Ranger!'"}
# 1795: {active: 1, play: 1, text:"In the latest chapter of Golgo 13, he kills his target with ____."}
# 1796: {active: 1, play: 3, text:"In the latest episode of Case Closed, Conan deduces that it was ____ who killed ____ because of ____."}
# 1797: {active: 1, play: 1, text:"Behold the name of my Zanpakuto, ____!"}
# 1798: {active: 1, play: 1, text:"What do PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI like to do after a long day?"}
# 1799: {active: 1, play: 1, text:"Yoko Kanno's latest musical score features a song sung entirely by ____."}
# 1800: {active: 1, play: 1, text:"Who placed first in the most recent Shonen Jump popularity poll?"}
# 1801: {active: 1, play: 3, text:"In this episode of Master KePI:NAME:<NAME>END_PI, Keaton builds ____ out of ____ and ____."}
# 1802: {active: 1, play: 1, text:"So just who is this PI:NAME:<NAME>END_PI fellow, anyway?"}
# 1803: {active: 1, play: 1, text:"When PI:NAME:<NAME>END_PI is alone and thinks that no one's looking, he secretly enjoys ____."}
# 1804: {active: 1, play: 1, text:"In her newest review, PI:NAME:<NAME>END_PI finds herself in the body of ____."}
# 1805: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI's nickname for PI:NAME:<NAME>END_PI's older brother is ____."}
# 1806: {active: 1, play: 2, text:"____ has won the national Equestrian award for ____."}
# 1807: {active: 1, play: 1, text:"Every Morning, PI:NAME:<NAME>END_PI Rises ____."}
# 1808: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI was shocked to find ____ in her mailbox."}
# 1809: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI didn't help in the fight against Chrysalis because she was too busy with ____."}
# 1810: {active: 1, play: 1, text:"Not many people know that PI:NAME:<NAME>END_PI is also the voice of ____."}
# 1811: {active: 1, play: 1, text:"Everypony was shocked to discover that Scootaloo's cutie mark was ____."}
# 1812: {active: 1, play: 3, text:"In a fit of rage, PI:NAME:<NAME>END_PI CelePI:NAME:<NAME>END_PI sent ____ to the ____ for ____."}
# 1813: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PIville was shocked to discover ____ in Fluttershy's shed."}
# 1814: {active: 1, play: 1, text:"Prince Blueblood's cutie mark represents ____."}
# 1815: {active: 1, play: 1, text:"Rainbow Dash has always wanted ____."}
# 1816: {active: 1, play: 1, text:"Rainbow Dash is the only pony in all of Equestria who can ____."}
# 1817: {active: 1, play: 1, text:"Rainbow Dash received a concussion after flying into ____."}
# 1818: {active: 1, play: 1, text:"Super Speedy ____ Squeezy 5000."}
# 1819: {active: 1, play: 1, text:"Surprisingly, Canterlot has a museum of ____."}
# 1820: {active: 1, play: 1, text:"The Everfree forest is full of ____."}
# 1821: {active: 1, play: 1, text:"The national anthem of Equestria is ____."}
# 1822: {active: 1, play: 1, text:"The only way to get Opal in the bath is with ____."}
# 1823: {active: 1, play: 2, text:"The worst mishap caused by PI:NAME:<NAME>END_PI was when she made ____ and ____ fall in love."}
# 1824: {active: 1, play: 1, text:"To much controversy, PI:NAME:<NAME>END_PI made ____ illegal."}
# 1825: {active: 1, play: 2, text:"Today, PI:NAME:<NAME>END_PI announced her official campaign position on ____ and ____. No pony was the least bit surprised."}
# 1826: {active: 1, play: 1, text:"Twilight got bored with the magic of friendship, and now studies the magic of ____."}
# 1827: {active: 1, play: 1, text:"Twilight Sparkle owns far more books on ____ than she'd like to admit."}
# 1828: {active: 1, play: 1, text:"If PI:NAME:<NAME>END_PI spoke, what would he talk about?"}
# 1829: {active: 1, play: 1, text:"Wake up, PI:NAME:<NAME>END_PI. Wake up and ____."}
# 1830: {active: 1, play: 1, text:"Without any warning, Pinkie Pie burst into a song about ____."}
# 1831: {active: 1, play: 1, text:"You're a human transported to Equestria! The first thing you'd look for is ____."}
# 1832: {active: 1, play: 1, text:"As a way of apologizing for a poorly received episode, PI:NAME:<NAME>END_PI promised to review ____."}
# 1833: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI has a new dance move called ____."}
# 1834: {active: 1, play: 1, text:"Even PI:NAME:<NAME>END_PI thinks ____ is pretentious."}
# 1835: {active: 1, play: 1, text:"Here There Be ____."}
# 1836: {active: 1, play: 1, text:"Hey kids, I'm PI:NAME:<NAME>END_PI, and I couldn't make ____ up if I tried."}
# 1837: {active: 1, play: 1, text:"Hey PI:NAME:<NAME>END_PI, whatcha playin'?"}
# 1838: {active: 1, play: 1, text:"How is PI:NAME:<NAME>END_PI going to creep out Ask That Guy this time? "}
# 1839: {active: 1, play: 1, text:"In his most recent Avatar vlog, PI:NAME:<NAME>END_PI's favorite thing about the episode was ____."}
# 1840: {active: 1, play: 1, text:"In the newest Cheap Damage, CR looks at the trading card game version of ____."}
# 1841: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI almost named his show PI:NAME:<NAME>END_PIenegade ____."}
# 1842: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI proved he was still part of the site by____."}
# 1843: {active: 1, play: 1, text:"On the next WTFIWWY, Nash will give us a brief history of ____."}
# 1844: {active: 1, play: 1, text:"The last time Welshy and Film Brain were in a room together, they ended up ____."}
# 1845: {active: 1, play: 1, text:"This week, Nash's beer is made with ____."}
# 1846: {active: 1, play: 1, text:"What did PI:NAME:<NAME>END_PIoug bring to the set of To Boldly Flee?"}
# 1847: {active: 1, play: 1, text:"What does Ven have to do now?"}
# 1848: {active: 1, play: 1, text:"What hot, trendy new dance will feature in Paw's next Dance Spectacular?"}
# 1849: {active: 1, play: 1, text:"What is Snowflame's only known weakness?"}
# 1850: {active: 1, play: 1, text:"What new upgrade did Nash give Laura?"}
# 1851: {active: 1, play: 1, text:"What will Nash try to kill next with his hammer?"}
# 1852: {active: 1, play: 1, text:"When PI:NAME:<NAME>END_PI Orc turns into a werewolf, he likes to snack on ____."}
# 1853: {active: 1, play: 1, text:"When not reviewing or ruling Haganistan with an iron fist, Hagan's hobby is ____."}
# 1854: {active: 1, play: 1, text:"Who REALLY called PI:NAME:<NAME>END_PI to help him snap out of his ennui?"}
# 1855: {active: 1, play: 1, text:"Whose ass did PI:NAME:<NAME>END_PI kick this time?"}
# 1856: {active: 1, play: 1, text:"Why did PI:NAME:<NAME>END_PI go to Chicago?"}
# 1857: {active: 1, play: 1, text:"Why doesn't PI:NAME:<NAME>END_PI ever attend MAGFest?"}
# 1858: {active: 1, play: 1, text:"Why doesn't PI:NAME:<NAME>END_PIm Brain have an actual reviewer costume?"}
# 1859: {active: 1, play: 2, text:"The MAGFest Nerf War took a dark turn when ____ was waylaid by ____."}
# 1860: {active: 1, play: 2, text:"For a late night snack, PI:NAME:<NAME>END_PI made a sandwich of ____ and ____."}
# 1861: {active: 1, play: 2, text:"At ConBravo, ____ will be hosting a panel on ____."}
# 1862: {active: 1, play: 2, text:"Sad Panda is actually ____ and ____."}
# 1863: {active: 1, play: 2, text:"After ____, Phelous regenerated into ____. "}
# 1864: {active: 1, play: 1, text:"The stream broke when Ryuka stepped on the ____ key."}
# 1865: {active: 1, play: 1, text:"Krazy MPI:NAME:<NAME>END_PI lost to ____!"}
# 1866: {active: 1, play: 1, text:"What would you do if PI:NAME:<NAME>END_PIhm really did just die?"}
# 1867: {active: 1, play: 1, text:"JSmithOTI is referred to as a Scumlord, but his friends call him ____."}
# 1868: {active: 1, play: 1, text:"Follow MichaelALFox on Twitter and you can see pictures of ____."}
# 1869: {active: 1, play: 1, text:"After Mars, ____ is the next furthest planet from the sun."}
# 1870: {active: 1, play: 1, text:"What would PI:NAME:<NAME>END_PIhm do?"}
# 1871: {active: 1, play: 1, text:"Northernlion's cat Ryuka is known for ____ while he records."}
# 1872: {active: 1, play: 1, text:"What gave PI:NAME:<NAME>END_PIwPI:NAME:<NAME>END_PIcker his gaming powers?"}
# 1873: {active: 1, play: 2, text:"It's true that Green9090 is ____, but we must all admit that PI:NAME:<NAME>END_PIhm is better at ____"}
# 1874: {active: 1, play: 2, text:"Today on Crusader Kings 2, NL plays King ____ the ____."}
# 1875: {active: 1, play: 2, text:"After winning yet another race, PI:NAME:<NAME>END_PI made ____ tweet about ____."}
# 1876: {active: 1, play: 1, text:"What can be found in Arin's chins?"}
# 1877: {active: 1, play: 1, text:"What do PI:NAME:<NAME>END_PIumbo's magic words mean?"}
# 1878: {active: 1, play: 1, text:"What's better than Skyward Sword?"}
# 1879: {active: 1, play: 1, text:"What's the real reason PI:NAME:<NAME>END_PI left?"}
# 1880: {active: 1, play: 1, text:"Who replaced PI:NAME:<NAME>END_PI when he left GameGrumps?"}
# 1881: {active: 1, play: 1, text:"Why is Steam Train so controversial?"}
# 1882: {active: 1, play: 1, text:"This time on Guest Grumps, we have ____."}
# 1883: {active: 1, play: 1, text:"Top five games, go! 1? Mega Man X. 2-5? ____."}
# 1884: {active: 1, play: 1, text:"Next time on Game Grumps, ____!"}
# 1885: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI suck at ____."}
# 1886: {active: 1, play: 1, text:"PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI win! They realize ____ is more important."}
# 1887: {active: 1, play: 1, text:"How many ____ does Mega Man get?"}
# 1888: {active: 1, play: 1, text:"Game Grumps: sponsored by ____."}
# 1889: {active: 1, play: 1, text:"____. Put that in, PI:NAME:<NAME>END_PI."}
# 1890: {active: 1, play: 1, text:"'These new ____ t-shirts are gonna change some lives, PI:NAME:<NAME>END_PI.'"}
# 1891: {active: 1, play: 1, text:"____ Grumps!"}
# 1892: {active: 1, play: 1, text:"____ is Jon's favorite video game of all time."}
# 1893: {active: 1, play: 1, text:"____ is not Jon's strong suit."}
# 1894: {active: 1, play: 2, text:"The Grumps' latest silly player names are ____ and ____."}
# 1895: {active: 1, play: 2, text:"In this corner, ____; in the other corner, ____; it's Game Grumps VS!"}
# 1896: {active: 1, play: 1, text:"____ is probably a Venusaur kind of guy."}
# 1897: {active: 1, play: 1, text:"If PI:NAME:<NAME>END_PI was frog and you kissed him, what would he turn into?"}
# 1898: {active: 1, play: 1, text:"The next RvB cameo will be voiced by ____."}
# 1899: {active: 1, play: 1, text:"They questioned PI:NAME:<NAME>END_PI's sanity after finding ____ in his house."}
# 1900: {active: 1, play: 1, text:"What does PI:NAME:<NAME>END_PI's kid listen to?"}
# 1901: {active: 1, play: 1, text:"What makes PI:NAME:<NAME>END_PI the angriest?"}
# 1902: {active: 1, play: 1, text:"What mysteries lie beyond PI:NAME:<NAME>END_PI's beard? "}
# 1903: {active: 1, play: 1, text:"What's in PI:NAME:<NAME>END_PIavin's desk?"}
# 1904: {active: 1, play: 1, text:"Where does PI:NAME:<NAME>END_PI belong?"}
# 1905: {active: 1, play: 1, text:"Why is PI:NAME:<NAME>END_PI cool?"}
# 1906: {active: 1, play: 1, text:"Why was PI:NAME:<NAME>END_PI screaming at PI:NAME:<NAME>END_PI?"}
# 1907: {active: 1, play: 2, text:"Buzzfeed presents: 10 pictures of ____ that look like ____."}
}
|
[
{
"context": "xec()\n\n user = new User(\n email : \"user@user.com\"\n firstName: \"Full Name\"\n lastName ",
"end": 461,
"score": 0.9999165534973145,
"start": 448,
"tag": "EMAIL",
"value": "user@user.com"
},
{
"context": " email : \"user@user.com\"\n firstName: \"Full Name\"\n lastName : \"Last Name\"\n pass",
"end": 487,
"score": 0.5580623745918274,
"start": 483,
"tag": "NAME",
"value": "Full"
},
{
"context": " firstName: \"Full Name\"\n lastName : \"Last Name\"\n password : \"pass11\"\n )\n u",
"end": 518,
"score": 0.5192146301269531,
"start": 514,
"tag": "NAME",
"value": "Last"
},
{
"context": " lastName : \"Last Name\"\n password : \"pass11\"\n )\n user.save()\n\n shop = new Shop",
"end": 551,
"score": 0.9993610978126526,
"start": 545,
"tag": "PASSWORD",
"value": "pass11"
},
{
"context": "save()\n\n shop = new Shop(\n email : \"shop@shop.com\"\n name : \"shop name\"\n password: ",
"end": 635,
"score": 0.9999179840087891,
"start": 622,
"tag": "EMAIL",
"value": "shop@shop.com"
},
{
"context": "\n name : \"shop name\"\n password: \"pass11\"\n )\n shop.save()\n\n deal = new Deal",
"end": 692,
"score": 0.9993197321891785,
"start": 686,
"tag": "PASSWORD",
"value": "pass11"
},
{
"context": "data correctly\", (done) ->\n deal.name = 'Deal name update'\n deal.save()\n done()\n\n af",
"end": 2199,
"score": 0.8442795276641846,
"start": 2183,
"tag": "NAME",
"value": "Deal name update"
}
] | test/deal/model.coffee | gertu/gertu | 1 | should = require "should"
app = require "../../server"
mongoose = require "mongoose"
Deal = mongoose.model "Deal"
User = mongoose.model "User"
Shop = mongoose.model "Shop"
deal = undefined
user = undefined
shop = undefined
describe "<Unit test>", ->
describe "Model Deal:", ->
before (done) ->
Deal.remove().exec()
User.remove().exec()
Shop.remove().exec()
user = new User(
email : "user@user.com"
firstName: "Full Name"
lastName : "Last Name"
password : "pass11"
)
user.save()
shop = new Shop(
email : "shop@shop.com"
name : "shop name"
password: "pass11"
)
shop.save()
deal = new Deal(
name : "deal name"
description : "This is a fake deal"
price : 20
gertuprice : 10
discount : 50
shop : shop._id
categoryname: "Category Name"
quantity : 20
)
done()
describe "Method Save", ->
it "should be able to begin with no deals", (done) ->
Deal.find {}, (error, deals) ->
deals.should.have.length 0
done()
it "should be able to add a deal", (done) ->
deal.save done
it "should now have a deal", (done) ->
Deal.find {}, (error, deals) ->
deals.should.have.length 1
done()
it "should now have a deal with all data correct", (done) ->
Deal.find {}, (error, deals) ->
deals[0].should.have.property "name", deal.name
deals[0].should.have.property "description", deal.description
deals[0].should.have.property "price", deal.price
deals[0].should.have.property "gertuprice", deal.gertuprice
deals[0].should.have.property "discount", deal.discount
deals[0].should.have.property "shop", deal.shop
deals[0].should.have.property "categoryname", deal.categoryname
deals[0].should.have.property "quantity", deal.quantity
done()
it "should update data correctly", (done) ->
deal.name = 'Deal name update'
deal.save()
done()
after (done) ->
Deal.remove().exec()
User.remove().exec()
Shop.remove().exec()
done() | 41367 | should = require "should"
app = require "../../server"
mongoose = require "mongoose"
Deal = mongoose.model "Deal"
User = mongoose.model "User"
Shop = mongoose.model "Shop"
deal = undefined
user = undefined
shop = undefined
describe "<Unit test>", ->
describe "Model Deal:", ->
before (done) ->
Deal.remove().exec()
User.remove().exec()
Shop.remove().exec()
user = new User(
email : "<EMAIL>"
firstName: "<NAME> Name"
lastName : "<NAME> Name"
password : "<PASSWORD>"
)
user.save()
shop = new Shop(
email : "<EMAIL>"
name : "shop name"
password: "<PASSWORD>"
)
shop.save()
deal = new Deal(
name : "deal name"
description : "This is a fake deal"
price : 20
gertuprice : 10
discount : 50
shop : shop._id
categoryname: "Category Name"
quantity : 20
)
done()
describe "Method Save", ->
it "should be able to begin with no deals", (done) ->
Deal.find {}, (error, deals) ->
deals.should.have.length 0
done()
it "should be able to add a deal", (done) ->
deal.save done
it "should now have a deal", (done) ->
Deal.find {}, (error, deals) ->
deals.should.have.length 1
done()
it "should now have a deal with all data correct", (done) ->
Deal.find {}, (error, deals) ->
deals[0].should.have.property "name", deal.name
deals[0].should.have.property "description", deal.description
deals[0].should.have.property "price", deal.price
deals[0].should.have.property "gertuprice", deal.gertuprice
deals[0].should.have.property "discount", deal.discount
deals[0].should.have.property "shop", deal.shop
deals[0].should.have.property "categoryname", deal.categoryname
deals[0].should.have.property "quantity", deal.quantity
done()
it "should update data correctly", (done) ->
deal.name = '<NAME>'
deal.save()
done()
after (done) ->
Deal.remove().exec()
User.remove().exec()
Shop.remove().exec()
done() | true | should = require "should"
app = require "../../server"
mongoose = require "mongoose"
Deal = mongoose.model "Deal"
User = mongoose.model "User"
Shop = mongoose.model "Shop"
deal = undefined
user = undefined
shop = undefined
describe "<Unit test>", ->
describe "Model Deal:", ->
before (done) ->
Deal.remove().exec()
User.remove().exec()
Shop.remove().exec()
user = new User(
email : "PI:EMAIL:<EMAIL>END_PI"
firstName: "PI:NAME:<NAME>END_PI Name"
lastName : "PI:NAME:<NAME>END_PI Name"
password : "PI:PASSWORD:<PASSWORD>END_PI"
)
user.save()
shop = new Shop(
email : "PI:EMAIL:<EMAIL>END_PI"
name : "shop name"
password: "PI:PASSWORD:<PASSWORD>END_PI"
)
shop.save()
deal = new Deal(
name : "deal name"
description : "This is a fake deal"
price : 20
gertuprice : 10
discount : 50
shop : shop._id
categoryname: "Category Name"
quantity : 20
)
done()
describe "Method Save", ->
it "should be able to begin with no deals", (done) ->
Deal.find {}, (error, deals) ->
deals.should.have.length 0
done()
it "should be able to add a deal", (done) ->
deal.save done
it "should now have a deal", (done) ->
Deal.find {}, (error, deals) ->
deals.should.have.length 1
done()
it "should now have a deal with all data correct", (done) ->
Deal.find {}, (error, deals) ->
deals[0].should.have.property "name", deal.name
deals[0].should.have.property "description", deal.description
deals[0].should.have.property "price", deal.price
deals[0].should.have.property "gertuprice", deal.gertuprice
deals[0].should.have.property "discount", deal.discount
deals[0].should.have.property "shop", deal.shop
deals[0].should.have.property "categoryname", deal.categoryname
deals[0].should.have.property "quantity", deal.quantity
done()
it "should update data correctly", (done) ->
deal.name = 'PI:NAME:<NAME>END_PI'
deal.save()
done()
after (done) ->
Deal.remove().exec()
User.remove().exec()
Shop.remove().exec()
done() |
[
{
"context": "nfig = defaults global.config, conf, \n key: 'config'\n exchange: 'poloniex'\n simulation: tru",
"end": 19406,
"score": 0.6964372992515564,
"start": 19400,
"tag": "KEY",
"value": "config"
}
] | lab.coffee | invisible-college/meth | 7 | fs = require 'fs'
progress_bar = require('progress')
mathjs = require 'mathjs'
require './shared'
history = require './trade_history'
exchange = require './exchange'
global.pusher = require './pusher'
crunch = require './crunch'
global.position_status = {}
#########################
# Main event loop
simulate = (ts, callback) ->
ts = Math.floor(ts)
time = from_cache('time')
extend time,
earliest: ts - config.length
latest: ts
save time
global.tick = tick =
time: 0
global.t_ =
qtick: 0
hustle: 0
exec: 0
feature_tick: 0
eval_pos: 0
check_new: 0
check_exit: 0
check_unfilled: 0
balance: 0
pos_status: 0
# gc: 0
# x: 0
# y: 0
# z: 0
# a: 0
# b: 0
# c: 0
price_data = fetch('price_data')
start = ts - config.length - history.longest_requested_history
tick.time = ts - config.length
tick.start = start
history.advance tick.time
start_idx = history.trade_idx
balance = from_cache('balances')
extend balance,
updated: 0
balances:
c1: 0
c2: 0
deposits:
c1: 0
c2: 0
accounted_for:
c1: 0
c2: 0
on_order:
c1: 0
c2: 0
exchange.get_my_exchange_fee {}, (fees) ->
balance.maker_fee = fees.maker_fee
balance.taker_fee = fees.taker_fee
dealers = get_dealers()
$c2 = price_data.c2?[0].close or price_data.c1xc2[0].close
$c1 = price_data.c1?[0].close or 1
for dealer in dealers
settings = from_cache(dealer).settings
budget = settings.$budget or 100
if config.deposit_allocation == '50/50'
c1_budget = budget * (1 - (settings.ratio or .5) ) / $c1
c2_budget = budget * (settings.ratio or .5) / $c2
else if config.deposit_allocation == 'c1'
c1_budget = budget * .98 / $c1
c2_budget = budget * .02 / $c2
else if config.deposit_allocation == 'c2'
c1_budget = budget * .02 / $c1
c2_budget = budget * .98 / $c2
balance[dealer] =
balances:
c2: c2_budget
c1: c1_budget
deposits:
c2: c2_budget
c1: c1_budget
accounted_for:
c1: 0
c2: 0
on_order:
c1: 0
c2: 0
balance.balances.c2 += balance[dealer].balances.c2
balance.balances.c1 += balance[dealer].balances.c1
balance.deposits.c2 += balance[dealer].deposits.c2
balance.deposits.c1 += balance[dealer].deposits.c1
save balance
balance = bus.fetch 'balances'
t = ':perperper% :perbytrade% :etas :elapsed :ticks'
for k,v of t_
t += " #{k}-:#{k}"
bar = new progress_bar t,
complete: '='
incomplete: ' '
width: 40
renderThrottle: 500
total: Math.ceil (time.latest - time.earliest) / (.0 * pusher.tick_interval_no_unfilled + 1.0 * pusher.tick_interval)
ticks = 0
started_at = Date.now()
price_idx = 0
end = ->
history.trades = [] # free memory
if global.gc
global.gc()
else
console.log('Garbage collection unavailable. Pass --expose-gc.');
if config.produce_heapdump
try
heapdump = require('heapdump')
heapdump.writeSnapshot()
catch e
console.log 'Could not take snapshot'
log_results()
console.time('saving db')
global.timerrrr = Date.now()
save balance
for name in (get_all_actors() or [])
d = from_cache name
save d
console.timeEnd('saving db')
if config.log_level > 1
console.log "\nDone simulating! That took #{(Date.now() - started_at) / 1000} seconds"
console.log config if config.persist
console.log "PORT: #{bus.port}"
callback?()
one_tick = ->
t = Date.now()
has_unfilled = false
for dealer,positions of open_positions when positions.length > 0
for pos in positions
if (pos.entry && !pos.entry.closed) || (pos.exit && !pos.exit.closed)
has_unfilled = true
break
break if has_unfilled
inc = if has_unfilled
pusher.tick_interval
else
pusher.tick_interval_no_unfilled
tick.time += inc
start += inc
history.advance(tick.time)
simulation_done = tick.time > ts - pusher.tick_interval * 10
######################
#### Accounting
dealers_with_open = (dealer for dealer,positions of open_positions when positions.length > 0)
if dealers_with_open.length > 0
# check if any positions have subsequently closed
yyy = Date.now()
update_position_status balance, dealers_with_open
t_.pos_status += Date.now() - yyy
yyy = Date.now()
update_balance balance, dealers_with_open
t_.balance += Date.now() - yyy
#####################
if !simulation_done
######################
#### Main call. Where the action is.
#pusher.hustle balance, trades
pusher.hustle balance
######################
if simulation_done
return end()
####################
#### Efficiency measures
# xxxx = Date.now()
if ticks % 50000 == 1
global.gc?()
if ticks % 100 == 99
purge_position_status()
# t_.gc += Date.now() - xxxx
####################
#####################
#### Progress bar
if config.log_level > 0
t_sec = {}
for k,v of t_
t_sec[k] = Math.round(v/1000)
perperper = Math.round(100 * (tick.time - time.earliest) / (time.latest - time.earliest))
perbytrade = Math.round(100 * (start_idx - history.trade_idx) / start_idx )
bar.tick 1, extend {ticks,perperper,perbytrade}, t_sec
#####################
ticks++
t_.qtick += Date.now() - t
setImmediate one_tick
setImmediate one_tick
update_balance = (balance, dealers_with_open) ->
btc = eth = btc_on_order = eth_on_order = 0
for dealer in dealers_with_open
positions = open_positions[dealer]
dbtc = deth = dbtc_on_order = deth_on_order = 0
for pos in positions
if pos.entry.type == 'buy'
buy = pos.entry
sell = pos.exit
else
buy = pos.exit
sell = pos.entry
if buy
# used or reserved for buying trade.amount eth
for_purchase = if buy.flags?.market then buy.to_fill else buy.to_fill * buy.rate
dbtc_on_order += for_purchase
dbtc -= for_purchase
if buy.fills?.length > 0
for fill in buy.fills
deth += fill.amount
dbtc -= fill.total
if config.exchange == 'poloniex'
deth -= fill.fee
else
dbtc -= fill.fee
if sell
for_sale = sell.to_fill
deth_on_order += for_sale
deth -= for_sale
if sell.fills?.length > 0
for fill in sell.fills
deth -= fill.amount
dbtc += fill.total
dbtc -= fill.fee
btc += dbtc
eth += deth
btc_on_order += dbtc_on_order
eth_on_order += deth_on_order
dbalance = balance[dealer]
dbalance.balances.c1 = dbalance.deposits.c1 + dbtc + dbalance.accounted_for.c1
dbalance.balances.c2 = dbalance.deposits.c2 + deth + dbalance.accounted_for.c2
dbalance.on_order.c1 = dbtc_on_order
dbalance.on_order.c2 = deth_on_order
if config.enforce_balance && (dbalance.balances.c1 < 0 || dbalance.balances.c2 < 0)
msg =
message: 'negative balance!?!'
balance: balance.balances
dbalance: balance[dealer]
dealer: dealer
config: config
console.log ''
fills = []
fills_out = []
pos = null
for pos in from_cache(dealer).positions
for trade in [pos.entry, pos.exit] when trade
fills = fills.concat trade.fills
console.log trade if config.log_level > 1
for fill in trade.fills
if fill.type == 'sell'
fills_out.push "#{pos.key or 'none'}\t#{trade.entry or false}\t#{trade.created}\t#{fill.order_id or '000'}\t#{fill.total}\t-#{fill.amount}\t#{fill.fee}"
else
fills_out.push "#{pos.key or 'none'}\t#{trade.entry or false}\t#{trade.created}\t#{fill.order_id or '000'}\t-#{fill.total}\t#{fill.amount}\t#{fill.fee}"
# for pos in from_cache(dealer).positions
# for t in [pos.entry, pos.exit] when t
# # msg["#{pos.created}-#{t.type}"] = t
# amt = 0
# tot = 0
# for f,idx in (t.fills or [])
# # msg["#{pos.created}-#{t.type}-f#{idx}"] = f
# amt += f.amount
# tot += f.total
# # console.log
# # type: t.type
# # amt: amt
# # tot: tot
# # fills: (t.fills or []).length
# # closed: t.closed
# console.log t
console.log fills_out
console.assert false, msg
balance.balances.c1 = balance.deposits.c1 + btc + balance.accounted_for.c1
balance.balances.c2 = balance.deposits.c2 + eth + balance.accounted_for.c2
balance.on_order.c1 = btc_on_order
balance.on_order.c2 = eth_on_order
global.trades_closed = {}
purge_position_status = ->
new_position_status = {}
for name, open of open_positions when open.length > 0
for pos in open
for trade in [pos.entry, pos.exit] when trade && !trade.closed
```
key = `${pos.dealer}-${trade.created}-${trade.type}-${trade.rate}`
```
new_position_status[key] = global.position_status[key]
for k,v of global.position_status
if k not of new_position_status
delete global.position_status[k]
update_position_status = (balance, dealers_with_open) ->
end_idx = history.trade_idx
for dealer in dealers_with_open
maker_fee = from_cache('balances').maker_fee
taker_fee = from_cache('balances').taker_fee
open = open_positions[dealer]
closed = []
for pos in open
for trade in [pos.entry, pos.exit] when trade && !trade.closed
```
key = `${pos.dealer}-${trade.created}-${trade.type}-${trade.rate}`
```
status = global.position_status[key]
if trade.to_fill > 0 && (!status? || end_idx < status.idx + 100 )
status = global.position_status[key] = fill_order trade, status
# console.log '\nFILLLLLLLL\n', key, end_idx, status?.idx, status?.fills?.length
if status?.fills?.length > 0
filled = 0
for fill in (status.fills or [])
if fill.date > tick.time
break
amt = fill.amount
rate = fill.rate
if trade.flags?.market && trade.type == 'buy'
to_fill = trade.to_fill
done = amt * rate >= to_fill
fill.total = if !done then amt * rate else to_fill
fill.amount = if !done then amt else to_fill / rate
fill.fee = if trade.type == 'buy' && config.exchange == 'poloniex'
fill.amount * maker_fee
else
fill.amount * fill.rate * maker_fee
trade.to_fill -= fill.total
else
to_fill = trade.to_fill
done = fill.amount >= to_fill || trade.flags?.market
if done
fill.amount = to_fill
xfee = if fill.is_maker then maker_fee else taker_fee
fill.fee = if trade.type == 'buy' && config.exchange == 'poloniex'
fill.amount * xfee
else
fill.amount * fill.rate * xfee
fill.total = fill.amount * rate
trade.to_fill -= fill.amount
fill.type = trade.type
trade.fills.push fill
filled += 1
if filled > 0
status.fills = status.fills.slice(filled)
# if trade.to_fill < 0
# console.assert false,
# message: 'Overfilled!'
# trade: trade
# fills: trade.fills
if trade.to_fill == 0
trade.closed = trade.fills[trade.fills.length - 1].date
global.position_status[key] = undefined
if (pos.entry?.closed && pos.exit?.closed) || (dealers[dealer].never_exits && pos.entry?.closed)
pos.closed = Math.max pos.entry.closed, (pos.exit?.closed or 0)
closed.push pos
for pos in closed
idx = open.indexOf(pos)
open.splice idx, 1
name = pos.dealer
cur_c1 = balance.accounted_for.c1
cur_c2 = balance.accounted_for.c2
for trade in [pos.entry, pos.exit] when trade
close_trade pos, trade
if trade.type == 'buy'
balance.accounted_for.c2 += trade.amount
balance.accounted_for.c1 -= trade.total
balance[name].accounted_for.c2 += trade.amount
balance[name].accounted_for.c1 -= trade.total
else
balance.accounted_for.c2 -= trade.amount
balance.accounted_for.c1 += trade.total
balance[name].accounted_for.c2 -= trade.amount
balance[name].accounted_for.c1 += trade.total
balance.accounted_for.c2 -= trade.c2_fees
balance.accounted_for.c1 -= trade.c1_fees
balance[name].accounted_for.c2 -= trade.c2_fees
balance[name].accounted_for.c1 -= trade.c1_fees
pos.profit = (balance.accounted_for.c1 - cur_c1) / pos.exit.rate + (balance.accounted_for.c2 - cur_c2)
fill_order = (my_trade, status) ->
end_idx = @history.trade_idx
status ||= {
fills: []
idx: false
became_maker: false
}
my_amount = my_trade.amount
my_rate = my_trade.rate
is_sell = my_trade.type == 'sell'
my_created = my_trade.created
order_placement_lag = config.order_placement_lag
is_market = my_trade.flags?.market
if status.idx
start_at = status.idx
else
start_at = end_idx
to_fill = my_trade.to_fill
console.assert to_fill > 0
status.fills ||= []
fills = status.fills
init = false
for idx in [start_at..0] by -1
trade = history.trades[idx]
if !init
if trade.date < my_created + order_placement_lag
continue
else
init = true
if !status.became_maker
status.became_maker = trade.date - (my_created + order_placement_lag) > 1 * 60 || (is_sell && trade.rate <= my_rate) || (!is_sell && trade.rate >= my_rate)
if (!is_sell && trade.rate <= my_rate) || \
( is_sell && trade.rate >= my_rate) || is_market
if is_market
if (is_sell && trade.rate < my_rate) || (!is_sell && trade.rate > my_rate)
rate = trade.rate
else
rate = my_rate
else
rate = my_rate
is_maker = status.became_maker && !is_market
fill =
date: trade.date
rate: rate
amount: trade.amount
maker: is_maker
fills.push fill
if ((!is_market || is_sell) && trade.amount >= to_fill) || \
( (is_market && !is_sell) && trade.total >= to_fill)
status.idx = idx
return status
else
if is_market && !is_sell
to_fill -= fill.amount * fill.rate
else
to_fill -= fill.amount
if !is_market && (!history.trades[end_idx] || trade.date > history.trades[end_idx].date + 30 * 60)
status.idx = idx
return status
store_analysis = ->
balance = from_cache 'balance'
# analysis of positions
fs = require('fs')
if !fs.existsSync 'analyze'
fs.mkdirSync 'analyze'
dir = "analyze/#{config.end - config.length}-#{config.end}"
if !fs.existsSync dir
fs.mkdirSync dir
dealer_names = get_dealers()
sample = null
sample_dealer = null
for name in dealer_names
for pos in (from_cache(name).positions or [])
sample = dealers[name].analyze pos, balance.maker_fee
sample_dealer = name
break
break if sample
return if !sample
cols = Object.keys(sample.dependent).concat(Object.keys(get_settings(sample_dealer))).concat Object.keys(sample.independent)
rows = []
rows.push cols
for name in dealer_names
positions = from_cache(name).positions
dealer = dealers[name]
settings = get_settings(name) or {}
for pos in positions
row = dealer.analyze(pos, balance.maker_fee)
continue if !row
independent = extend {}, row.independent, settings
rows.push ( (if col of independent then independent[col] else row.dependent[col]) for col in cols)
fname = "#{dir}/positions.txt"
fs.writeFileSync fname, (r.join('\t') for r in rows).join('\n'), { flag : 'w' }
# analysis of dealers
KPI (all_stats) ->
cols = ['Name']
pieces = {}
for name in get_dealers()
for part, idx in name.split('&')
if idx > 0
[param,val] = part.split('=')
pieces[param] ||= {}
pieces[param][val] = true
params = (p for p,v of pieces when Object.keys(v).length > 1)
cols = cols.concat params
for measure, __ of dealer_measures(all_stats)
cols.push measure
rows = [cols]
for name in get_dealers()
stats = all_stats[name]
my_params = {}
for part, idx in name.split('&')
if idx > 0
[param,val] = part.split('=')
my_params[param] = val
else
strat = part
row = [strat]
for param in params
if param of my_params
row.push my_params[param]
else
row.push ''
for measure, calc of dealer_measures(all_stats)
row.push calc(name)
rows.push row
fname = "#{dir}/dealers.txt"
fs.writeFileSync fname, (r.join('\t') for r in rows).join('\n'), { flag : 'w' }
log_results = ->
if config.analyze
console.log 'Exporting analysis'
store_analysis()
KPI (all_stats) ->
balances = from_cache 'balances'
row = [config.name, config.c1, config.c2, config.exchange, config.end - config.length, config.end, all_stats.all.$c1_start, all_stats.all.$c2_start, all_stats.all.$c1_end, all_stats.all.$c2_end, balances.deposits.c1, balances.deposits.c2, balances.balances.c1, balances.balances.c2]
for measure, calc of dealer_measures(all_stats)
row.push calc('all')
console.log '\x1b[36m%s\x1b[0m', "#{row[0]} made #{row[18]} profit on #{row[19]} completed trades at #{row[14]} CAGR"
if config.log_results
fs = require('fs')
if !fs.existsSync('logs')
fs.mkdirSync 'logs'
fname = "logs/#{config.log_results}.txt"
if !fs.existsSync(fname)
cols = ['Name', 'Currency1', 'Currency2', 'Exchange', 'Start', 'End', '$c1_start', '$c2_start', '$c1_end', '$c2_end', 'c1_deposit', 'c2_deposit', 'c1_end', 'c2_end']
for measure, __ of dealer_measures(all_stats)
cols.push measure
else
cols = []
rows = [cols]
rows.push row
out = fs.openSync fname, 'a'
fs.writeSync out, (r.join('\t') for r in rows).join('\n')
fs.closeSync out
reset = ->
global.config = {}
KPI.initialized = false
global.open_positions = {}
history.trades = []
pusher.init
history: history
clear_all_positions: true
lab = module.exports =
experiment: (conf, callback) ->
global.config = {}
global.config = defaults global.config, conf,
key: 'config'
exchange: 'poloniex'
simulation: true
eval_entry_every_n_seconds: 60
eval_exit_every_n_seconds: 60
eval_unfilled_every_n_seconds: 60
length: 12 * 24 * 60 * 60
c1: 'BTC'
c2: 'ETH'
accounting_currency: 'USDT'
order_placement_lag: 1
log: true
enforce_balance: true
persist: false
analyze: false
produce_heapdump: false
offline: false
auto_shorten_time: true
deposit_allocation: '50/50'
log_level: 1
save config
# set globals
global.position_status = {}
ts = config.end or now()
# history.load_chart_history "c1xc2", config.c1, config.c2, ts - 20 * 365 * 24 * 60 * 60, ts, ->
# console.log 'use me to get earliest trade for pair', config.c1, config.c2
# process.exit()
# return
pusher.init
history: history
clear_all_positions: true
console.assert !isNaN(history.longest_requested_history),
message: 'Longest requested history is NaN. Perhaps you haven\'t registered any dealers'
# console.log 'longest requested history:', history.longest_requested_history
history_width = history.longest_requested_history + config.length + 24 * 60 * 60
earliest_trade_for_pair = exchange.get_earliest_trade {only_high_volume: config.only_high_volume, exchange: config.exchange, c1: config.c1, c2: config.c2, accounting_currency: config.accounting_currency}
if ts > earliest_trade_for_pair
if config.auto_shorten_time && ts - history_width < earliest_trade_for_pair
shrink_by = earliest_trade_for_pair - (ts - history_width) + 24 * 60 * 60
config.length -= shrink_by
history_width = history.longest_requested_history + config.length + 24 * 60 * 60
console.log "Shortened simulation", {shrink_by, end: ts, start: ts - history_width, history_width, earliest_trade_for_pair}
if ts - history_width >= earliest_trade_for_pair
console.log "Running #{Object.keys(dealers).length} dealers" if config.log_level > 0
history.load_price_data
start: ts - history_width
end: ts
callback: ->
console.log "...loading #{ (history_width / 60 / 60 / 24).toFixed(2) } days of trade history, relative to #{ts}" if config.log_level > 1
history.load ts - history_width, ts, ->
console.log "...experimenting!" if config.log_level > 1
simulate ts, callback
else
console.log "Can't experiment during that time. The currency pair wasn't trading before the start date."
callback()
else
console.log "Can't experiment during that time. The currency pair wasn't trading before the end date."
callback()
setup: ({persist, port, db_name, clear_old, no_client}) ->
global.pointerify = true
global.upload_dir = 'static/'
global.bus = require('statebus').serve
port: port
file_store: false
client: false
bus.honk = false
if persist
if clear_old && fs.existsSync(db_name)
fs.unlinkSync(db_name)
bus.sqlite_store
filename: db_name
use_transactions: true
backups: false
global.save = bus.save
global.fetch = (key) ->
bus.fetch deslash key
global.del = bus.del
if !no_client
require 'coffee-script'
require './shared'
express = require('express')
bus.http.use('/node_modules', express.static('node_modules'))
bus.http.use('/node_modules', express.static('meth/node_modules'))
bus.http.use('/meth/vendor', express.static('meth/vendor'))
# taken from statebus server.js. Just wanted different client path.
bus.http_serve '/meth/:filename', (filename) ->
filename = deslash filename
source = bus.read_file(filename)
if filename.match(/\.coffee$/)
try
compiled = require('coffee-script').compile source,
filename: filename
bare: true
sourceMap: true
catch e
console.error('Could not compile ' + filename + ': ', e)
return ''
compiled = require('coffee-script').compile(source, {filename: filename, bare: true, sourceMap: true})
source_map = JSON.parse(compiled.v3SourceMap)
source_map.sourcesContent = source
compiled = 'window.dom = window.dom || {}\n' + compiled.js
compiled = 'window.ui = window.ui || {}\n' + compiled
btoa = (s) -> return new Buffer(s.toString(),'binary').toString('base64')
# Base64 encode it
compiled += '\n'
compiled += '//# sourceMappingURL=data:application/json;base64,'
compiled += btoa(JSON.stringify(source_map)) + '\n'
compiled += '//# sourceURL=' + filename
return compiled
else return source
bus.http.get '/*', (r,res) =>
paths = r.url.split('/')
paths.shift() if paths[0] == ''
console.log r.url
prefix = ''
server = "statei://localhost:#{bus.port}"
html = """
<!DOCTYPE html>
<html>
<head>
<script type="coffeedom">
bus.honk = false
#</script>
<script src="#{prefix}/node_modules/statebus/client.js" server="#{server}"></script>
<script src="#{prefix}/meth/vendor/d3.js"></script>
<script src="#{prefix}/meth/vendor/md5.js"></script>
<script src="#{prefix}/meth/vendor/plotly.js"></script>
<script src="#{prefix}/meth/shared.coffee"></script>
<script src="#{prefix}/meth/crunch.coffee"></script>
<script src="#{prefix}/meth/dash.coffee"></script>
<link rel="stylesheet" href="#{prefix}/meth/vendor/fonts/Bebas Neue/bebas.css" type="text/css"/>
</head>
<body>
</body>
</html>
"""
res.send(html)
bus.http.use('/node_modules', express.static('node_modules'))
| 173461 | fs = require 'fs'
progress_bar = require('progress')
mathjs = require 'mathjs'
require './shared'
history = require './trade_history'
exchange = require './exchange'
global.pusher = require './pusher'
crunch = require './crunch'
global.position_status = {}
#########################
# Main event loop
simulate = (ts, callback) ->
ts = Math.floor(ts)
time = from_cache('time')
extend time,
earliest: ts - config.length
latest: ts
save time
global.tick = tick =
time: 0
global.t_ =
qtick: 0
hustle: 0
exec: 0
feature_tick: 0
eval_pos: 0
check_new: 0
check_exit: 0
check_unfilled: 0
balance: 0
pos_status: 0
# gc: 0
# x: 0
# y: 0
# z: 0
# a: 0
# b: 0
# c: 0
price_data = fetch('price_data')
start = ts - config.length - history.longest_requested_history
tick.time = ts - config.length
tick.start = start
history.advance tick.time
start_idx = history.trade_idx
balance = from_cache('balances')
extend balance,
updated: 0
balances:
c1: 0
c2: 0
deposits:
c1: 0
c2: 0
accounted_for:
c1: 0
c2: 0
on_order:
c1: 0
c2: 0
exchange.get_my_exchange_fee {}, (fees) ->
balance.maker_fee = fees.maker_fee
balance.taker_fee = fees.taker_fee
dealers = get_dealers()
$c2 = price_data.c2?[0].close or price_data.c1xc2[0].close
$c1 = price_data.c1?[0].close or 1
for dealer in dealers
settings = from_cache(dealer).settings
budget = settings.$budget or 100
if config.deposit_allocation == '50/50'
c1_budget = budget * (1 - (settings.ratio or .5) ) / $c1
c2_budget = budget * (settings.ratio or .5) / $c2
else if config.deposit_allocation == 'c1'
c1_budget = budget * .98 / $c1
c2_budget = budget * .02 / $c2
else if config.deposit_allocation == 'c2'
c1_budget = budget * .02 / $c1
c2_budget = budget * .98 / $c2
balance[dealer] =
balances:
c2: c2_budget
c1: c1_budget
deposits:
c2: c2_budget
c1: c1_budget
accounted_for:
c1: 0
c2: 0
on_order:
c1: 0
c2: 0
balance.balances.c2 += balance[dealer].balances.c2
balance.balances.c1 += balance[dealer].balances.c1
balance.deposits.c2 += balance[dealer].deposits.c2
balance.deposits.c1 += balance[dealer].deposits.c1
save balance
balance = bus.fetch 'balances'
t = ':perperper% :perbytrade% :etas :elapsed :ticks'
for k,v of t_
t += " #{k}-:#{k}"
bar = new progress_bar t,
complete: '='
incomplete: ' '
width: 40
renderThrottle: 500
total: Math.ceil (time.latest - time.earliest) / (.0 * pusher.tick_interval_no_unfilled + 1.0 * pusher.tick_interval)
ticks = 0
started_at = Date.now()
price_idx = 0
end = ->
history.trades = [] # free memory
if global.gc
global.gc()
else
console.log('Garbage collection unavailable. Pass --expose-gc.');
if config.produce_heapdump
try
heapdump = require('heapdump')
heapdump.writeSnapshot()
catch e
console.log 'Could not take snapshot'
log_results()
console.time('saving db')
global.timerrrr = Date.now()
save balance
for name in (get_all_actors() or [])
d = from_cache name
save d
console.timeEnd('saving db')
if config.log_level > 1
console.log "\nDone simulating! That took #{(Date.now() - started_at) / 1000} seconds"
console.log config if config.persist
console.log "PORT: #{bus.port}"
callback?()
one_tick = ->
t = Date.now()
has_unfilled = false
for dealer,positions of open_positions when positions.length > 0
for pos in positions
if (pos.entry && !pos.entry.closed) || (pos.exit && !pos.exit.closed)
has_unfilled = true
break
break if has_unfilled
inc = if has_unfilled
pusher.tick_interval
else
pusher.tick_interval_no_unfilled
tick.time += inc
start += inc
history.advance(tick.time)
simulation_done = tick.time > ts - pusher.tick_interval * 10
######################
#### Accounting
dealers_with_open = (dealer for dealer,positions of open_positions when positions.length > 0)
if dealers_with_open.length > 0
# check if any positions have subsequently closed
yyy = Date.now()
update_position_status balance, dealers_with_open
t_.pos_status += Date.now() - yyy
yyy = Date.now()
update_balance balance, dealers_with_open
t_.balance += Date.now() - yyy
#####################
if !simulation_done
######################
#### Main call. Where the action is.
#pusher.hustle balance, trades
pusher.hustle balance
######################
if simulation_done
return end()
####################
#### Efficiency measures
# xxxx = Date.now()
if ticks % 50000 == 1
global.gc?()
if ticks % 100 == 99
purge_position_status()
# t_.gc += Date.now() - xxxx
####################
#####################
#### Progress bar
if config.log_level > 0
t_sec = {}
for k,v of t_
t_sec[k] = Math.round(v/1000)
perperper = Math.round(100 * (tick.time - time.earliest) / (time.latest - time.earliest))
perbytrade = Math.round(100 * (start_idx - history.trade_idx) / start_idx )
bar.tick 1, extend {ticks,perperper,perbytrade}, t_sec
#####################
ticks++
t_.qtick += Date.now() - t
setImmediate one_tick
setImmediate one_tick
update_balance = (balance, dealers_with_open) ->
btc = eth = btc_on_order = eth_on_order = 0
for dealer in dealers_with_open
positions = open_positions[dealer]
dbtc = deth = dbtc_on_order = deth_on_order = 0
for pos in positions
if pos.entry.type == 'buy'
buy = pos.entry
sell = pos.exit
else
buy = pos.exit
sell = pos.entry
if buy
# used or reserved for buying trade.amount eth
for_purchase = if buy.flags?.market then buy.to_fill else buy.to_fill * buy.rate
dbtc_on_order += for_purchase
dbtc -= for_purchase
if buy.fills?.length > 0
for fill in buy.fills
deth += fill.amount
dbtc -= fill.total
if config.exchange == 'poloniex'
deth -= fill.fee
else
dbtc -= fill.fee
if sell
for_sale = sell.to_fill
deth_on_order += for_sale
deth -= for_sale
if sell.fills?.length > 0
for fill in sell.fills
deth -= fill.amount
dbtc += fill.total
dbtc -= fill.fee
btc += dbtc
eth += deth
btc_on_order += dbtc_on_order
eth_on_order += deth_on_order
dbalance = balance[dealer]
dbalance.balances.c1 = dbalance.deposits.c1 + dbtc + dbalance.accounted_for.c1
dbalance.balances.c2 = dbalance.deposits.c2 + deth + dbalance.accounted_for.c2
dbalance.on_order.c1 = dbtc_on_order
dbalance.on_order.c2 = deth_on_order
if config.enforce_balance && (dbalance.balances.c1 < 0 || dbalance.balances.c2 < 0)
msg =
message: 'negative balance!?!'
balance: balance.balances
dbalance: balance[dealer]
dealer: dealer
config: config
console.log ''
fills = []
fills_out = []
pos = null
for pos in from_cache(dealer).positions
for trade in [pos.entry, pos.exit] when trade
fills = fills.concat trade.fills
console.log trade if config.log_level > 1
for fill in trade.fills
if fill.type == 'sell'
fills_out.push "#{pos.key or 'none'}\t#{trade.entry or false}\t#{trade.created}\t#{fill.order_id or '000'}\t#{fill.total}\t-#{fill.amount}\t#{fill.fee}"
else
fills_out.push "#{pos.key or 'none'}\t#{trade.entry or false}\t#{trade.created}\t#{fill.order_id or '000'}\t-#{fill.total}\t#{fill.amount}\t#{fill.fee}"
# for pos in from_cache(dealer).positions
# for t in [pos.entry, pos.exit] when t
# # msg["#{pos.created}-#{t.type}"] = t
# amt = 0
# tot = 0
# for f,idx in (t.fills or [])
# # msg["#{pos.created}-#{t.type}-f#{idx}"] = f
# amt += f.amount
# tot += f.total
# # console.log
# # type: t.type
# # amt: amt
# # tot: tot
# # fills: (t.fills or []).length
# # closed: t.closed
# console.log t
console.log fills_out
console.assert false, msg
balance.balances.c1 = balance.deposits.c1 + btc + balance.accounted_for.c1
balance.balances.c2 = balance.deposits.c2 + eth + balance.accounted_for.c2
balance.on_order.c1 = btc_on_order
balance.on_order.c2 = eth_on_order
global.trades_closed = {}
purge_position_status = ->
new_position_status = {}
for name, open of open_positions when open.length > 0
for pos in open
for trade in [pos.entry, pos.exit] when trade && !trade.closed
```
key = `${pos.dealer}-${trade.created}-${trade.type}-${trade.rate}`
```
new_position_status[key] = global.position_status[key]
for k,v of global.position_status
if k not of new_position_status
delete global.position_status[k]
update_position_status = (balance, dealers_with_open) ->
end_idx = history.trade_idx
for dealer in dealers_with_open
maker_fee = from_cache('balances').maker_fee
taker_fee = from_cache('balances').taker_fee
open = open_positions[dealer]
closed = []
for pos in open
for trade in [pos.entry, pos.exit] when trade && !trade.closed
```
key = `${pos.dealer}-${trade.created}-${trade.type}-${trade.rate}`
```
status = global.position_status[key]
if trade.to_fill > 0 && (!status? || end_idx < status.idx + 100 )
status = global.position_status[key] = fill_order trade, status
# console.log '\nFILLLLLLLL\n', key, end_idx, status?.idx, status?.fills?.length
if status?.fills?.length > 0
filled = 0
for fill in (status.fills or [])
if fill.date > tick.time
break
amt = fill.amount
rate = fill.rate
if trade.flags?.market && trade.type == 'buy'
to_fill = trade.to_fill
done = amt * rate >= to_fill
fill.total = if !done then amt * rate else to_fill
fill.amount = if !done then amt else to_fill / rate
fill.fee = if trade.type == 'buy' && config.exchange == 'poloniex'
fill.amount * maker_fee
else
fill.amount * fill.rate * maker_fee
trade.to_fill -= fill.total
else
to_fill = trade.to_fill
done = fill.amount >= to_fill || trade.flags?.market
if done
fill.amount = to_fill
xfee = if fill.is_maker then maker_fee else taker_fee
fill.fee = if trade.type == 'buy' && config.exchange == 'poloniex'
fill.amount * xfee
else
fill.amount * fill.rate * xfee
fill.total = fill.amount * rate
trade.to_fill -= fill.amount
fill.type = trade.type
trade.fills.push fill
filled += 1
if filled > 0
status.fills = status.fills.slice(filled)
# if trade.to_fill < 0
# console.assert false,
# message: 'Overfilled!'
# trade: trade
# fills: trade.fills
if trade.to_fill == 0
trade.closed = trade.fills[trade.fills.length - 1].date
global.position_status[key] = undefined
if (pos.entry?.closed && pos.exit?.closed) || (dealers[dealer].never_exits && pos.entry?.closed)
pos.closed = Math.max pos.entry.closed, (pos.exit?.closed or 0)
closed.push pos
for pos in closed
idx = open.indexOf(pos)
open.splice idx, 1
name = pos.dealer
cur_c1 = balance.accounted_for.c1
cur_c2 = balance.accounted_for.c2
for trade in [pos.entry, pos.exit] when trade
close_trade pos, trade
if trade.type == 'buy'
balance.accounted_for.c2 += trade.amount
balance.accounted_for.c1 -= trade.total
balance[name].accounted_for.c2 += trade.amount
balance[name].accounted_for.c1 -= trade.total
else
balance.accounted_for.c2 -= trade.amount
balance.accounted_for.c1 += trade.total
balance[name].accounted_for.c2 -= trade.amount
balance[name].accounted_for.c1 += trade.total
balance.accounted_for.c2 -= trade.c2_fees
balance.accounted_for.c1 -= trade.c1_fees
balance[name].accounted_for.c2 -= trade.c2_fees
balance[name].accounted_for.c1 -= trade.c1_fees
pos.profit = (balance.accounted_for.c1 - cur_c1) / pos.exit.rate + (balance.accounted_for.c2 - cur_c2)
fill_order = (my_trade, status) ->
end_idx = @history.trade_idx
status ||= {
fills: []
idx: false
became_maker: false
}
my_amount = my_trade.amount
my_rate = my_trade.rate
is_sell = my_trade.type == 'sell'
my_created = my_trade.created
order_placement_lag = config.order_placement_lag
is_market = my_trade.flags?.market
if status.idx
start_at = status.idx
else
start_at = end_idx
to_fill = my_trade.to_fill
console.assert to_fill > 0
status.fills ||= []
fills = status.fills
init = false
for idx in [start_at..0] by -1
trade = history.trades[idx]
if !init
if trade.date < my_created + order_placement_lag
continue
else
init = true
if !status.became_maker
status.became_maker = trade.date - (my_created + order_placement_lag) > 1 * 60 || (is_sell && trade.rate <= my_rate) || (!is_sell && trade.rate >= my_rate)
if (!is_sell && trade.rate <= my_rate) || \
( is_sell && trade.rate >= my_rate) || is_market
if is_market
if (is_sell && trade.rate < my_rate) || (!is_sell && trade.rate > my_rate)
rate = trade.rate
else
rate = my_rate
else
rate = my_rate
is_maker = status.became_maker && !is_market
fill =
date: trade.date
rate: rate
amount: trade.amount
maker: is_maker
fills.push fill
if ((!is_market || is_sell) && trade.amount >= to_fill) || \
( (is_market && !is_sell) && trade.total >= to_fill)
status.idx = idx
return status
else
if is_market && !is_sell
to_fill -= fill.amount * fill.rate
else
to_fill -= fill.amount
if !is_market && (!history.trades[end_idx] || trade.date > history.trades[end_idx].date + 30 * 60)
status.idx = idx
return status
store_analysis = ->
balance = from_cache 'balance'
# analysis of positions
fs = require('fs')
if !fs.existsSync 'analyze'
fs.mkdirSync 'analyze'
dir = "analyze/#{config.end - config.length}-#{config.end}"
if !fs.existsSync dir
fs.mkdirSync dir
dealer_names = get_dealers()
sample = null
sample_dealer = null
for name in dealer_names
for pos in (from_cache(name).positions or [])
sample = dealers[name].analyze pos, balance.maker_fee
sample_dealer = name
break
break if sample
return if !sample
cols = Object.keys(sample.dependent).concat(Object.keys(get_settings(sample_dealer))).concat Object.keys(sample.independent)
rows = []
rows.push cols
for name in dealer_names
positions = from_cache(name).positions
dealer = dealers[name]
settings = get_settings(name) or {}
for pos in positions
row = dealer.analyze(pos, balance.maker_fee)
continue if !row
independent = extend {}, row.independent, settings
rows.push ( (if col of independent then independent[col] else row.dependent[col]) for col in cols)
fname = "#{dir}/positions.txt"
fs.writeFileSync fname, (r.join('\t') for r in rows).join('\n'), { flag : 'w' }
# analysis of dealers
KPI (all_stats) ->
cols = ['Name']
pieces = {}
for name in get_dealers()
for part, idx in name.split('&')
if idx > 0
[param,val] = part.split('=')
pieces[param] ||= {}
pieces[param][val] = true
params = (p for p,v of pieces when Object.keys(v).length > 1)
cols = cols.concat params
for measure, __ of dealer_measures(all_stats)
cols.push measure
rows = [cols]
for name in get_dealers()
stats = all_stats[name]
my_params = {}
for part, idx in name.split('&')
if idx > 0
[param,val] = part.split('=')
my_params[param] = val
else
strat = part
row = [strat]
for param in params
if param of my_params
row.push my_params[param]
else
row.push ''
for measure, calc of dealer_measures(all_stats)
row.push calc(name)
rows.push row
fname = "#{dir}/dealers.txt"
fs.writeFileSync fname, (r.join('\t') for r in rows).join('\n'), { flag : 'w' }
log_results = ->
if config.analyze
console.log 'Exporting analysis'
store_analysis()
KPI (all_stats) ->
balances = from_cache 'balances'
row = [config.name, config.c1, config.c2, config.exchange, config.end - config.length, config.end, all_stats.all.$c1_start, all_stats.all.$c2_start, all_stats.all.$c1_end, all_stats.all.$c2_end, balances.deposits.c1, balances.deposits.c2, balances.balances.c1, balances.balances.c2]
for measure, calc of dealer_measures(all_stats)
row.push calc('all')
console.log '\x1b[36m%s\x1b[0m', "#{row[0]} made #{row[18]} profit on #{row[19]} completed trades at #{row[14]} CAGR"
if config.log_results
fs = require('fs')
if !fs.existsSync('logs')
fs.mkdirSync 'logs'
fname = "logs/#{config.log_results}.txt"
if !fs.existsSync(fname)
cols = ['Name', 'Currency1', 'Currency2', 'Exchange', 'Start', 'End', '$c1_start', '$c2_start', '$c1_end', '$c2_end', 'c1_deposit', 'c2_deposit', 'c1_end', 'c2_end']
for measure, __ of dealer_measures(all_stats)
cols.push measure
else
cols = []
rows = [cols]
rows.push row
out = fs.openSync fname, 'a'
fs.writeSync out, (r.join('\t') for r in rows).join('\n')
fs.closeSync out
reset = ->
global.config = {}
KPI.initialized = false
global.open_positions = {}
history.trades = []
pusher.init
history: history
clear_all_positions: true
lab = module.exports =
experiment: (conf, callback) ->
global.config = {}
global.config = defaults global.config, conf,
key: '<KEY>'
exchange: 'poloniex'
simulation: true
eval_entry_every_n_seconds: 60
eval_exit_every_n_seconds: 60
eval_unfilled_every_n_seconds: 60
length: 12 * 24 * 60 * 60
c1: 'BTC'
c2: 'ETH'
accounting_currency: 'USDT'
order_placement_lag: 1
log: true
enforce_balance: true
persist: false
analyze: false
produce_heapdump: false
offline: false
auto_shorten_time: true
deposit_allocation: '50/50'
log_level: 1
save config
# set globals
global.position_status = {}
ts = config.end or now()
# history.load_chart_history "c1xc2", config.c1, config.c2, ts - 20 * 365 * 24 * 60 * 60, ts, ->
# console.log 'use me to get earliest trade for pair', config.c1, config.c2
# process.exit()
# return
pusher.init
history: history
clear_all_positions: true
console.assert !isNaN(history.longest_requested_history),
message: 'Longest requested history is NaN. Perhaps you haven\'t registered any dealers'
# console.log 'longest requested history:', history.longest_requested_history
history_width = history.longest_requested_history + config.length + 24 * 60 * 60
earliest_trade_for_pair = exchange.get_earliest_trade {only_high_volume: config.only_high_volume, exchange: config.exchange, c1: config.c1, c2: config.c2, accounting_currency: config.accounting_currency}
if ts > earliest_trade_for_pair
if config.auto_shorten_time && ts - history_width < earliest_trade_for_pair
shrink_by = earliest_trade_for_pair - (ts - history_width) + 24 * 60 * 60
config.length -= shrink_by
history_width = history.longest_requested_history + config.length + 24 * 60 * 60
console.log "Shortened simulation", {shrink_by, end: ts, start: ts - history_width, history_width, earliest_trade_for_pair}
if ts - history_width >= earliest_trade_for_pair
console.log "Running #{Object.keys(dealers).length} dealers" if config.log_level > 0
history.load_price_data
start: ts - history_width
end: ts
callback: ->
console.log "...loading #{ (history_width / 60 / 60 / 24).toFixed(2) } days of trade history, relative to #{ts}" if config.log_level > 1
history.load ts - history_width, ts, ->
console.log "...experimenting!" if config.log_level > 1
simulate ts, callback
else
console.log "Can't experiment during that time. The currency pair wasn't trading before the start date."
callback()
else
console.log "Can't experiment during that time. The currency pair wasn't trading before the end date."
callback()
setup: ({persist, port, db_name, clear_old, no_client}) ->
global.pointerify = true
global.upload_dir = 'static/'
global.bus = require('statebus').serve
port: port
file_store: false
client: false
bus.honk = false
if persist
if clear_old && fs.existsSync(db_name)
fs.unlinkSync(db_name)
bus.sqlite_store
filename: db_name
use_transactions: true
backups: false
global.save = bus.save
global.fetch = (key) ->
bus.fetch deslash key
global.del = bus.del
if !no_client
require 'coffee-script'
require './shared'
express = require('express')
bus.http.use('/node_modules', express.static('node_modules'))
bus.http.use('/node_modules', express.static('meth/node_modules'))
bus.http.use('/meth/vendor', express.static('meth/vendor'))
# taken from statebus server.js. Just wanted different client path.
bus.http_serve '/meth/:filename', (filename) ->
filename = deslash filename
source = bus.read_file(filename)
if filename.match(/\.coffee$/)
try
compiled = require('coffee-script').compile source,
filename: filename
bare: true
sourceMap: true
catch e
console.error('Could not compile ' + filename + ': ', e)
return ''
compiled = require('coffee-script').compile(source, {filename: filename, bare: true, sourceMap: true})
source_map = JSON.parse(compiled.v3SourceMap)
source_map.sourcesContent = source
compiled = 'window.dom = window.dom || {}\n' + compiled.js
compiled = 'window.ui = window.ui || {}\n' + compiled
btoa = (s) -> return new Buffer(s.toString(),'binary').toString('base64')
# Base64 encode it
compiled += '\n'
compiled += '//# sourceMappingURL=data:application/json;base64,'
compiled += btoa(JSON.stringify(source_map)) + '\n'
compiled += '//# sourceURL=' + filename
return compiled
else return source
bus.http.get '/*', (r,res) =>
paths = r.url.split('/')
paths.shift() if paths[0] == ''
console.log r.url
prefix = ''
server = "statei://localhost:#{bus.port}"
html = """
<!DOCTYPE html>
<html>
<head>
<script type="coffeedom">
bus.honk = false
#</script>
<script src="#{prefix}/node_modules/statebus/client.js" server="#{server}"></script>
<script src="#{prefix}/meth/vendor/d3.js"></script>
<script src="#{prefix}/meth/vendor/md5.js"></script>
<script src="#{prefix}/meth/vendor/plotly.js"></script>
<script src="#{prefix}/meth/shared.coffee"></script>
<script src="#{prefix}/meth/crunch.coffee"></script>
<script src="#{prefix}/meth/dash.coffee"></script>
<link rel="stylesheet" href="#{prefix}/meth/vendor/fonts/Bebas Neue/bebas.css" type="text/css"/>
</head>
<body>
</body>
</html>
"""
res.send(html)
bus.http.use('/node_modules', express.static('node_modules'))
| true | fs = require 'fs'
progress_bar = require('progress')
mathjs = require 'mathjs'
require './shared'
history = require './trade_history'
exchange = require './exchange'
global.pusher = require './pusher'
crunch = require './crunch'
global.position_status = {}
#########################
# Main event loop
simulate = (ts, callback) ->
ts = Math.floor(ts)
time = from_cache('time')
extend time,
earliest: ts - config.length
latest: ts
save time
global.tick = tick =
time: 0
global.t_ =
qtick: 0
hustle: 0
exec: 0
feature_tick: 0
eval_pos: 0
check_new: 0
check_exit: 0
check_unfilled: 0
balance: 0
pos_status: 0
# gc: 0
# x: 0
# y: 0
# z: 0
# a: 0
# b: 0
# c: 0
price_data = fetch('price_data')
start = ts - config.length - history.longest_requested_history
tick.time = ts - config.length
tick.start = start
history.advance tick.time
start_idx = history.trade_idx
balance = from_cache('balances')
extend balance,
updated: 0
balances:
c1: 0
c2: 0
deposits:
c1: 0
c2: 0
accounted_for:
c1: 0
c2: 0
on_order:
c1: 0
c2: 0
exchange.get_my_exchange_fee {}, (fees) ->
balance.maker_fee = fees.maker_fee
balance.taker_fee = fees.taker_fee
dealers = get_dealers()
$c2 = price_data.c2?[0].close or price_data.c1xc2[0].close
$c1 = price_data.c1?[0].close or 1
for dealer in dealers
settings = from_cache(dealer).settings
budget = settings.$budget or 100
if config.deposit_allocation == '50/50'
c1_budget = budget * (1 - (settings.ratio or .5) ) / $c1
c2_budget = budget * (settings.ratio or .5) / $c2
else if config.deposit_allocation == 'c1'
c1_budget = budget * .98 / $c1
c2_budget = budget * .02 / $c2
else if config.deposit_allocation == 'c2'
c1_budget = budget * .02 / $c1
c2_budget = budget * .98 / $c2
balance[dealer] =
balances:
c2: c2_budget
c1: c1_budget
deposits:
c2: c2_budget
c1: c1_budget
accounted_for:
c1: 0
c2: 0
on_order:
c1: 0
c2: 0
balance.balances.c2 += balance[dealer].balances.c2
balance.balances.c1 += balance[dealer].balances.c1
balance.deposits.c2 += balance[dealer].deposits.c2
balance.deposits.c1 += balance[dealer].deposits.c1
save balance
balance = bus.fetch 'balances'
t = ':perperper% :perbytrade% :etas :elapsed :ticks'
for k,v of t_
t += " #{k}-:#{k}"
bar = new progress_bar t,
complete: '='
incomplete: ' '
width: 40
renderThrottle: 500
total: Math.ceil (time.latest - time.earliest) / (.0 * pusher.tick_interval_no_unfilled + 1.0 * pusher.tick_interval)
ticks = 0
started_at = Date.now()
price_idx = 0
end = ->
history.trades = [] # free memory
if global.gc
global.gc()
else
console.log('Garbage collection unavailable. Pass --expose-gc.');
if config.produce_heapdump
try
heapdump = require('heapdump')
heapdump.writeSnapshot()
catch e
console.log 'Could not take snapshot'
log_results()
console.time('saving db')
global.timerrrr = Date.now()
save balance
for name in (get_all_actors() or [])
d = from_cache name
save d
console.timeEnd('saving db')
if config.log_level > 1
console.log "\nDone simulating! That took #{(Date.now() - started_at) / 1000} seconds"
console.log config if config.persist
console.log "PORT: #{bus.port}"
callback?()
one_tick = ->
t = Date.now()
has_unfilled = false
for dealer,positions of open_positions when positions.length > 0
for pos in positions
if (pos.entry && !pos.entry.closed) || (pos.exit && !pos.exit.closed)
has_unfilled = true
break
break if has_unfilled
inc = if has_unfilled
pusher.tick_interval
else
pusher.tick_interval_no_unfilled
tick.time += inc
start += inc
history.advance(tick.time)
simulation_done = tick.time > ts - pusher.tick_interval * 10
######################
#### Accounting
dealers_with_open = (dealer for dealer,positions of open_positions when positions.length > 0)
if dealers_with_open.length > 0
# check if any positions have subsequently closed
yyy = Date.now()
update_position_status balance, dealers_with_open
t_.pos_status += Date.now() - yyy
yyy = Date.now()
update_balance balance, dealers_with_open
t_.balance += Date.now() - yyy
#####################
if !simulation_done
######################
#### Main call. Where the action is.
#pusher.hustle balance, trades
pusher.hustle balance
######################
if simulation_done
return end()
####################
#### Efficiency measures
# xxxx = Date.now()
if ticks % 50000 == 1
global.gc?()
if ticks % 100 == 99
purge_position_status()
# t_.gc += Date.now() - xxxx
####################
#####################
#### Progress bar
if config.log_level > 0
t_sec = {}
for k,v of t_
t_sec[k] = Math.round(v/1000)
perperper = Math.round(100 * (tick.time - time.earliest) / (time.latest - time.earliest))
perbytrade = Math.round(100 * (start_idx - history.trade_idx) / start_idx )
bar.tick 1, extend {ticks,perperper,perbytrade}, t_sec
#####################
ticks++
t_.qtick += Date.now() - t
setImmediate one_tick
setImmediate one_tick
update_balance = (balance, dealers_with_open) ->
btc = eth = btc_on_order = eth_on_order = 0
for dealer in dealers_with_open
positions = open_positions[dealer]
dbtc = deth = dbtc_on_order = deth_on_order = 0
for pos in positions
if pos.entry.type == 'buy'
buy = pos.entry
sell = pos.exit
else
buy = pos.exit
sell = pos.entry
if buy
# used or reserved for buying trade.amount eth
for_purchase = if buy.flags?.market then buy.to_fill else buy.to_fill * buy.rate
dbtc_on_order += for_purchase
dbtc -= for_purchase
if buy.fills?.length > 0
for fill in buy.fills
deth += fill.amount
dbtc -= fill.total
if config.exchange == 'poloniex'
deth -= fill.fee
else
dbtc -= fill.fee
if sell
for_sale = sell.to_fill
deth_on_order += for_sale
deth -= for_sale
if sell.fills?.length > 0
for fill in sell.fills
deth -= fill.amount
dbtc += fill.total
dbtc -= fill.fee
btc += dbtc
eth += deth
btc_on_order += dbtc_on_order
eth_on_order += deth_on_order
dbalance = balance[dealer]
dbalance.balances.c1 = dbalance.deposits.c1 + dbtc + dbalance.accounted_for.c1
dbalance.balances.c2 = dbalance.deposits.c2 + deth + dbalance.accounted_for.c2
dbalance.on_order.c1 = dbtc_on_order
dbalance.on_order.c2 = deth_on_order
if config.enforce_balance && (dbalance.balances.c1 < 0 || dbalance.balances.c2 < 0)
msg =
message: 'negative balance!?!'
balance: balance.balances
dbalance: balance[dealer]
dealer: dealer
config: config
console.log ''
fills = []
fills_out = []
pos = null
for pos in from_cache(dealer).positions
for trade in [pos.entry, pos.exit] when trade
fills = fills.concat trade.fills
console.log trade if config.log_level > 1
for fill in trade.fills
if fill.type == 'sell'
fills_out.push "#{pos.key or 'none'}\t#{trade.entry or false}\t#{trade.created}\t#{fill.order_id or '000'}\t#{fill.total}\t-#{fill.amount}\t#{fill.fee}"
else
fills_out.push "#{pos.key or 'none'}\t#{trade.entry or false}\t#{trade.created}\t#{fill.order_id or '000'}\t-#{fill.total}\t#{fill.amount}\t#{fill.fee}"
# for pos in from_cache(dealer).positions
# for t in [pos.entry, pos.exit] when t
# # msg["#{pos.created}-#{t.type}"] = t
# amt = 0
# tot = 0
# for f,idx in (t.fills or [])
# # msg["#{pos.created}-#{t.type}-f#{idx}"] = f
# amt += f.amount
# tot += f.total
# # console.log
# # type: t.type
# # amt: amt
# # tot: tot
# # fills: (t.fills or []).length
# # closed: t.closed
# console.log t
console.log fills_out
console.assert false, msg
balance.balances.c1 = balance.deposits.c1 + btc + balance.accounted_for.c1
balance.balances.c2 = balance.deposits.c2 + eth + balance.accounted_for.c2
balance.on_order.c1 = btc_on_order
balance.on_order.c2 = eth_on_order
global.trades_closed = {}
purge_position_status = ->
new_position_status = {}
for name, open of open_positions when open.length > 0
for pos in open
for trade in [pos.entry, pos.exit] when trade && !trade.closed
```
key = `${pos.dealer}-${trade.created}-${trade.type}-${trade.rate}`
```
new_position_status[key] = global.position_status[key]
for k,v of global.position_status
if k not of new_position_status
delete global.position_status[k]
update_position_status = (balance, dealers_with_open) ->
end_idx = history.trade_idx
for dealer in dealers_with_open
maker_fee = from_cache('balances').maker_fee
taker_fee = from_cache('balances').taker_fee
open = open_positions[dealer]
closed = []
for pos in open
for trade in [pos.entry, pos.exit] when trade && !trade.closed
```
key = `${pos.dealer}-${trade.created}-${trade.type}-${trade.rate}`
```
status = global.position_status[key]
if trade.to_fill > 0 && (!status? || end_idx < status.idx + 100 )
status = global.position_status[key] = fill_order trade, status
# console.log '\nFILLLLLLLL\n', key, end_idx, status?.idx, status?.fills?.length
if status?.fills?.length > 0
filled = 0
for fill in (status.fills or [])
if fill.date > tick.time
break
amt = fill.amount
rate = fill.rate
if trade.flags?.market && trade.type == 'buy'
to_fill = trade.to_fill
done = amt * rate >= to_fill
fill.total = if !done then amt * rate else to_fill
fill.amount = if !done then amt else to_fill / rate
fill.fee = if trade.type == 'buy' && config.exchange == 'poloniex'
fill.amount * maker_fee
else
fill.amount * fill.rate * maker_fee
trade.to_fill -= fill.total
else
to_fill = trade.to_fill
done = fill.amount >= to_fill || trade.flags?.market
if done
fill.amount = to_fill
xfee = if fill.is_maker then maker_fee else taker_fee
fill.fee = if trade.type == 'buy' && config.exchange == 'poloniex'
fill.amount * xfee
else
fill.amount * fill.rate * xfee
fill.total = fill.amount * rate
trade.to_fill -= fill.amount
fill.type = trade.type
trade.fills.push fill
filled += 1
if filled > 0
status.fills = status.fills.slice(filled)
# if trade.to_fill < 0
# console.assert false,
# message: 'Overfilled!'
# trade: trade
# fills: trade.fills
if trade.to_fill == 0
trade.closed = trade.fills[trade.fills.length - 1].date
global.position_status[key] = undefined
if (pos.entry?.closed && pos.exit?.closed) || (dealers[dealer].never_exits && pos.entry?.closed)
pos.closed = Math.max pos.entry.closed, (pos.exit?.closed or 0)
closed.push pos
for pos in closed
idx = open.indexOf(pos)
open.splice idx, 1
name = pos.dealer
cur_c1 = balance.accounted_for.c1
cur_c2 = balance.accounted_for.c2
for trade in [pos.entry, pos.exit] when trade
close_trade pos, trade
if trade.type == 'buy'
balance.accounted_for.c2 += trade.amount
balance.accounted_for.c1 -= trade.total
balance[name].accounted_for.c2 += trade.amount
balance[name].accounted_for.c1 -= trade.total
else
balance.accounted_for.c2 -= trade.amount
balance.accounted_for.c1 += trade.total
balance[name].accounted_for.c2 -= trade.amount
balance[name].accounted_for.c1 += trade.total
balance.accounted_for.c2 -= trade.c2_fees
balance.accounted_for.c1 -= trade.c1_fees
balance[name].accounted_for.c2 -= trade.c2_fees
balance[name].accounted_for.c1 -= trade.c1_fees
pos.profit = (balance.accounted_for.c1 - cur_c1) / pos.exit.rate + (balance.accounted_for.c2 - cur_c2)
fill_order = (my_trade, status) ->
end_idx = @history.trade_idx
status ||= {
fills: []
idx: false
became_maker: false
}
my_amount = my_trade.amount
my_rate = my_trade.rate
is_sell = my_trade.type == 'sell'
my_created = my_trade.created
order_placement_lag = config.order_placement_lag
is_market = my_trade.flags?.market
if status.idx
start_at = status.idx
else
start_at = end_idx
to_fill = my_trade.to_fill
console.assert to_fill > 0
status.fills ||= []
fills = status.fills
init = false
for idx in [start_at..0] by -1
trade = history.trades[idx]
if !init
if trade.date < my_created + order_placement_lag
continue
else
init = true
if !status.became_maker
status.became_maker = trade.date - (my_created + order_placement_lag) > 1 * 60 || (is_sell && trade.rate <= my_rate) || (!is_sell && trade.rate >= my_rate)
if (!is_sell && trade.rate <= my_rate) || \
( is_sell && trade.rate >= my_rate) || is_market
if is_market
if (is_sell && trade.rate < my_rate) || (!is_sell && trade.rate > my_rate)
rate = trade.rate
else
rate = my_rate
else
rate = my_rate
is_maker = status.became_maker && !is_market
fill =
date: trade.date
rate: rate
amount: trade.amount
maker: is_maker
fills.push fill
if ((!is_market || is_sell) && trade.amount >= to_fill) || \
( (is_market && !is_sell) && trade.total >= to_fill)
status.idx = idx
return status
else
if is_market && !is_sell
to_fill -= fill.amount * fill.rate
else
to_fill -= fill.amount
if !is_market && (!history.trades[end_idx] || trade.date > history.trades[end_idx].date + 30 * 60)
status.idx = idx
return status
store_analysis = ->
balance = from_cache 'balance'
# analysis of positions
fs = require('fs')
if !fs.existsSync 'analyze'
fs.mkdirSync 'analyze'
dir = "analyze/#{config.end - config.length}-#{config.end}"
if !fs.existsSync dir
fs.mkdirSync dir
dealer_names = get_dealers()
sample = null
sample_dealer = null
for name in dealer_names
for pos in (from_cache(name).positions or [])
sample = dealers[name].analyze pos, balance.maker_fee
sample_dealer = name
break
break if sample
return if !sample
cols = Object.keys(sample.dependent).concat(Object.keys(get_settings(sample_dealer))).concat Object.keys(sample.independent)
rows = []
rows.push cols
for name in dealer_names
positions = from_cache(name).positions
dealer = dealers[name]
settings = get_settings(name) or {}
for pos in positions
row = dealer.analyze(pos, balance.maker_fee)
continue if !row
independent = extend {}, row.independent, settings
rows.push ( (if col of independent then independent[col] else row.dependent[col]) for col in cols)
fname = "#{dir}/positions.txt"
fs.writeFileSync fname, (r.join('\t') for r in rows).join('\n'), { flag : 'w' }
# analysis of dealers
KPI (all_stats) ->
cols = ['Name']
pieces = {}
for name in get_dealers()
for part, idx in name.split('&')
if idx > 0
[param,val] = part.split('=')
pieces[param] ||= {}
pieces[param][val] = true
params = (p for p,v of pieces when Object.keys(v).length > 1)
cols = cols.concat params
for measure, __ of dealer_measures(all_stats)
cols.push measure
rows = [cols]
for name in get_dealers()
stats = all_stats[name]
my_params = {}
for part, idx in name.split('&')
if idx > 0
[param,val] = part.split('=')
my_params[param] = val
else
strat = part
row = [strat]
for param in params
if param of my_params
row.push my_params[param]
else
row.push ''
for measure, calc of dealer_measures(all_stats)
row.push calc(name)
rows.push row
fname = "#{dir}/dealers.txt"
fs.writeFileSync fname, (r.join('\t') for r in rows).join('\n'), { flag : 'w' }
log_results = ->
if config.analyze
console.log 'Exporting analysis'
store_analysis()
KPI (all_stats) ->
balances = from_cache 'balances'
row = [config.name, config.c1, config.c2, config.exchange, config.end - config.length, config.end, all_stats.all.$c1_start, all_stats.all.$c2_start, all_stats.all.$c1_end, all_stats.all.$c2_end, balances.deposits.c1, balances.deposits.c2, balances.balances.c1, balances.balances.c2]
for measure, calc of dealer_measures(all_stats)
row.push calc('all')
console.log '\x1b[36m%s\x1b[0m', "#{row[0]} made #{row[18]} profit on #{row[19]} completed trades at #{row[14]} CAGR"
if config.log_results
fs = require('fs')
if !fs.existsSync('logs')
fs.mkdirSync 'logs'
fname = "logs/#{config.log_results}.txt"
if !fs.existsSync(fname)
cols = ['Name', 'Currency1', 'Currency2', 'Exchange', 'Start', 'End', '$c1_start', '$c2_start', '$c1_end', '$c2_end', 'c1_deposit', 'c2_deposit', 'c1_end', 'c2_end']
for measure, __ of dealer_measures(all_stats)
cols.push measure
else
cols = []
rows = [cols]
rows.push row
out = fs.openSync fname, 'a'
fs.writeSync out, (r.join('\t') for r in rows).join('\n')
fs.closeSync out
reset = ->
global.config = {}
KPI.initialized = false
global.open_positions = {}
history.trades = []
pusher.init
history: history
clear_all_positions: true
lab = module.exports =
experiment: (conf, callback) ->
global.config = {}
global.config = defaults global.config, conf,
key: 'PI:KEY:<KEY>END_PI'
exchange: 'poloniex'
simulation: true
eval_entry_every_n_seconds: 60
eval_exit_every_n_seconds: 60
eval_unfilled_every_n_seconds: 60
length: 12 * 24 * 60 * 60
c1: 'BTC'
c2: 'ETH'
accounting_currency: 'USDT'
order_placement_lag: 1
log: true
enforce_balance: true
persist: false
analyze: false
produce_heapdump: false
offline: false
auto_shorten_time: true
deposit_allocation: '50/50'
log_level: 1
save config
# set globals
global.position_status = {}
ts = config.end or now()
# history.load_chart_history "c1xc2", config.c1, config.c2, ts - 20 * 365 * 24 * 60 * 60, ts, ->
# console.log 'use me to get earliest trade for pair', config.c1, config.c2
# process.exit()
# return
pusher.init
history: history
clear_all_positions: true
console.assert !isNaN(history.longest_requested_history),
message: 'Longest requested history is NaN. Perhaps you haven\'t registered any dealers'
# console.log 'longest requested history:', history.longest_requested_history
history_width = history.longest_requested_history + config.length + 24 * 60 * 60
earliest_trade_for_pair = exchange.get_earliest_trade {only_high_volume: config.only_high_volume, exchange: config.exchange, c1: config.c1, c2: config.c2, accounting_currency: config.accounting_currency}
if ts > earliest_trade_for_pair
if config.auto_shorten_time && ts - history_width < earliest_trade_for_pair
shrink_by = earliest_trade_for_pair - (ts - history_width) + 24 * 60 * 60
config.length -= shrink_by
history_width = history.longest_requested_history + config.length + 24 * 60 * 60
console.log "Shortened simulation", {shrink_by, end: ts, start: ts - history_width, history_width, earliest_trade_for_pair}
if ts - history_width >= earliest_trade_for_pair
console.log "Running #{Object.keys(dealers).length} dealers" if config.log_level > 0
history.load_price_data
start: ts - history_width
end: ts
callback: ->
console.log "...loading #{ (history_width / 60 / 60 / 24).toFixed(2) } days of trade history, relative to #{ts}" if config.log_level > 1
history.load ts - history_width, ts, ->
console.log "...experimenting!" if config.log_level > 1
simulate ts, callback
else
console.log "Can't experiment during that time. The currency pair wasn't trading before the start date."
callback()
else
console.log "Can't experiment during that time. The currency pair wasn't trading before the end date."
callback()
setup: ({persist, port, db_name, clear_old, no_client}) ->
global.pointerify = true
global.upload_dir = 'static/'
global.bus = require('statebus').serve
port: port
file_store: false
client: false
bus.honk = false
if persist
if clear_old && fs.existsSync(db_name)
fs.unlinkSync(db_name)
bus.sqlite_store
filename: db_name
use_transactions: true
backups: false
global.save = bus.save
global.fetch = (key) ->
bus.fetch deslash key
global.del = bus.del
if !no_client
require 'coffee-script'
require './shared'
express = require('express')
bus.http.use('/node_modules', express.static('node_modules'))
bus.http.use('/node_modules', express.static('meth/node_modules'))
bus.http.use('/meth/vendor', express.static('meth/vendor'))
# taken from statebus server.js. Just wanted different client path.
bus.http_serve '/meth/:filename', (filename) ->
filename = deslash filename
source = bus.read_file(filename)
if filename.match(/\.coffee$/)
try
compiled = require('coffee-script').compile source,
filename: filename
bare: true
sourceMap: true
catch e
console.error('Could not compile ' + filename + ': ', e)
return ''
compiled = require('coffee-script').compile(source, {filename: filename, bare: true, sourceMap: true})
source_map = JSON.parse(compiled.v3SourceMap)
source_map.sourcesContent = source
compiled = 'window.dom = window.dom || {}\n' + compiled.js
compiled = 'window.ui = window.ui || {}\n' + compiled
btoa = (s) -> return new Buffer(s.toString(),'binary').toString('base64')
# Base64 encode it
compiled += '\n'
compiled += '//# sourceMappingURL=data:application/json;base64,'
compiled += btoa(JSON.stringify(source_map)) + '\n'
compiled += '//# sourceURL=' + filename
return compiled
else return source
bus.http.get '/*', (r,res) =>
paths = r.url.split('/')
paths.shift() if paths[0] == ''
console.log r.url
prefix = ''
server = "statei://localhost:#{bus.port}"
html = """
<!DOCTYPE html>
<html>
<head>
<script type="coffeedom">
bus.honk = false
#</script>
<script src="#{prefix}/node_modules/statebus/client.js" server="#{server}"></script>
<script src="#{prefix}/meth/vendor/d3.js"></script>
<script src="#{prefix}/meth/vendor/md5.js"></script>
<script src="#{prefix}/meth/vendor/plotly.js"></script>
<script src="#{prefix}/meth/shared.coffee"></script>
<script src="#{prefix}/meth/crunch.coffee"></script>
<script src="#{prefix}/meth/dash.coffee"></script>
<link rel="stylesheet" href="#{prefix}/meth/vendor/fonts/Bebas Neue/bebas.css" type="text/css"/>
</head>
<body>
</body>
</html>
"""
res.send(html)
bus.http.use('/node_modules', express.static('node_modules'))
|
[
{
"context": "profile_name)\n gcc_index = id if key is 'gcc_clang'\n @profile[0].selectedIndex = gcc_index\n\n ",
"end": 1781,
"score": 0.9783603549003601,
"start": 1772,
"tag": "KEY",
"value": "gcc_clang"
}
] | lib/stream-modifiers/profile.coffee | fstiewitz/build-tools-cpp | 3 | {$, $$, TextEditorView, View} = require 'atom-space-pen-views'
Profiles = require '../profiles/profiles'
module.exports =
name: 'Highlighting Profile'
info:
class ProfileInfoPane
constructor: (command, config) ->
@element = document.createElement 'div'
@element.classList.add 'module'
key = document.createElement 'div'
key.classList.add 'text-padded'
key.innerText = 'Profile:'
value = document.createElement 'div'
value.classList.add 'text-padded'
value.innerText = Profiles.profiles[config.profile]?.profile_name
@element.appendChild key
@element.appendChild value
edit:
class ProfileEditPane extends View
@content: ->
@div class: 'panel-body padded', =>
@div class: 'block', =>
@label =>
@div class: 'settings-name', 'Profile'
@div =>
@span class: 'inline-block text-subtle', 'Select Highlighting Profile'
@select class: 'form-control', outlet: 'profile'
set: (command, config) ->
@populateProfiles()
if config?
@selectProfile config.profile
get: (command, stream) ->
command[stream].pipeline.push {
name: 'profile'
config:
profile: @profile.children()[@profile[0].selectedIndex].attributes.getNamedItem('value').nodeValue
}
return null
populateProfiles: ->
createitem = (key, profile) ->
$$ ->
@option value: key, profile
@profile.empty()
gcc_index = 0
for key, id in Object.keys Profiles.profiles
@profile.append createitem(key, Profiles.profiles[key].profile_name)
gcc_index = id if key is 'gcc_clang'
@profile[0].selectedIndex = gcc_index
selectProfile: (profile) ->
for option, id in @profile.children()
if option.attributes.getNamedItem('value').nodeValue is profile
@profile[0].selectedIndex = id
break
modifier:
class ProfileModifier
constructor: (@config, @command, @output) ->
@profile = new Profiles.profiles[@config.profile]?(@output)
if not @profile?
atom.notifications?.addError "Could not find highlighting profile: #{@config.profile}"
return
@profile.clear?()
@modify = this['modify' + Profiles.versions[@config.profile]]
modify: -> null
modify1: ({temp}) ->
@profile.in temp.input
return 1
modify2: ({temp, perm}) ->
return @profile.in temp, perm
getFiles: ({temp, perm}) ->
if @profile?
return @profile.files temp.input
else
return []
| 96223 | {$, $$, TextEditorView, View} = require 'atom-space-pen-views'
Profiles = require '../profiles/profiles'
module.exports =
name: 'Highlighting Profile'
info:
class ProfileInfoPane
constructor: (command, config) ->
@element = document.createElement 'div'
@element.classList.add 'module'
key = document.createElement 'div'
key.classList.add 'text-padded'
key.innerText = 'Profile:'
value = document.createElement 'div'
value.classList.add 'text-padded'
value.innerText = Profiles.profiles[config.profile]?.profile_name
@element.appendChild key
@element.appendChild value
edit:
class ProfileEditPane extends View
@content: ->
@div class: 'panel-body padded', =>
@div class: 'block', =>
@label =>
@div class: 'settings-name', 'Profile'
@div =>
@span class: 'inline-block text-subtle', 'Select Highlighting Profile'
@select class: 'form-control', outlet: 'profile'
set: (command, config) ->
@populateProfiles()
if config?
@selectProfile config.profile
get: (command, stream) ->
command[stream].pipeline.push {
name: 'profile'
config:
profile: @profile.children()[@profile[0].selectedIndex].attributes.getNamedItem('value').nodeValue
}
return null
populateProfiles: ->
createitem = (key, profile) ->
$$ ->
@option value: key, profile
@profile.empty()
gcc_index = 0
for key, id in Object.keys Profiles.profiles
@profile.append createitem(key, Profiles.profiles[key].profile_name)
gcc_index = id if key is '<KEY>'
@profile[0].selectedIndex = gcc_index
selectProfile: (profile) ->
for option, id in @profile.children()
if option.attributes.getNamedItem('value').nodeValue is profile
@profile[0].selectedIndex = id
break
modifier:
class ProfileModifier
constructor: (@config, @command, @output) ->
@profile = new Profiles.profiles[@config.profile]?(@output)
if not @profile?
atom.notifications?.addError "Could not find highlighting profile: #{@config.profile}"
return
@profile.clear?()
@modify = this['modify' + Profiles.versions[@config.profile]]
modify: -> null
modify1: ({temp}) ->
@profile.in temp.input
return 1
modify2: ({temp, perm}) ->
return @profile.in temp, perm
getFiles: ({temp, perm}) ->
if @profile?
return @profile.files temp.input
else
return []
| true | {$, $$, TextEditorView, View} = require 'atom-space-pen-views'
Profiles = require '../profiles/profiles'
module.exports =
name: 'Highlighting Profile'
info:
class ProfileInfoPane
constructor: (command, config) ->
@element = document.createElement 'div'
@element.classList.add 'module'
key = document.createElement 'div'
key.classList.add 'text-padded'
key.innerText = 'Profile:'
value = document.createElement 'div'
value.classList.add 'text-padded'
value.innerText = Profiles.profiles[config.profile]?.profile_name
@element.appendChild key
@element.appendChild value
edit:
class ProfileEditPane extends View
@content: ->
@div class: 'panel-body padded', =>
@div class: 'block', =>
@label =>
@div class: 'settings-name', 'Profile'
@div =>
@span class: 'inline-block text-subtle', 'Select Highlighting Profile'
@select class: 'form-control', outlet: 'profile'
set: (command, config) ->
@populateProfiles()
if config?
@selectProfile config.profile
get: (command, stream) ->
command[stream].pipeline.push {
name: 'profile'
config:
profile: @profile.children()[@profile[0].selectedIndex].attributes.getNamedItem('value').nodeValue
}
return null
populateProfiles: ->
createitem = (key, profile) ->
$$ ->
@option value: key, profile
@profile.empty()
gcc_index = 0
for key, id in Object.keys Profiles.profiles
@profile.append createitem(key, Profiles.profiles[key].profile_name)
gcc_index = id if key is 'PI:KEY:<KEY>END_PI'
@profile[0].selectedIndex = gcc_index
selectProfile: (profile) ->
for option, id in @profile.children()
if option.attributes.getNamedItem('value').nodeValue is profile
@profile[0].selectedIndex = id
break
modifier:
class ProfileModifier
constructor: (@config, @command, @output) ->
@profile = new Profiles.profiles[@config.profile]?(@output)
if not @profile?
atom.notifications?.addError "Could not find highlighting profile: #{@config.profile}"
return
@profile.clear?()
@modify = this['modify' + Profiles.versions[@config.profile]]
modify: -> null
modify1: ({temp}) ->
@profile.in temp.input
return 1
modify2: ({temp, perm}) ->
return @profile.in temp, perm
getFiles: ({temp, perm}) ->
if @profile?
return @profile.files temp.input
else
return []
|
[
{
"context": "=================================\n# Copyright 2014 Hatio, Lab.\n# Licensed under The MIT License\n# http://o",
"end": 67,
"score": 0.9448230266571045,
"start": 62,
"tag": "NAME",
"value": "Hatio"
}
] | src/Module.coffee | heartyoh/infopik | 0 | # ==========================================
# Copyright 2014 Hatio, Lab.
# Licensed under The MIT License
# http://opensource.org/licenses/MIT
# ==========================================
# Ref. http://arcturo.github.io/library/coffeescript/03_classes.html
define [
], (
) ->
moduleKeywords = ['extended', 'included']
class Module
@extend: (obj) ->
for key, value of obj when key not in moduleKeywords
@[key] = value
obj.extended?.apply(@)
this
@include: (obj) ->
for key, value of obj when key not in moduleKeywords
# Assign properties to the prototype
@::[key] = value
obj.included?.apply(@)
this | 5932 | # ==========================================
# Copyright 2014 <NAME>, Lab.
# Licensed under The MIT License
# http://opensource.org/licenses/MIT
# ==========================================
# Ref. http://arcturo.github.io/library/coffeescript/03_classes.html
define [
], (
) ->
moduleKeywords = ['extended', 'included']
class Module
@extend: (obj) ->
for key, value of obj when key not in moduleKeywords
@[key] = value
obj.extended?.apply(@)
this
@include: (obj) ->
for key, value of obj when key not in moduleKeywords
# Assign properties to the prototype
@::[key] = value
obj.included?.apply(@)
this | true | # ==========================================
# Copyright 2014 PI:NAME:<NAME>END_PI, Lab.
# Licensed under The MIT License
# http://opensource.org/licenses/MIT
# ==========================================
# Ref. http://arcturo.github.io/library/coffeescript/03_classes.html
define [
], (
) ->
moduleKeywords = ['extended', 'included']
class Module
@extend: (obj) ->
for key, value of obj when key not in moduleKeywords
@[key] = value
obj.extended?.apply(@)
this
@include: (obj) ->
for key, value of obj when key not in moduleKeywords
# Assign properties to the prototype
@::[key] = value
obj.included?.apply(@)
this |
[
{
"context": "ceholderText: 'Put where statement here (Name = \\'Blah\\')')\n @div class: 'row sfdc-row-marg-5', =",
"end": 1095,
"score": 0.9996695518493652,
"start": 1091,
"tag": "NAME",
"value": "Blah"
}
] | lib/interactive-query-view.coffee | haggy/Proton-IDE | 3 | {View, EditorView} = require 'atom'
InteractiveQueryController = require './sfdc_core/interactive-query-controller'
module.exports =
class InteractiveQueryView extends View
@content: ->
@div id: 'sfdc-interactive-query', class: 'overlay sfdc-overlay', =>
@div class: 'sfdc-error-message'
@div class: 'container', =>
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-6', =>
@div class: 'editor-container', =>
@subview 'selectEditor', new EditorView(mini: true, placeholderText: 'Type select fields (with commas)')
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-6', =>
@div class: 'editor-container', =>
@subview 'fromEditor', new EditorView(mini: true, placeholderText: 'Put object type here (Account, Contact etc)')
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-6', =>
@div class: 'editor-container', =>
@subview 'whereEditor', new EditorView(mini: true, placeholderText: 'Put where statement here (Name = \'Blah\')')
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-12', =>
@div id: 'sfdc-interactive-table-cont', class: 'native-key-bindings', tabindex: -1, =>
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-4', =>
@div id: 'sfdc-anon-apex-group', class: 'btn-group', =>
@button "Execute Query", outlet: 'execQueryButton', class: 'btn btn-info'
@button "Save rows", outlet: 'saveRowsButton', class: 'btn btn-info'
@button "Close", outlet: 'exitQueryButton', class: 'btn btn-warning'
initialize: (serializedConfig) ->
# Returns an object that can be retrieved when package is activated
serialize: ->
# Tear down any state and detach
destroy: ->
@detach()
toggle: ->
if @hasParent()
@detach()
else
atom.workspaceView.append(this)
@cont = new InteractiveQueryController(this)
addError: (msg) ->
console.log "Adding #{msg}"
this.find('.sfdc-error-message').html(msg)
removeError: ->
this.find('.sfdc-error-message').html('')
| 7831 | {View, EditorView} = require 'atom'
InteractiveQueryController = require './sfdc_core/interactive-query-controller'
module.exports =
class InteractiveQueryView extends View
@content: ->
@div id: 'sfdc-interactive-query', class: 'overlay sfdc-overlay', =>
@div class: 'sfdc-error-message'
@div class: 'container', =>
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-6', =>
@div class: 'editor-container', =>
@subview 'selectEditor', new EditorView(mini: true, placeholderText: 'Type select fields (with commas)')
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-6', =>
@div class: 'editor-container', =>
@subview 'fromEditor', new EditorView(mini: true, placeholderText: 'Put object type here (Account, Contact etc)')
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-6', =>
@div class: 'editor-container', =>
@subview 'whereEditor', new EditorView(mini: true, placeholderText: 'Put where statement here (Name = \'<NAME>\')')
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-12', =>
@div id: 'sfdc-interactive-table-cont', class: 'native-key-bindings', tabindex: -1, =>
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-4', =>
@div id: 'sfdc-anon-apex-group', class: 'btn-group', =>
@button "Execute Query", outlet: 'execQueryButton', class: 'btn btn-info'
@button "Save rows", outlet: 'saveRowsButton', class: 'btn btn-info'
@button "Close", outlet: 'exitQueryButton', class: 'btn btn-warning'
initialize: (serializedConfig) ->
# Returns an object that can be retrieved when package is activated
serialize: ->
# Tear down any state and detach
destroy: ->
@detach()
toggle: ->
if @hasParent()
@detach()
else
atom.workspaceView.append(this)
@cont = new InteractiveQueryController(this)
addError: (msg) ->
console.log "Adding #{msg}"
this.find('.sfdc-error-message').html(msg)
removeError: ->
this.find('.sfdc-error-message').html('')
| true | {View, EditorView} = require 'atom'
InteractiveQueryController = require './sfdc_core/interactive-query-controller'
module.exports =
class InteractiveQueryView extends View
@content: ->
@div id: 'sfdc-interactive-query', class: 'overlay sfdc-overlay', =>
@div class: 'sfdc-error-message'
@div class: 'container', =>
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-6', =>
@div class: 'editor-container', =>
@subview 'selectEditor', new EditorView(mini: true, placeholderText: 'Type select fields (with commas)')
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-6', =>
@div class: 'editor-container', =>
@subview 'fromEditor', new EditorView(mini: true, placeholderText: 'Put object type here (Account, Contact etc)')
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-6', =>
@div class: 'editor-container', =>
@subview 'whereEditor', new EditorView(mini: true, placeholderText: 'Put where statement here (Name = \'PI:NAME:<NAME>END_PI\')')
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-12', =>
@div id: 'sfdc-interactive-table-cont', class: 'native-key-bindings', tabindex: -1, =>
@div class: 'row sfdc-row-marg-5', =>
@div class: 'col-sm-4', =>
@div id: 'sfdc-anon-apex-group', class: 'btn-group', =>
@button "Execute Query", outlet: 'execQueryButton', class: 'btn btn-info'
@button "Save rows", outlet: 'saveRowsButton', class: 'btn btn-info'
@button "Close", outlet: 'exitQueryButton', class: 'btn btn-warning'
initialize: (serializedConfig) ->
# Returns an object that can be retrieved when package is activated
serialize: ->
# Tear down any state and detach
destroy: ->
@detach()
toggle: ->
if @hasParent()
@detach()
else
atom.workspaceView.append(this)
@cont = new InteractiveQueryController(this)
addError: (msg) ->
console.log "Adding #{msg}"
this.find('.sfdc-error-message').html(msg)
removeError: ->
this.find('.sfdc-error-message').html('')
|
[
{
"context": "\n {\n id: 1\n name: \"brian\"\n },{\n id: 2\n name",
"end": 1386,
"score": 0.9994816184043884,
"start": 1381,
"tag": "NAME",
"value": "brian"
},
{
"context": " },{\n id: 2\n name: \"jennifer\"\n }\n ]\n\n context \"#writeFile\", -",
"end": 1447,
"score": 0.9994561672210693,
"start": 1439,
"tag": "NAME",
"value": "jennifer"
}
] | packages/server/test/unit/files_spec.coffee | nothingismagick/cypress | 2 | require("../spec_helper")
config = require("#{root}lib/config")
files = require("#{root}lib/files")
FixturesHelper = require("#{root}/test/support/helpers/fixtures")
filesController = require("#{root}lib/controllers/files")
describe "lib/files", ->
beforeEach ->
FixturesHelper.scaffold()
@todosPath = FixturesHelper.projectPath("todos")
config.get(@todosPath).then (cfg) =>
@config = cfg
{@projectRoot} = cfg
afterEach ->
FixturesHelper.remove()
context "#readFile", ->
it "returns contents and full file path", ->
files.readFile(@projectRoot, "tests/_fixtures/message.txt").then ({ contents, filePath }) ->
expect(contents).to.eq "foobarbaz"
expect(filePath).to.include "/.projects/todos/tests/_fixtures/message.txt"
it "returns uses utf8 by default", ->
files.readFile(@projectRoot, "tests/_fixtures/ascii.foo").then ({ contents }) ->
expect(contents).to.eq "\n"
it "uses encoding specified in options", ->
files.readFile(@projectRoot, "tests/_fixtures/ascii.foo", {encoding: "ascii"}).then ({ contents }) ->
expect(contents).to.eq "o#?\n"
it "parses json to valid JS object", ->
files.readFile(@projectRoot, "tests/_fixtures/users.json").then ({ contents }) ->
expect(contents).to.eql [
{
id: 1
name: "brian"
},{
id: 2
name: "jennifer"
}
]
context "#writeFile", ->
it "writes the file's contents and returns contents and full file path", ->
files.writeFile(@projectRoot, ".projects/write_file.txt", "foo").then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents, filePath }) ->
expect(contents).to.equal("foo")
expect(filePath).to.include("/.projects/todos/.projects/write_file.txt")
it "uses encoding specified in options", ->
files.writeFile(@projectRoot, ".projects/write_file.txt", "", {encoding: "ascii"}).then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents }) ->
expect(contents).to.equal("�")
it "overwrites existing file without issue", ->
files.writeFile(@projectRoot, ".projects/write_file.txt", "foo").then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents }) =>
expect(contents).to.equal("foo")
files.writeFile(@projectRoot, ".projects/write_file.txt", "bar").then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents }) ->
expect(contents).to.equal("bar")
| 110747 | require("../spec_helper")
config = require("#{root}lib/config")
files = require("#{root}lib/files")
FixturesHelper = require("#{root}/test/support/helpers/fixtures")
filesController = require("#{root}lib/controllers/files")
describe "lib/files", ->
beforeEach ->
FixturesHelper.scaffold()
@todosPath = FixturesHelper.projectPath("todos")
config.get(@todosPath).then (cfg) =>
@config = cfg
{@projectRoot} = cfg
afterEach ->
FixturesHelper.remove()
context "#readFile", ->
it "returns contents and full file path", ->
files.readFile(@projectRoot, "tests/_fixtures/message.txt").then ({ contents, filePath }) ->
expect(contents).to.eq "foobarbaz"
expect(filePath).to.include "/.projects/todos/tests/_fixtures/message.txt"
it "returns uses utf8 by default", ->
files.readFile(@projectRoot, "tests/_fixtures/ascii.foo").then ({ contents }) ->
expect(contents).to.eq "\n"
it "uses encoding specified in options", ->
files.readFile(@projectRoot, "tests/_fixtures/ascii.foo", {encoding: "ascii"}).then ({ contents }) ->
expect(contents).to.eq "o#?\n"
it "parses json to valid JS object", ->
files.readFile(@projectRoot, "tests/_fixtures/users.json").then ({ contents }) ->
expect(contents).to.eql [
{
id: 1
name: "<NAME>"
},{
id: 2
name: "<NAME>"
}
]
context "#writeFile", ->
it "writes the file's contents and returns contents and full file path", ->
files.writeFile(@projectRoot, ".projects/write_file.txt", "foo").then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents, filePath }) ->
expect(contents).to.equal("foo")
expect(filePath).to.include("/.projects/todos/.projects/write_file.txt")
it "uses encoding specified in options", ->
files.writeFile(@projectRoot, ".projects/write_file.txt", "", {encoding: "ascii"}).then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents }) ->
expect(contents).to.equal("�")
it "overwrites existing file without issue", ->
files.writeFile(@projectRoot, ".projects/write_file.txt", "foo").then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents }) =>
expect(contents).to.equal("foo")
files.writeFile(@projectRoot, ".projects/write_file.txt", "bar").then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents }) ->
expect(contents).to.equal("bar")
| true | require("../spec_helper")
config = require("#{root}lib/config")
files = require("#{root}lib/files")
FixturesHelper = require("#{root}/test/support/helpers/fixtures")
filesController = require("#{root}lib/controllers/files")
describe "lib/files", ->
beforeEach ->
FixturesHelper.scaffold()
@todosPath = FixturesHelper.projectPath("todos")
config.get(@todosPath).then (cfg) =>
@config = cfg
{@projectRoot} = cfg
afterEach ->
FixturesHelper.remove()
context "#readFile", ->
it "returns contents and full file path", ->
files.readFile(@projectRoot, "tests/_fixtures/message.txt").then ({ contents, filePath }) ->
expect(contents).to.eq "foobarbaz"
expect(filePath).to.include "/.projects/todos/tests/_fixtures/message.txt"
it "returns uses utf8 by default", ->
files.readFile(@projectRoot, "tests/_fixtures/ascii.foo").then ({ contents }) ->
expect(contents).to.eq "\n"
it "uses encoding specified in options", ->
files.readFile(@projectRoot, "tests/_fixtures/ascii.foo", {encoding: "ascii"}).then ({ contents }) ->
expect(contents).to.eq "o#?\n"
it "parses json to valid JS object", ->
files.readFile(@projectRoot, "tests/_fixtures/users.json").then ({ contents }) ->
expect(contents).to.eql [
{
id: 1
name: "PI:NAME:<NAME>END_PI"
},{
id: 2
name: "PI:NAME:<NAME>END_PI"
}
]
context "#writeFile", ->
it "writes the file's contents and returns contents and full file path", ->
files.writeFile(@projectRoot, ".projects/write_file.txt", "foo").then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents, filePath }) ->
expect(contents).to.equal("foo")
expect(filePath).to.include("/.projects/todos/.projects/write_file.txt")
it "uses encoding specified in options", ->
files.writeFile(@projectRoot, ".projects/write_file.txt", "", {encoding: "ascii"}).then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents }) ->
expect(contents).to.equal("�")
it "overwrites existing file without issue", ->
files.writeFile(@projectRoot, ".projects/write_file.txt", "foo").then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents }) =>
expect(contents).to.equal("foo")
files.writeFile(@projectRoot, ".projects/write_file.txt", "bar").then =>
files.readFile(@projectRoot, ".projects/write_file.txt").then ({ contents }) ->
expect(contents).to.equal("bar")
|
[
{
"context": "###################################\n#\n# Created by Markus\n#\n###############################################",
"end": 77,
"score": 0.9986821413040161,
"start": 71,
"tag": "NAME",
"value": "Markus"
}
] | server/logic/admissions.coffee | MooqitaSFH/worklearn | 0 | #######################################################
#
# Created by Markus
#
#######################################################
#######################################################
@gen_admissions = (collection_name, item_id, admissions) ->
if not collection_name
throw new Meteor.Error "collection_name need to be defined"
if not item_id
throw new Meteor.Error "Item need to be defined"
if not admissions
throw new Meteor.Error "Mails need to be defined"
collection = get_collection_save collection_name
item = collection.findOne item_id
users = []
for a in admissions
user = Accounts.findUserByEmail a.email
if not user
continue
gen_admission collection_name, item, user, a.role
users.push user
return users
#######################################################
@gen_admission = (collection, item, user, role) ->
if typeof collection != "string"
collection = collection._name
if typeof item != "string"
item = item._id
if typeof user != "string"
user = user._id
if typeof role != "string"
throw "Role needs to be a string found: " + role
filter =
c: collection
i: item
u: user
r: role
admission = Admissions.findOne filter
if admission
msg = "Admission already exists."
log_event msg
return item._id
item_id = Admissions.insert filter
return item_id
#######################################################
@remove_admissions = (collection, item_ids, user) ->
filter =
c: get_collection_name(collection)
i:
$in: item_ids
count = Admissions.remove filter
msg = count + " admissions removed by: " + get_user_mail(user)
log_event msg, event_logic, event_info
return count
| 58162 | #######################################################
#
# Created by <NAME>
#
#######################################################
#######################################################
@gen_admissions = (collection_name, item_id, admissions) ->
if not collection_name
throw new Meteor.Error "collection_name need to be defined"
if not item_id
throw new Meteor.Error "Item need to be defined"
if not admissions
throw new Meteor.Error "Mails need to be defined"
collection = get_collection_save collection_name
item = collection.findOne item_id
users = []
for a in admissions
user = Accounts.findUserByEmail a.email
if not user
continue
gen_admission collection_name, item, user, a.role
users.push user
return users
#######################################################
@gen_admission = (collection, item, user, role) ->
if typeof collection != "string"
collection = collection._name
if typeof item != "string"
item = item._id
if typeof user != "string"
user = user._id
if typeof role != "string"
throw "Role needs to be a string found: " + role
filter =
c: collection
i: item
u: user
r: role
admission = Admissions.findOne filter
if admission
msg = "Admission already exists."
log_event msg
return item._id
item_id = Admissions.insert filter
return item_id
#######################################################
@remove_admissions = (collection, item_ids, user) ->
filter =
c: get_collection_name(collection)
i:
$in: item_ids
count = Admissions.remove filter
msg = count + " admissions removed by: " + get_user_mail(user)
log_event msg, event_logic, event_info
return count
| true | #######################################################
#
# Created by PI:NAME:<NAME>END_PI
#
#######################################################
#######################################################
@gen_admissions = (collection_name, item_id, admissions) ->
if not collection_name
throw new Meteor.Error "collection_name need to be defined"
if not item_id
throw new Meteor.Error "Item need to be defined"
if not admissions
throw new Meteor.Error "Mails need to be defined"
collection = get_collection_save collection_name
item = collection.findOne item_id
users = []
for a in admissions
user = Accounts.findUserByEmail a.email
if not user
continue
gen_admission collection_name, item, user, a.role
users.push user
return users
#######################################################
@gen_admission = (collection, item, user, role) ->
if typeof collection != "string"
collection = collection._name
if typeof item != "string"
item = item._id
if typeof user != "string"
user = user._id
if typeof role != "string"
throw "Role needs to be a string found: " + role
filter =
c: collection
i: item
u: user
r: role
admission = Admissions.findOne filter
if admission
msg = "Admission already exists."
log_event msg
return item._id
item_id = Admissions.insert filter
return item_id
#######################################################
@remove_admissions = (collection, item_ids, user) ->
filter =
c: get_collection_name(collection)
i:
$in: item_ids
count = Admissions.remove filter
msg = count + " admissions removed by: " + get_user_mail(user)
log_event msg, event_logic, event_info
return count
|
[
{
"context": "google.com'), -1\n\t\t\tdone()\n\n\tit 'should work with 50.116.8.109', (done) ->\n\t\twhois.lookup '50.116.8.109', (err, ",
"end": 336,
"score": 0.9997665882110596,
"start": 324,
"tag": "IP_ADDRESS",
"value": "50.116.8.109"
},
{
"context": "ork with 50.116.8.109', (done) ->\n\t\twhois.lookup '50.116.8.109', (err, data) ->\n\t\t\tassert.ifError err\n\t\t\tassert.",
"end": 377,
"score": 0.9997601509094238,
"start": 365,
"tag": "IP_ADDRESS",
"value": "50.116.8.109"
},
{
"context": " linode-us'), -1\n\t\t\tdone()\n\n\tit 'should work with 2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d', (done) ->\n\t\twhois.lookup '2001:0db8:11a3:09d7:1",
"end": 568,
"score": 0.999649167060852,
"start": 529,
"tag": "IP_ADDRESS",
"value": "2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d"
},
{
"context": "7:1f34:8a2e:07a0:765d', (done) ->\n\t\twhois.lookup '2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d', (err, data) ->\n\t\t\tassert.ifError err\n\t\t\tassert.",
"end": 636,
"score": 0.9996123313903809,
"start": 597,
"tag": "IP_ADDRESS",
"value": "2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d"
},
{
"context": "Equal data.toLowerCase().indexOf('inet6num: 2001:db8::/32'), -1\n\t\t\tdone()\n\n\tit 'should honor specified W",
"end": 747,
"score": 0.9862627983093262,
"start": 739,
"tag": "IP_ADDRESS",
"value": "2001:db8"
},
{
"context": "irects for IP address', (done) ->\n\t\twhois.lookup '176.58.115.202', follow: 1, (err, data) ->\n\t\t\tassert.ifError err",
"end": 1771,
"score": 0.9996885657310486,
"start": 1757,
"tag": "IP_ADDRESS",
"value": "176.58.115.202"
},
{
"context": "Equal data.toLowerCase().indexOf('inetnum: 176.58.112.0 - 176.58.119.255'), -1\n\t\t\tdone()\n\n\tit 'should wor",
"end": 1897,
"score": 0.9996680617332458,
"start": 1885,
"tag": "IP_ADDRESS",
"value": "176.58.112.0"
},
{
"context": "werCase().indexOf('inetnum: 176.58.112.0 - 176.58.119.255'), -1\n\t\t\tdone()\n\n\tit 'should work with verbose op",
"end": 1914,
"score": 0.9996670484542847,
"start": 1900,
"tag": "IP_ADDRESS",
"value": "176.58.119.255"
},
{
"context": "oology.org'), -1\n\t\t\tdone()\n\n\tit 'should work with 148.241.109.161', (done) ->\n\t\twhois.lookup '148.241.109.161', {en",
"end": 5606,
"score": 0.9995384812355042,
"start": 5591,
"tag": "IP_ADDRESS",
"value": "148.241.109.161"
},
{
"context": " with 148.241.109.161', (done) ->\n\t\twhois.lookup '148.241.109.161', {encoding: 'binary'}, (err, data) ->\n\t\t\tassert",
"end": 5649,
"score": 0.9996920228004456,
"start": 5635,
"tag": "IP_ADDRESS",
"value": "148.241.109.16"
}
] | test.coffee | davidbodnar/node-whois | 0 | _ = require 'underscore'
assert = require 'assert'
whois = require './index'
describe '#lookup()', ->
it 'should work with google.com', (done) ->
whois.lookup 'google.com', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with 50.116.8.109', (done) ->
whois.lookup '50.116.8.109', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('netname: linode-us'), -1
done()
it 'should work with 2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d', (done) ->
whois.lookup '2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('inet6num: 2001:db8::/32'), -1
done()
it 'should honor specified WHOIS server', (done) ->
whois.lookup 'gandi.net', server: 'whois.gandi.net', (err, data) ->
assert.ifError err
data = data.toLowerCase()
assert.notEqual data.indexOf('whois server: whois.gandi.net'), -1
assert.notEqual data.indexOf('domain name: gandi.net'), -1
done()
it 'should honor specified WHOIS server with port override', (done) ->
whois.lookup 'tucows.com', server: 'whois.tucows.com:43', (err, data) ->
assert.ifError err
data = data.toLowerCase()
assert.notEqual data.indexOf('whois server: whois.tucows.com'), -1
assert.notEqual data.indexOf('domain name: tucows.com'), -1
done()
it 'should follow specified number of redirects for domain', (done) ->
whois.lookup 'google.com', follow: 1, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should follow specified number of redirects for IP address', (done) ->
whois.lookup '176.58.115.202', follow: 1, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('inetnum: 176.58.112.0 - 176.58.119.255'), -1
done()
it 'should work with verbose option', (done) ->
whois.lookup 'google.com', {verbose: true}, (err, data) ->
assert.ifError err
assert.equal data[0].server, 'whois.verisign-grs.com'
assert.notEqual data[0].data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with nic.sh', (done) ->
whois.lookup 'nic.sh', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d503300000040403495-lrms'), -1
done()
it 'should work with nic.io', (done) ->
whois.lookup 'nic.io', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d503300000040453277-lrms'), -1
done()
it 'should work with nic.ac', (done) ->
whois.lookup 'nic.ac', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d503300000040632620-lrms'), -1
done()
it 'should work with nic.tm', (done) ->
whois.lookup 'nic.tm', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('status : permanent/reserved'), -1
done()
it 'should work with nic.global', (done) ->
whois.lookup 'nic.global', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d2836144-agrs'), -1
done()
it 'should work with srs.net.nz', (done) ->
whois.lookup 'srs.net.nz', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain_name: srs.net.nz'), -1
done()
it 'should work with redundant follow', (done) ->
whois.lookup 'google.com', follow: 5, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with küche.de', (done) ->
whois.lookup 'küche.de', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain: küche.de'), -1
assert.notEqual data.toLowerCase().indexOf('status: connect'), -1
done()
it 'should work with google.co.jp in english', (done) ->
whois.lookup 'google.co.jp', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('a. [domain name] google.co.jp'), -1
done()
it 'should work with registry.pro', (done) ->
whois.lookup 'registry.pro', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain id: d107300000000006392-lrms'), -1
done()
it 'should fail with google.com due to timeout', (done) ->
whois.lookup 'google.com', {timeout: 1}, (err, data) ->
assert err
assert.equal 'lookup: timeout', err.message
done()
it 'should succeed with google.com with timeout', (done) ->
whois.lookup 'google.com', {timeout: 10000}, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with åre.no', (done) ->
whois.lookup 'åre.no', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('åre.no'), -1
done()
it 'should work with nic.digital', (done) ->
whois.lookup 'nic.digital', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('nic.digital'), -1
done()
it 'should work with whois.nic.ai', (done) ->
whois.lookup 'whois.nic.ai', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('whois.nic.ai'), -1
done()
it 'should work with currentzoology.org', (done) ->
whois.lookup 'currentzoology.org', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('currentzoology.org'), -1
done()
it 'should work with 148.241.109.161', (done) ->
whois.lookup '148.241.109.161', {encoding: 'binary'}, (err, data) ->
assert.ifError err
assert.notEqual data.indexOf('Instituto Tecnológico'), -1
done() | 1209 | _ = require 'underscore'
assert = require 'assert'
whois = require './index'
describe '#lookup()', ->
it 'should work with google.com', (done) ->
whois.lookup 'google.com', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with 192.168.127.12', (done) ->
whois.lookup '192.168.127.12', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('netname: linode-us'), -1
done()
it 'should work with 2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d', (done) ->
whois.lookup '2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('inet6num: 2001:db8::/32'), -1
done()
it 'should honor specified WHOIS server', (done) ->
whois.lookup 'gandi.net', server: 'whois.gandi.net', (err, data) ->
assert.ifError err
data = data.toLowerCase()
assert.notEqual data.indexOf('whois server: whois.gandi.net'), -1
assert.notEqual data.indexOf('domain name: gandi.net'), -1
done()
it 'should honor specified WHOIS server with port override', (done) ->
whois.lookup 'tucows.com', server: 'whois.tucows.com:43', (err, data) ->
assert.ifError err
data = data.toLowerCase()
assert.notEqual data.indexOf('whois server: whois.tucows.com'), -1
assert.notEqual data.indexOf('domain name: tucows.com'), -1
done()
it 'should follow specified number of redirects for domain', (done) ->
whois.lookup 'google.com', follow: 1, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should follow specified number of redirects for IP address', (done) ->
whois.lookup '172.16.58.3', follow: 1, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('inetnum: 192.168.3.11 - 192.168.127.12'), -1
done()
it 'should work with verbose option', (done) ->
whois.lookup 'google.com', {verbose: true}, (err, data) ->
assert.ifError err
assert.equal data[0].server, 'whois.verisign-grs.com'
assert.notEqual data[0].data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with nic.sh', (done) ->
whois.lookup 'nic.sh', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d503300000040403495-lrms'), -1
done()
it 'should work with nic.io', (done) ->
whois.lookup 'nic.io', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d503300000040453277-lrms'), -1
done()
it 'should work with nic.ac', (done) ->
whois.lookup 'nic.ac', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d503300000040632620-lrms'), -1
done()
it 'should work with nic.tm', (done) ->
whois.lookup 'nic.tm', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('status : permanent/reserved'), -1
done()
it 'should work with nic.global', (done) ->
whois.lookup 'nic.global', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d2836144-agrs'), -1
done()
it 'should work with srs.net.nz', (done) ->
whois.lookup 'srs.net.nz', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain_name: srs.net.nz'), -1
done()
it 'should work with redundant follow', (done) ->
whois.lookup 'google.com', follow: 5, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with küche.de', (done) ->
whois.lookup 'küche.de', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain: küche.de'), -1
assert.notEqual data.toLowerCase().indexOf('status: connect'), -1
done()
it 'should work with google.co.jp in english', (done) ->
whois.lookup 'google.co.jp', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('a. [domain name] google.co.jp'), -1
done()
it 'should work with registry.pro', (done) ->
whois.lookup 'registry.pro', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain id: d107300000000006392-lrms'), -1
done()
it 'should fail with google.com due to timeout', (done) ->
whois.lookup 'google.com', {timeout: 1}, (err, data) ->
assert err
assert.equal 'lookup: timeout', err.message
done()
it 'should succeed with google.com with timeout', (done) ->
whois.lookup 'google.com', {timeout: 10000}, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with åre.no', (done) ->
whois.lookup 'åre.no', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('åre.no'), -1
done()
it 'should work with nic.digital', (done) ->
whois.lookup 'nic.digital', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('nic.digital'), -1
done()
it 'should work with whois.nic.ai', (done) ->
whois.lookup 'whois.nic.ai', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('whois.nic.ai'), -1
done()
it 'should work with currentzoology.org', (done) ->
whois.lookup 'currentzoology.org', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('currentzoology.org'), -1
done()
it 'should work with 172.16.31.10', (done) ->
whois.lookup '192.168.3.111', {encoding: 'binary'}, (err, data) ->
assert.ifError err
assert.notEqual data.indexOf('Instituto Tecnológico'), -1
done() | true | _ = require 'underscore'
assert = require 'assert'
whois = require './index'
describe '#lookup()', ->
it 'should work with google.com', (done) ->
whois.lookup 'google.com', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with PI:IP_ADDRESS:192.168.127.12END_PI', (done) ->
whois.lookup 'PI:IP_ADDRESS:192.168.127.12END_PI', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('netname: linode-us'), -1
done()
it 'should work with 2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d', (done) ->
whois.lookup '2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('inet6num: 2001:db8::/32'), -1
done()
it 'should honor specified WHOIS server', (done) ->
whois.lookup 'gandi.net', server: 'whois.gandi.net', (err, data) ->
assert.ifError err
data = data.toLowerCase()
assert.notEqual data.indexOf('whois server: whois.gandi.net'), -1
assert.notEqual data.indexOf('domain name: gandi.net'), -1
done()
it 'should honor specified WHOIS server with port override', (done) ->
whois.lookup 'tucows.com', server: 'whois.tucows.com:43', (err, data) ->
assert.ifError err
data = data.toLowerCase()
assert.notEqual data.indexOf('whois server: whois.tucows.com'), -1
assert.notEqual data.indexOf('domain name: tucows.com'), -1
done()
it 'should follow specified number of redirects for domain', (done) ->
whois.lookup 'google.com', follow: 1, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should follow specified number of redirects for IP address', (done) ->
whois.lookup 'PI:IP_ADDRESS:172.16.58.3END_PI', follow: 1, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('inetnum: PI:IP_ADDRESS:192.168.3.11END_PI - PI:IP_ADDRESS:192.168.127.12END_PI'), -1
done()
it 'should work with verbose option', (done) ->
whois.lookup 'google.com', {verbose: true}, (err, data) ->
assert.ifError err
assert.equal data[0].server, 'whois.verisign-grs.com'
assert.notEqual data[0].data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with nic.sh', (done) ->
whois.lookup 'nic.sh', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d503300000040403495-lrms'), -1
done()
it 'should work with nic.io', (done) ->
whois.lookup 'nic.io', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d503300000040453277-lrms'), -1
done()
it 'should work with nic.ac', (done) ->
whois.lookup 'nic.ac', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d503300000040632620-lrms'), -1
done()
it 'should work with nic.tm', (done) ->
whois.lookup 'nic.tm', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('status : permanent/reserved'), -1
done()
it 'should work with nic.global', (done) ->
whois.lookup 'nic.global', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('registry domain id: d2836144-agrs'), -1
done()
it 'should work with srs.net.nz', (done) ->
whois.lookup 'srs.net.nz', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain_name: srs.net.nz'), -1
done()
it 'should work with redundant follow', (done) ->
whois.lookup 'google.com', follow: 5, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with küche.de', (done) ->
whois.lookup 'küche.de', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain: küche.de'), -1
assert.notEqual data.toLowerCase().indexOf('status: connect'), -1
done()
it 'should work with google.co.jp in english', (done) ->
whois.lookup 'google.co.jp', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('a. [domain name] google.co.jp'), -1
done()
it 'should work with registry.pro', (done) ->
whois.lookup 'registry.pro', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain id: d107300000000006392-lrms'), -1
done()
it 'should fail with google.com due to timeout', (done) ->
whois.lookup 'google.com', {timeout: 1}, (err, data) ->
assert err
assert.equal 'lookup: timeout', err.message
done()
it 'should succeed with google.com with timeout', (done) ->
whois.lookup 'google.com', {timeout: 10000}, (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('domain name: google.com'), -1
done()
it 'should work with åre.no', (done) ->
whois.lookup 'åre.no', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('åre.no'), -1
done()
it 'should work with nic.digital', (done) ->
whois.lookup 'nic.digital', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('nic.digital'), -1
done()
it 'should work with whois.nic.ai', (done) ->
whois.lookup 'whois.nic.ai', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('whois.nic.ai'), -1
done()
it 'should work with currentzoology.org', (done) ->
whois.lookup 'currentzoology.org', (err, data) ->
assert.ifError err
assert.notEqual data.toLowerCase().indexOf('currentzoology.org'), -1
done()
it 'should work with PI:IP_ADDRESS:172.16.31.10END_PI', (done) ->
whois.lookup 'PI:IP_ADDRESS:192.168.3.11END_PI1', {encoding: 'binary'}, (err, data) ->
assert.ifError err
assert.notEqual data.indexOf('Instituto Tecnológico'), -1
done() |
[
{
"context": "# Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public Li",
"end": 43,
"score": 0.9999096989631653,
"start": 29,
"tag": "EMAIL",
"value": "contact@ppy.sh"
}
] | resources/assets/coffee/react/profile-page/medals.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 { AchievementBadge } from './achievement-badge'
import { ExtraHeader } from './extra-header'
import * as React from 'react'
import { div, h2, h3 } from 'react-dom-factories'
el = React.createElement
export class Medals extends React.PureComponent
render: =>
@userAchievements = null
all =
for own grouping, groupedAchievements of @groupedAchievements()
div
key: grouping
className: 'medals-group__group'
h3 className: 'medals-group__title', grouping
for own ordering, achievements of @orderedAchievements(groupedAchievements)
div
key: ordering
className: 'medals-group__medals'
achievements.map @medal
recentAchievements = @recentAchievements()
div
className: 'page-extra'
el ExtraHeader, name: @props.name, withEdit: @props.withEdit
if recentAchievements.length > 0
div className: 'page-extra__recent-medals-box',
div className: 'title title--page-extra-small',
osu.trans('users.show.extra.medals.recent')
div className: 'page-extra__recent-medals',
for achievement in recentAchievements
div
className: 'page-extra__recent-medal'
key: achievement.achievement_id
el AchievementBadge,
achievement: @props.achievements[achievement.achievement_id]
userAchievement: achievement
modifiers: ['dynamic-height']
div className: 'medals-group',
all
if all.length == 0
osu.trans('users.show.extra.medals.empty')
currentModeFilter: (achievement) =>
!achievement.mode? || achievement.mode == @props.currentMode
groupedAchievements: =>
isCurrentUser = currentUser.id == @props.user.id
_.chain(@props.achievements)
.values()
.filter @currentModeFilter
.filter (a) =>
isAchieved = @userAchievement a.id
isAchieved || isCurrentUser
.groupBy (a) =>
a.grouping
.value()
medal: (achievement) =>
div
key: achievement.id
className: 'medals-group__medal'
el AchievementBadge,
modifiers: ['listing']
achievement: achievement
userAchievement: @userAchievement achievement.id
orderedAchievements: (achievements) =>
_.groupBy achievements, (achievement) =>
achievement.ordering
recentAchievements: =>
ret = []
for ua in @props.userAchievements
achievement = @props.achievements[ua.achievement_id]
ret.push(ua) if @currentModeFilter(achievement)
break if ret.length >= 8
ret
userAchievement: (id) =>
@userAchievements ?= _.keyBy @props.userAchievements, 'achievement_id'
@userAchievements[id]
| 153784 | # 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 { AchievementBadge } from './achievement-badge'
import { ExtraHeader } from './extra-header'
import * as React from 'react'
import { div, h2, h3 } from 'react-dom-factories'
el = React.createElement
export class Medals extends React.PureComponent
render: =>
@userAchievements = null
all =
for own grouping, groupedAchievements of @groupedAchievements()
div
key: grouping
className: 'medals-group__group'
h3 className: 'medals-group__title', grouping
for own ordering, achievements of @orderedAchievements(groupedAchievements)
div
key: ordering
className: 'medals-group__medals'
achievements.map @medal
recentAchievements = @recentAchievements()
div
className: 'page-extra'
el ExtraHeader, name: @props.name, withEdit: @props.withEdit
if recentAchievements.length > 0
div className: 'page-extra__recent-medals-box',
div className: 'title title--page-extra-small',
osu.trans('users.show.extra.medals.recent')
div className: 'page-extra__recent-medals',
for achievement in recentAchievements
div
className: 'page-extra__recent-medal'
key: achievement.achievement_id
el AchievementBadge,
achievement: @props.achievements[achievement.achievement_id]
userAchievement: achievement
modifiers: ['dynamic-height']
div className: 'medals-group',
all
if all.length == 0
osu.trans('users.show.extra.medals.empty')
currentModeFilter: (achievement) =>
!achievement.mode? || achievement.mode == @props.currentMode
groupedAchievements: =>
isCurrentUser = currentUser.id == @props.user.id
_.chain(@props.achievements)
.values()
.filter @currentModeFilter
.filter (a) =>
isAchieved = @userAchievement a.id
isAchieved || isCurrentUser
.groupBy (a) =>
a.grouping
.value()
medal: (achievement) =>
div
key: achievement.id
className: 'medals-group__medal'
el AchievementBadge,
modifiers: ['listing']
achievement: achievement
userAchievement: @userAchievement achievement.id
orderedAchievements: (achievements) =>
_.groupBy achievements, (achievement) =>
achievement.ordering
recentAchievements: =>
ret = []
for ua in @props.userAchievements
achievement = @props.achievements[ua.achievement_id]
ret.push(ua) if @currentModeFilter(achievement)
break if ret.length >= 8
ret
userAchievement: (id) =>
@userAchievements ?= _.keyBy @props.userAchievements, 'achievement_id'
@userAchievements[id]
| 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 { AchievementBadge } from './achievement-badge'
import { ExtraHeader } from './extra-header'
import * as React from 'react'
import { div, h2, h3 } from 'react-dom-factories'
el = React.createElement
export class Medals extends React.PureComponent
render: =>
@userAchievements = null
all =
for own grouping, groupedAchievements of @groupedAchievements()
div
key: grouping
className: 'medals-group__group'
h3 className: 'medals-group__title', grouping
for own ordering, achievements of @orderedAchievements(groupedAchievements)
div
key: ordering
className: 'medals-group__medals'
achievements.map @medal
recentAchievements = @recentAchievements()
div
className: 'page-extra'
el ExtraHeader, name: @props.name, withEdit: @props.withEdit
if recentAchievements.length > 0
div className: 'page-extra__recent-medals-box',
div className: 'title title--page-extra-small',
osu.trans('users.show.extra.medals.recent')
div className: 'page-extra__recent-medals',
for achievement in recentAchievements
div
className: 'page-extra__recent-medal'
key: achievement.achievement_id
el AchievementBadge,
achievement: @props.achievements[achievement.achievement_id]
userAchievement: achievement
modifiers: ['dynamic-height']
div className: 'medals-group',
all
if all.length == 0
osu.trans('users.show.extra.medals.empty')
currentModeFilter: (achievement) =>
!achievement.mode? || achievement.mode == @props.currentMode
groupedAchievements: =>
isCurrentUser = currentUser.id == @props.user.id
_.chain(@props.achievements)
.values()
.filter @currentModeFilter
.filter (a) =>
isAchieved = @userAchievement a.id
isAchieved || isCurrentUser
.groupBy (a) =>
a.grouping
.value()
medal: (achievement) =>
div
key: achievement.id
className: 'medals-group__medal'
el AchievementBadge,
modifiers: ['listing']
achievement: achievement
userAchievement: @userAchievement achievement.id
orderedAchievements: (achievements) =>
_.groupBy achievements, (achievement) =>
achievement.ordering
recentAchievements: =>
ret = []
for ua in @props.userAchievements
achievement = @props.achievements[ua.achievement_id]
ret.push(ua) if @currentModeFilter(achievement)
break if ret.length >= 8
ret
userAchievement: (id) =>
@userAchievements ?= _.keyBy @props.userAchievements, 'achievement_id'
@userAchievements[id]
|
[
{
"context": "\n date = new Date\n FakeModel.create({name: 'hello', email: 'hello@xx.xx', date: date, isGood: true}",
"end": 1322,
"score": 0.763842761516571,
"start": 1317,
"tag": "NAME",
"value": "hello"
},
{
"context": "Date\n FakeModel.create({name: 'hello', email: 'hello@xx.xx', date: date, isGood: true})\n .then (model) ->",
"end": 1344,
"score": 0.9977754354476929,
"start": 1333,
"tag": "EMAIL",
"value": "hello@xx.xx"
},
{
"context": " .then (model) ->\n model.name.should.equal 'hello'\n model.email.should.equal 'hello@xx.xx'\n ",
"end": 1431,
"score": 0.991926908493042,
"start": 1426,
"tag": "NAME",
"value": "hello"
},
{
"context": "uld.equal 'hello'\n model.email.should.equal 'hello@xx.xx'\n model.date.getTime().should.equal date.get",
"end": 1476,
"score": 0.9970836639404297,
"start": 1465,
"tag": "EMAIL",
"value": "hello@xx.xx"
},
{
"context": "model.save().then ->\n FakeModel.find({name: 'nimei'})\n .then (resModel) ->\n resModel.id.",
"end": 1742,
"score": 0.6560400128364563,
"start": 1741,
"tag": "NAME",
"value": "n"
},
{
"context": "l.save().then ->\n FakeModel.find({name: 'nimei'})\n .then (resModel) ->\n resModel.id.shou",
"end": 1746,
"score": 0.616992712020874,
"start": 1745,
"tag": "NAME",
"value": "i"
},
{
"context": "l.id\n .then ->\n FakeModel.findAll({name: 'nimei'})\n .then (resModels) ->\n resModels.lengt",
"end": 1864,
"score": 0.9933794140815735,
"start": 1859,
"tag": "NAME",
"value": "nimei"
},
{
"context": "odel.id\n .then ->\n FakeModel.each {name: 'nimei'}, (err, res) ->\n return done(err) if err\n",
"end": 2022,
"score": 0.9958460927009583,
"start": 2017,
"tag": "NAME",
"value": "nimei"
},
{
"context": "te to emit', ->\n child = new ChildModel name: 'child'\n nameSpy = sinon.spy (change) ->\n change",
"end": 3429,
"score": 0.5949461460113525,
"start": 3424,
"tag": "NAME",
"value": "child"
},
{
"context": "t', (done) ->\n parent = new ParentModel name: 'parent'\n child = new ChildModel name: 'child'\n par",
"end": 3701,
"score": 0.7646986842155457,
"start": 3695,
"tag": "NAME",
"value": "parent"
},
{
"context": " name: 'parent'\n child = new ChildModel name: 'child'\n parentModelSpy = sinon.spy()\n childModelS",
"end": 3742,
"score": 0.6269016265869141,
"start": 3737,
"tag": "NAME",
"value": "child"
},
{
"context": "Many', (done) ->\n child = new SomeModel name: 'child'\n parent = new ParentModel name: 'parent'\n ",
"end": 6156,
"score": 0.5447134971618652,
"start": 6151,
"tag": "NAME",
"value": "child"
},
{
"context": "load', (done) ->\n child = new SomeModel name: 'child'\n parent = new ParentModel name: 'parent'\n ",
"end": 6710,
"score": 0.7582765817642212,
"start": 6705,
"tag": "NAME",
"value": "child"
}
] | spec/model-base-spec.coffee | xmail-client/node-sqlite-orm | 0 | ModelBaseMixin = require '../lib/model-base'
Mapper = require '../lib/mapper'
Migration = require '../lib/migration'
path = require 'path'
Q = require 'q'
sinon = require 'sinon'
class MapperRunner
start: (done) ->
@mapper = new Mapper path.resolve(__dirname, 'temp/test.db')
@mapper.sync().then -> done()
.catch (err) -> done(err)
stop: (done) ->
@mapper.dropAllTables().then =>
Migration.clear()
@mapper.close()
done()
.catch(done)
describe 'ModelBaseMixin', ->
[runner, FakeModel] = []
beforeEach (done) ->
class FakeModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel(params)
Migration.createTable 'FakeModel', (t) ->
t.addColumn 'name', 'INTEGER'
t.addColumn 'email', 'TEXT'
t.addColumn 'date', 'DATETIME'
t.addColumn 'isGood', 'BOOL'
FakeModel.models.FakeModel.should.equal FakeModel
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'get FakeModel attributes', (done) ->
FakeModel.prototype.hasOwnProperty('name').should.ok
FakeModel.prototype.hasOwnProperty('id').should.ok
FakeModel.tableName.should.equal 'FakeModel'
FakeModel.primaryKeyName.should.equal 'id'
date = new Date
FakeModel.create({name: 'hello', email: 'hello@xx.xx', date: date, isGood: true})
.then (model) ->
model.name.should.equal 'hello'
model.email.should.equal 'hello@xx.xx'
model.date.getTime().should.equal date.getTime()
model.isGood.should.equal true
done()
.catch done
it 'save attributes', (done) ->
model = new FakeModel()
model.name = 'nimei'
model.save().then ->
FakeModel.find({name: 'nimei'})
.then (resModel) ->
resModel.id.should.equal model.id
.then ->
FakeModel.findAll({name: 'nimei'})
.then (resModels) ->
resModels.length.should.equal 1
resModels[0].id.should.equal model.id
.then ->
FakeModel.each {name: 'nimei'}, (err, res) ->
return done(err) if err
res.id.should.equal model.id
.then -> done()
.catch done
it 'transaction', (done) ->
runner.mapper.beginTransaction()
.then -> runner.mapper.endTransaction()
.then -> done()
describe 'ModelBaseMixin basic association', ->
[ParentModel, ChildModel, SomeModel, runner] = []
beforeEach (done) ->
Migration.createTable 'ParentModel', (t) ->
t.addColumn 'name', 'TEXT'
Migration.createTable 'ChildModel', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentModelId', 'ParentModel'
Migration.createTable 'SomeModel', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentModelId', 'ParentModel'
class ChildModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: ->
@belongsTo ParentModel
class SomeModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: ->
@belongsTo ParentModel
class ParentModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: ->
@hasOne ChildModel
@hasMany SomeModel
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'change the attribute to emit', ->
child = new ChildModel name: 'child'
nameSpy = sinon.spy (change) ->
change.oldValue.should.equal 'child'
child.on 'name', nameSpy
child.name = 'hello'
nameSpy.called.should.true
it 'change extendTo and hasOne attribute to emit', (done) ->
parent = new ParentModel name: 'parent'
child = new ChildModel name: 'child'
parentModelSpy = sinon.spy()
childModelSpy = sinon.spy()
child.on 'parentModel', parentModelSpy
parent.on 'childModel', childModelSpy
Q.all [child.save(), parent.save()]
.then ->
child.parentModel = parent
parentModelSpy.calledOnce.should.true
childModelSpy.calledOnce.should.true
parent.childModel = null
parentModelSpy.callCount.should.equal 2
childModelSpy.callCount.should.equal 2
done()
.catch done
it 'change extendTo and hasMany attribute to emit', (done) ->
parent = new ParentModel name: 'parent'
some = new SomeModel name: 'some'
parentModelSpy = sinon.spy()
someModelsSpy = sinon.spy()
some.on 'parentModel', parentModelSpy
parent.on 'someModels', someModelsSpy
Q.all [some.save(), parent.save()]
.then ->
some.parentModel = parent
parentModelSpy.calledOnce.should.true
someModelsSpy.calledOnce.should.true
parent.someModels.splice(0, 1)
someModelsSpy.callCount.should.equal 2
done()
.catch done
it 'belongsTo', (done) ->
child = new ChildModel name: 'child'
parent = new ParentModel name: 'parent'
Q.all [child.save(), parent.save()]
.then ->
child.parentModel = parent
child.parentModel.should.equal parent
child.parentModelId.should.equal parent.id
parent.childModel.should.equal child
.then ->
child.save()
.then -> done()
.catch done
it 'hasOne', (done) ->
child = new ChildModel name: 'child'
parent = new ParentModel name: 'parent'
Q.all [child.save(), parent.save()]
.then ->
parent.childModel = child
parent.childModel.should.equal child
child.parentModel.should.equal parent
child.parentModelId.should.equal parent.id
.then ->
parent.childModel = null
child.save()
.then -> done()
.catch done
it 'belongsTo N-1', (done) ->
child = new SomeModel name: 'child'
parent = new ParentModel name: 'parent'
Q.all [child.save(), parent.save()]
.then ->
child.parentModel = parent
child.parentModel.should.equal parent
child.parentModelId.should.equal parent.id
parent.someModels.get(0).should.equal child
child.parentModel = null
parent.someModels.length.should.equal 0
.then -> done()
.catch done
it 'hasMany', (done) ->
child = new SomeModel name: 'child'
parent = new ParentModel name: 'parent'
child.save().then ->
parent.save()
.then ->
parent.someModels.push child
Q.delay(0)
.then ->
child.parentModelId.should.equal parent.id
child.parentModel.should.equal parent
parent.someModels.pop()
Q.delay(0)
.then ->
(child.parentModelId is null).should.ok
.then ->
runner.mapper.cache.clear()
SomeModel.getById(1)
.then (model) ->
done()
.catch done
it 'load', (done) ->
child = new SomeModel name: 'child'
parent = new ParentModel name: 'parent'
Q.all([child.save(), parent.save()])
.then ->
parent.someModels.push child
Q.delay(0)
.then -> Q.all [child.save(), parent.save()]
.then ->
runner.mapper.cache.clear()
SomeModel.getById(1)
.then (child) ->
child.parentModel.should.ok
done()
.catch done
describe 'ModelBaseMixin association to self', ->
[Model, runner] = []
beforeEach (done) ->
Migration.createTable 'Model', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentId', 'Model'
class Model
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@belongsTo Model, {through: 'parentId', as: 'parent'}
@hasMany Model, {through: 'parentId', as: 'children'}
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'belongsTo and hasMany', (done) ->
models = for i in [0..2]
new Model name: "model#{i}"
Q.all (model.save() for model in models)
.then ->
models[0].children.splice(0, 0, models[1], models[2])
.then ->
models[0].children.length.should.equal 2
models[1].parent.should.equal models[0]
models[2].parent.should.equal models[0]
Q.all (model.save() for model in models)
.then ->
runner.mapper.cache.clear()
Model.getById(1)
.then (model0) ->
model0.children.length.should.equal 2
model0.children.get(0).parent.should.equal model0
model0.children.get(1).parent.should.equal model0
.then -> done()
.catch done
describe 'ModelBaseMixin in asymmetric association', ->
[Model, runner] = []
beforeEach (done) ->
Migration.createTable 'Model', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentId', 'Model'
t.addReference 'childId', 'Model'
class Model
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
# @belongsTo Model, {through: 'parentId', as: 'parent'}
@initAssos: ->
@hasMany Model, {as: 'children', through: 'parentId'}
@belongsTo Model, {as: 'parent', through: 'childId'}
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'work properly', (done) ->
models = for i in [0..2]
new Model name: "#{i}"
Q.all (model.save() for model in models)
.then ->
models[0].children.push models[1]
models[0].parent = models[2]
.then ->
models[1]["@1"].should.equal models[0]
models[2]["@0"].get(0).should.equal models[0]
Q.all (model.save() for model in models)
.then ->
runner.mapper.cache.clear()
Model.getById(1)
.then (model) ->
model.parent.name.should.equal '2'
model.parent['@0'].get(0).should.equal model
model1 = model.children.get(0)
model1.name.should.equal '1'
model1['@1'].should.equal model
model1.destroy().then -> model
.then (model) ->
model.children.length.should.equal 0
model.parent.destroy().then -> model
.then (model) ->
done()
.catch done
describe 'ModelBaseMixin in hasManyBelongsTo association', ->
[Source, Target, runner] = []
beforeEach (done) ->
Migration.createTable 'Source', (t) ->
t.addColumn 'name', 'TEXT'
Migration.createTable 'Target', (t) ->
t.addColumn 'name', 'TEXT'
Migration.createTable 'SourceTarget', (t) ->
t.addReference 'sourceId', 'Source'
t.addReference 'targetId', 'Target'
class Target
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
class Source
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: -> @hasManyBelongsTo Target
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'change attribute to emit', (done) ->
src = new Source name: 'Source'
target = new Target name: 'Target'
targetsSpy = sinon.spy()
src.on 'targets', targetsSpy
Q.all [src.save, target.save()]
.then ->
src.targets.push(target)
targetsSpy.calledOnce.should.true
done()
.catch done
it 'hasManyBelongsTo', (done) ->
src = new Source name: 'Source'
target = new Target name: 'Target'
Q.all [src.save(), target.save()]
.then ->
src.targets.push(target)
target['@0'].get(0).should.equal src
.then ->
src.targets.pop()
target['@0'].length.should.equal 0
.then ->
ModelBaseMixin.models['SourceTarget'].create {sourceId: 1, targetId: 1}
.then ->
runner.mapper.cache.clear()
Source.getById(1)
.then (src) ->
src.targets.length.should.equal 1
src.targets.get(0).destroy().then -> src
.then (src) ->
src.targets.length.should.equal 0
done()
.catch done
| 84574 | ModelBaseMixin = require '../lib/model-base'
Mapper = require '../lib/mapper'
Migration = require '../lib/migration'
path = require 'path'
Q = require 'q'
sinon = require 'sinon'
class MapperRunner
start: (done) ->
@mapper = new Mapper path.resolve(__dirname, 'temp/test.db')
@mapper.sync().then -> done()
.catch (err) -> done(err)
stop: (done) ->
@mapper.dropAllTables().then =>
Migration.clear()
@mapper.close()
done()
.catch(done)
describe 'ModelBaseMixin', ->
[runner, FakeModel] = []
beforeEach (done) ->
class FakeModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel(params)
Migration.createTable 'FakeModel', (t) ->
t.addColumn 'name', 'INTEGER'
t.addColumn 'email', 'TEXT'
t.addColumn 'date', 'DATETIME'
t.addColumn 'isGood', 'BOOL'
FakeModel.models.FakeModel.should.equal FakeModel
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'get FakeModel attributes', (done) ->
FakeModel.prototype.hasOwnProperty('name').should.ok
FakeModel.prototype.hasOwnProperty('id').should.ok
FakeModel.tableName.should.equal 'FakeModel'
FakeModel.primaryKeyName.should.equal 'id'
date = new Date
FakeModel.create({name: '<NAME>', email: '<EMAIL>', date: date, isGood: true})
.then (model) ->
model.name.should.equal '<NAME>'
model.email.should.equal '<EMAIL>'
model.date.getTime().should.equal date.getTime()
model.isGood.should.equal true
done()
.catch done
it 'save attributes', (done) ->
model = new FakeModel()
model.name = 'nimei'
model.save().then ->
FakeModel.find({name: '<NAME>ime<NAME>'})
.then (resModel) ->
resModel.id.should.equal model.id
.then ->
FakeModel.findAll({name: '<NAME>'})
.then (resModels) ->
resModels.length.should.equal 1
resModels[0].id.should.equal model.id
.then ->
FakeModel.each {name: '<NAME>'}, (err, res) ->
return done(err) if err
res.id.should.equal model.id
.then -> done()
.catch done
it 'transaction', (done) ->
runner.mapper.beginTransaction()
.then -> runner.mapper.endTransaction()
.then -> done()
describe 'ModelBaseMixin basic association', ->
[ParentModel, ChildModel, SomeModel, runner] = []
beforeEach (done) ->
Migration.createTable 'ParentModel', (t) ->
t.addColumn 'name', 'TEXT'
Migration.createTable 'ChildModel', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentModelId', 'ParentModel'
Migration.createTable 'SomeModel', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentModelId', 'ParentModel'
class ChildModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: ->
@belongsTo ParentModel
class SomeModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: ->
@belongsTo ParentModel
class ParentModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: ->
@hasOne ChildModel
@hasMany SomeModel
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'change the attribute to emit', ->
child = new ChildModel name: '<NAME>'
nameSpy = sinon.spy (change) ->
change.oldValue.should.equal 'child'
child.on 'name', nameSpy
child.name = 'hello'
nameSpy.called.should.true
it 'change extendTo and hasOne attribute to emit', (done) ->
parent = new ParentModel name: '<NAME>'
child = new ChildModel name: '<NAME>'
parentModelSpy = sinon.spy()
childModelSpy = sinon.spy()
child.on 'parentModel', parentModelSpy
parent.on 'childModel', childModelSpy
Q.all [child.save(), parent.save()]
.then ->
child.parentModel = parent
parentModelSpy.calledOnce.should.true
childModelSpy.calledOnce.should.true
parent.childModel = null
parentModelSpy.callCount.should.equal 2
childModelSpy.callCount.should.equal 2
done()
.catch done
it 'change extendTo and hasMany attribute to emit', (done) ->
parent = new ParentModel name: 'parent'
some = new SomeModel name: 'some'
parentModelSpy = sinon.spy()
someModelsSpy = sinon.spy()
some.on 'parentModel', parentModelSpy
parent.on 'someModels', someModelsSpy
Q.all [some.save(), parent.save()]
.then ->
some.parentModel = parent
parentModelSpy.calledOnce.should.true
someModelsSpy.calledOnce.should.true
parent.someModels.splice(0, 1)
someModelsSpy.callCount.should.equal 2
done()
.catch done
it 'belongsTo', (done) ->
child = new ChildModel name: 'child'
parent = new ParentModel name: 'parent'
Q.all [child.save(), parent.save()]
.then ->
child.parentModel = parent
child.parentModel.should.equal parent
child.parentModelId.should.equal parent.id
parent.childModel.should.equal child
.then ->
child.save()
.then -> done()
.catch done
it 'hasOne', (done) ->
child = new ChildModel name: 'child'
parent = new ParentModel name: 'parent'
Q.all [child.save(), parent.save()]
.then ->
parent.childModel = child
parent.childModel.should.equal child
child.parentModel.should.equal parent
child.parentModelId.should.equal parent.id
.then ->
parent.childModel = null
child.save()
.then -> done()
.catch done
it 'belongsTo N-1', (done) ->
child = new SomeModel name: 'child'
parent = new ParentModel name: 'parent'
Q.all [child.save(), parent.save()]
.then ->
child.parentModel = parent
child.parentModel.should.equal parent
child.parentModelId.should.equal parent.id
parent.someModels.get(0).should.equal child
child.parentModel = null
parent.someModels.length.should.equal 0
.then -> done()
.catch done
it 'hasMany', (done) ->
child = new SomeModel name: '<NAME>'
parent = new ParentModel name: 'parent'
child.save().then ->
parent.save()
.then ->
parent.someModels.push child
Q.delay(0)
.then ->
child.parentModelId.should.equal parent.id
child.parentModel.should.equal parent
parent.someModels.pop()
Q.delay(0)
.then ->
(child.parentModelId is null).should.ok
.then ->
runner.mapper.cache.clear()
SomeModel.getById(1)
.then (model) ->
done()
.catch done
it 'load', (done) ->
child = new SomeModel name: '<NAME>'
parent = new ParentModel name: 'parent'
Q.all([child.save(), parent.save()])
.then ->
parent.someModels.push child
Q.delay(0)
.then -> Q.all [child.save(), parent.save()]
.then ->
runner.mapper.cache.clear()
SomeModel.getById(1)
.then (child) ->
child.parentModel.should.ok
done()
.catch done
describe 'ModelBaseMixin association to self', ->
[Model, runner] = []
beforeEach (done) ->
Migration.createTable 'Model', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentId', 'Model'
class Model
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@belongsTo Model, {through: 'parentId', as: 'parent'}
@hasMany Model, {through: 'parentId', as: 'children'}
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'belongsTo and hasMany', (done) ->
models = for i in [0..2]
new Model name: "model#{i}"
Q.all (model.save() for model in models)
.then ->
models[0].children.splice(0, 0, models[1], models[2])
.then ->
models[0].children.length.should.equal 2
models[1].parent.should.equal models[0]
models[2].parent.should.equal models[0]
Q.all (model.save() for model in models)
.then ->
runner.mapper.cache.clear()
Model.getById(1)
.then (model0) ->
model0.children.length.should.equal 2
model0.children.get(0).parent.should.equal model0
model0.children.get(1).parent.should.equal model0
.then -> done()
.catch done
describe 'ModelBaseMixin in asymmetric association', ->
[Model, runner] = []
beforeEach (done) ->
Migration.createTable 'Model', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentId', 'Model'
t.addReference 'childId', 'Model'
class Model
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
# @belongsTo Model, {through: 'parentId', as: 'parent'}
@initAssos: ->
@hasMany Model, {as: 'children', through: 'parentId'}
@belongsTo Model, {as: 'parent', through: 'childId'}
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'work properly', (done) ->
models = for i in [0..2]
new Model name: "#{i}"
Q.all (model.save() for model in models)
.then ->
models[0].children.push models[1]
models[0].parent = models[2]
.then ->
models[1]["@1"].should.equal models[0]
models[2]["@0"].get(0).should.equal models[0]
Q.all (model.save() for model in models)
.then ->
runner.mapper.cache.clear()
Model.getById(1)
.then (model) ->
model.parent.name.should.equal '2'
model.parent['@0'].get(0).should.equal model
model1 = model.children.get(0)
model1.name.should.equal '1'
model1['@1'].should.equal model
model1.destroy().then -> model
.then (model) ->
model.children.length.should.equal 0
model.parent.destroy().then -> model
.then (model) ->
done()
.catch done
describe 'ModelBaseMixin in hasManyBelongsTo association', ->
[Source, Target, runner] = []
beforeEach (done) ->
Migration.createTable 'Source', (t) ->
t.addColumn 'name', 'TEXT'
Migration.createTable 'Target', (t) ->
t.addColumn 'name', 'TEXT'
Migration.createTable 'SourceTarget', (t) ->
t.addReference 'sourceId', 'Source'
t.addReference 'targetId', 'Target'
class Target
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
class Source
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: -> @hasManyBelongsTo Target
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'change attribute to emit', (done) ->
src = new Source name: 'Source'
target = new Target name: 'Target'
targetsSpy = sinon.spy()
src.on 'targets', targetsSpy
Q.all [src.save, target.save()]
.then ->
src.targets.push(target)
targetsSpy.calledOnce.should.true
done()
.catch done
it 'hasManyBelongsTo', (done) ->
src = new Source name: 'Source'
target = new Target name: 'Target'
Q.all [src.save(), target.save()]
.then ->
src.targets.push(target)
target['@0'].get(0).should.equal src
.then ->
src.targets.pop()
target['@0'].length.should.equal 0
.then ->
ModelBaseMixin.models['SourceTarget'].create {sourceId: 1, targetId: 1}
.then ->
runner.mapper.cache.clear()
Source.getById(1)
.then (src) ->
src.targets.length.should.equal 1
src.targets.get(0).destroy().then -> src
.then (src) ->
src.targets.length.should.equal 0
done()
.catch done
| true | ModelBaseMixin = require '../lib/model-base'
Mapper = require '../lib/mapper'
Migration = require '../lib/migration'
path = require 'path'
Q = require 'q'
sinon = require 'sinon'
class MapperRunner
start: (done) ->
@mapper = new Mapper path.resolve(__dirname, 'temp/test.db')
@mapper.sync().then -> done()
.catch (err) -> done(err)
stop: (done) ->
@mapper.dropAllTables().then =>
Migration.clear()
@mapper.close()
done()
.catch(done)
describe 'ModelBaseMixin', ->
[runner, FakeModel] = []
beforeEach (done) ->
class FakeModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel(params)
Migration.createTable 'FakeModel', (t) ->
t.addColumn 'name', 'INTEGER'
t.addColumn 'email', 'TEXT'
t.addColumn 'date', 'DATETIME'
t.addColumn 'isGood', 'BOOL'
FakeModel.models.FakeModel.should.equal FakeModel
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'get FakeModel attributes', (done) ->
FakeModel.prototype.hasOwnProperty('name').should.ok
FakeModel.prototype.hasOwnProperty('id').should.ok
FakeModel.tableName.should.equal 'FakeModel'
FakeModel.primaryKeyName.should.equal 'id'
date = new Date
FakeModel.create({name: 'PI:NAME:<NAME>END_PI', email: 'PI:EMAIL:<EMAIL>END_PI', date: date, isGood: true})
.then (model) ->
model.name.should.equal 'PI:NAME:<NAME>END_PI'
model.email.should.equal 'PI:EMAIL:<EMAIL>END_PI'
model.date.getTime().should.equal date.getTime()
model.isGood.should.equal true
done()
.catch done
it 'save attributes', (done) ->
model = new FakeModel()
model.name = 'nimei'
model.save().then ->
FakeModel.find({name: 'PI:NAME:<NAME>END_PIimePI:NAME:<NAME>END_PI'})
.then (resModel) ->
resModel.id.should.equal model.id
.then ->
FakeModel.findAll({name: 'PI:NAME:<NAME>END_PI'})
.then (resModels) ->
resModels.length.should.equal 1
resModels[0].id.should.equal model.id
.then ->
FakeModel.each {name: 'PI:NAME:<NAME>END_PI'}, (err, res) ->
return done(err) if err
res.id.should.equal model.id
.then -> done()
.catch done
it 'transaction', (done) ->
runner.mapper.beginTransaction()
.then -> runner.mapper.endTransaction()
.then -> done()
describe 'ModelBaseMixin basic association', ->
[ParentModel, ChildModel, SomeModel, runner] = []
beforeEach (done) ->
Migration.createTable 'ParentModel', (t) ->
t.addColumn 'name', 'TEXT'
Migration.createTable 'ChildModel', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentModelId', 'ParentModel'
Migration.createTable 'SomeModel', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentModelId', 'ParentModel'
class ChildModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: ->
@belongsTo ParentModel
class SomeModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: ->
@belongsTo ParentModel
class ParentModel
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: ->
@hasOne ChildModel
@hasMany SomeModel
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'change the attribute to emit', ->
child = new ChildModel name: 'PI:NAME:<NAME>END_PI'
nameSpy = sinon.spy (change) ->
change.oldValue.should.equal 'child'
child.on 'name', nameSpy
child.name = 'hello'
nameSpy.called.should.true
it 'change extendTo and hasOne attribute to emit', (done) ->
parent = new ParentModel name: 'PI:NAME:<NAME>END_PI'
child = new ChildModel name: 'PI:NAME:<NAME>END_PI'
parentModelSpy = sinon.spy()
childModelSpy = sinon.spy()
child.on 'parentModel', parentModelSpy
parent.on 'childModel', childModelSpy
Q.all [child.save(), parent.save()]
.then ->
child.parentModel = parent
parentModelSpy.calledOnce.should.true
childModelSpy.calledOnce.should.true
parent.childModel = null
parentModelSpy.callCount.should.equal 2
childModelSpy.callCount.should.equal 2
done()
.catch done
it 'change extendTo and hasMany attribute to emit', (done) ->
parent = new ParentModel name: 'parent'
some = new SomeModel name: 'some'
parentModelSpy = sinon.spy()
someModelsSpy = sinon.spy()
some.on 'parentModel', parentModelSpy
parent.on 'someModels', someModelsSpy
Q.all [some.save(), parent.save()]
.then ->
some.parentModel = parent
parentModelSpy.calledOnce.should.true
someModelsSpy.calledOnce.should.true
parent.someModels.splice(0, 1)
someModelsSpy.callCount.should.equal 2
done()
.catch done
it 'belongsTo', (done) ->
child = new ChildModel name: 'child'
parent = new ParentModel name: 'parent'
Q.all [child.save(), parent.save()]
.then ->
child.parentModel = parent
child.parentModel.should.equal parent
child.parentModelId.should.equal parent.id
parent.childModel.should.equal child
.then ->
child.save()
.then -> done()
.catch done
it 'hasOne', (done) ->
child = new ChildModel name: 'child'
parent = new ParentModel name: 'parent'
Q.all [child.save(), parent.save()]
.then ->
parent.childModel = child
parent.childModel.should.equal child
child.parentModel.should.equal parent
child.parentModelId.should.equal parent.id
.then ->
parent.childModel = null
child.save()
.then -> done()
.catch done
it 'belongsTo N-1', (done) ->
child = new SomeModel name: 'child'
parent = new ParentModel name: 'parent'
Q.all [child.save(), parent.save()]
.then ->
child.parentModel = parent
child.parentModel.should.equal parent
child.parentModelId.should.equal parent.id
parent.someModels.get(0).should.equal child
child.parentModel = null
parent.someModels.length.should.equal 0
.then -> done()
.catch done
it 'hasMany', (done) ->
child = new SomeModel name: 'PI:NAME:<NAME>END_PI'
parent = new ParentModel name: 'parent'
child.save().then ->
parent.save()
.then ->
parent.someModels.push child
Q.delay(0)
.then ->
child.parentModelId.should.equal parent.id
child.parentModel.should.equal parent
parent.someModels.pop()
Q.delay(0)
.then ->
(child.parentModelId is null).should.ok
.then ->
runner.mapper.cache.clear()
SomeModel.getById(1)
.then (model) ->
done()
.catch done
it 'load', (done) ->
child = new SomeModel name: 'PI:NAME:<NAME>END_PI'
parent = new ParentModel name: 'parent'
Q.all([child.save(), parent.save()])
.then ->
parent.someModels.push child
Q.delay(0)
.then -> Q.all [child.save(), parent.save()]
.then ->
runner.mapper.cache.clear()
SomeModel.getById(1)
.then (child) ->
child.parentModel.should.ok
done()
.catch done
describe 'ModelBaseMixin association to self', ->
[Model, runner] = []
beforeEach (done) ->
Migration.createTable 'Model', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentId', 'Model'
class Model
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@belongsTo Model, {through: 'parentId', as: 'parent'}
@hasMany Model, {through: 'parentId', as: 'children'}
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'belongsTo and hasMany', (done) ->
models = for i in [0..2]
new Model name: "model#{i}"
Q.all (model.save() for model in models)
.then ->
models[0].children.splice(0, 0, models[1], models[2])
.then ->
models[0].children.length.should.equal 2
models[1].parent.should.equal models[0]
models[2].parent.should.equal models[0]
Q.all (model.save() for model in models)
.then ->
runner.mapper.cache.clear()
Model.getById(1)
.then (model0) ->
model0.children.length.should.equal 2
model0.children.get(0).parent.should.equal model0
model0.children.get(1).parent.should.equal model0
.then -> done()
.catch done
describe 'ModelBaseMixin in asymmetric association', ->
[Model, runner] = []
beforeEach (done) ->
Migration.createTable 'Model', (t) ->
t.addColumn 'name', 'TEXT'
t.addReference 'parentId', 'Model'
t.addReference 'childId', 'Model'
class Model
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
# @belongsTo Model, {through: 'parentId', as: 'parent'}
@initAssos: ->
@hasMany Model, {as: 'children', through: 'parentId'}
@belongsTo Model, {as: 'parent', through: 'childId'}
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'work properly', (done) ->
models = for i in [0..2]
new Model name: "#{i}"
Q.all (model.save() for model in models)
.then ->
models[0].children.push models[1]
models[0].parent = models[2]
.then ->
models[1]["@1"].should.equal models[0]
models[2]["@0"].get(0).should.equal models[0]
Q.all (model.save() for model in models)
.then ->
runner.mapper.cache.clear()
Model.getById(1)
.then (model) ->
model.parent.name.should.equal '2'
model.parent['@0'].get(0).should.equal model
model1 = model.children.get(0)
model1.name.should.equal '1'
model1['@1'].should.equal model
model1.destroy().then -> model
.then (model) ->
model.children.length.should.equal 0
model.parent.destroy().then -> model
.then (model) ->
done()
.catch done
describe 'ModelBaseMixin in hasManyBelongsTo association', ->
[Source, Target, runner] = []
beforeEach (done) ->
Migration.createTable 'Source', (t) ->
t.addColumn 'name', 'TEXT'
Migration.createTable 'Target', (t) ->
t.addColumn 'name', 'TEXT'
Migration.createTable 'SourceTarget', (t) ->
t.addReference 'sourceId', 'Source'
t.addReference 'targetId', 'Target'
class Target
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
class Source
ModelBaseMixin.includeInto this
constructor: (params) -> @initModel params
@initAssos: -> @hasManyBelongsTo Target
runner = new MapperRunner
runner.start(done)
afterEach (done) -> runner.stop(done)
it 'change attribute to emit', (done) ->
src = new Source name: 'Source'
target = new Target name: 'Target'
targetsSpy = sinon.spy()
src.on 'targets', targetsSpy
Q.all [src.save, target.save()]
.then ->
src.targets.push(target)
targetsSpy.calledOnce.should.true
done()
.catch done
it 'hasManyBelongsTo', (done) ->
src = new Source name: 'Source'
target = new Target name: 'Target'
Q.all [src.save(), target.save()]
.then ->
src.targets.push(target)
target['@0'].get(0).should.equal src
.then ->
src.targets.pop()
target['@0'].length.should.equal 0
.then ->
ModelBaseMixin.models['SourceTarget'].create {sourceId: 1, targetId: 1}
.then ->
runner.mapper.cache.clear()
Source.getById(1)
.then (src) ->
src.targets.length.should.equal 1
src.targets.get(0).destroy().then -> src
.then (src) ->
src.targets.length.should.equal 0
done()
.catch done
|
[
{
"context": "###\n * RegistryFormatter\n * http://github.com/ingorichter/BracketsExtensionTweetBot\n *\n * Copyright (c) 201",
"end": 57,
"score": 0.9996060729026794,
"start": 46,
"tag": "USERNAME",
"value": "ingorichter"
},
{
"context": "BracketsExtensionTweetBot\n *\n * Copyright (c) 2014 Ingo Richter\n * Licensed under the MIT license.\n###\n# jslint v",
"end": 121,
"score": 0.9998894929885864,
"start": 109,
"tag": "NAME",
"value": "Ingo Richter"
}
] | src/RegistryFormatter.coffee | ingorichter/BracketsExtensionTweetBot | 0 | ###
* RegistryFormatter
* http://github.com/ingorichter/BracketsExtensionTweetBot
*
* Copyright (c) 2014 Ingo Richter
* Licensed under the MIT license.
###
# jslint vars: true, plusplus: true, devel: true, node: true, nomen: true, indent: 4, maxerr: 50
'use strict'
Formatter = require './Formatter'
registryUtils = source 'RegistryUtils'
module.exports =
class RegistryFormatter extends Formatter
formatExtensionEntry: (extensionEntry) ->
extensionMetadata = extensionEntry.metadata
downloadURL = registryUtils.extensionDownloadURL extensionEntry
"|[#{extensionMetadata.title ?= extensionMetadata.name}](#{extensionMetadata.homepage})|#{extensionMetadata.version}|#{extensionMetadata.description}|#{this.formatUrl(downloadURL)}|"
transform: (changeSet) ->
newExtensions = (@formatExtensionEntry extension for extension in changeSet["NEW"])
updatedExtensions = (@formatExtensionEntry extension for extension in changeSet["UPDATE"])
@formatResult newExtensions, updatedExtensions
| 14510 | ###
* RegistryFormatter
* http://github.com/ingorichter/BracketsExtensionTweetBot
*
* Copyright (c) 2014 <NAME>
* Licensed under the MIT license.
###
# jslint vars: true, plusplus: true, devel: true, node: true, nomen: true, indent: 4, maxerr: 50
'use strict'
Formatter = require './Formatter'
registryUtils = source 'RegistryUtils'
module.exports =
class RegistryFormatter extends Formatter
formatExtensionEntry: (extensionEntry) ->
extensionMetadata = extensionEntry.metadata
downloadURL = registryUtils.extensionDownloadURL extensionEntry
"|[#{extensionMetadata.title ?= extensionMetadata.name}](#{extensionMetadata.homepage})|#{extensionMetadata.version}|#{extensionMetadata.description}|#{this.formatUrl(downloadURL)}|"
transform: (changeSet) ->
newExtensions = (@formatExtensionEntry extension for extension in changeSet["NEW"])
updatedExtensions = (@formatExtensionEntry extension for extension in changeSet["UPDATE"])
@formatResult newExtensions, updatedExtensions
| true | ###
* RegistryFormatter
* http://github.com/ingorichter/BracketsExtensionTweetBot
*
* Copyright (c) 2014 PI:NAME:<NAME>END_PI
* Licensed under the MIT license.
###
# jslint vars: true, plusplus: true, devel: true, node: true, nomen: true, indent: 4, maxerr: 50
'use strict'
Formatter = require './Formatter'
registryUtils = source 'RegistryUtils'
module.exports =
class RegistryFormatter extends Formatter
formatExtensionEntry: (extensionEntry) ->
extensionMetadata = extensionEntry.metadata
downloadURL = registryUtils.extensionDownloadURL extensionEntry
"|[#{extensionMetadata.title ?= extensionMetadata.name}](#{extensionMetadata.homepage})|#{extensionMetadata.version}|#{extensionMetadata.description}|#{this.formatUrl(downloadURL)}|"
transform: (changeSet) ->
newExtensions = (@formatExtensionEntry extension for extension in changeSet["NEW"])
updatedExtensions = (@formatExtensionEntry extension for extension in changeSet["UPDATE"])
@formatResult newExtensions, updatedExtensions
|
[
{
"context": "09Z\"\n list: [1, 2, 3]\n person:\n name: \"Alexander Schilling\"\n job: \"Developer\"\n complex: [\n {nam",
"end": 492,
"score": 0.9998141527175903,
"start": 473,
"tag": "NAME",
"value": "Alexander Schilling"
},
{
"context": " job: \"Developer\"\n complex: [\n {name: 'Egon'}\n {name: 'Janina'}\n ]\n calc: 900000\n ",
"end": 550,
"score": 0.9997836351394653,
"start": 546,
"tag": "NAME",
"value": "Egon"
},
{
"context": " complex: [\n {name: 'Egon'}\n {name: 'Janina'}\n ]\n calc: 900000\n math: 4\n\n describe ",
"end": 573,
"score": 0.9998037815093994,
"start": 567,
"tag": "NAME",
"value": "Janina"
}
] | test/mocha/js.coffee | alinex/node-formatter | 0 | chai = require 'chai'
expect = chai.expect
### eslint-env node, mocha ###
fs = require 'fs'
debug = require('debug') 'test'
chalk = require 'chalk'
formatter = require '../../src/index'
describe "JavaScript", ->
file = __dirname + '/../data/format.js'
format = 'js'
example = fs.readFileSync file, 'UTF8'
data =
null: null
boolean: true
string: 'test'
number: 5.6
date: "2016-05-10T19:06:36.909Z"
list: [1, 2, 3]
person:
name: "Alexander Schilling"
job: "Developer"
complex: [
{name: 'Egon'}
{name: 'Janina'}
]
calc: 900000
math: 4
describe "parse preset file", ->
it "should get object", (cb) ->
formatter.parse example, format, (err, obj) ->
expect(err, 'error').to.not.exist
expect(obj, 'object').to.deep.equal data
cb()
it "should work with autodetect", (cb) ->
formatter.parse example, (err, obj) ->
expect(err, 'error').to.not.exist
expect(obj, 'object').to.deep.equal data
cb()
it "should work with filename", (cb) ->
formatter.parse example, file, (err, obj) ->
expect(err, 'error').to.not.exist
expect(obj, 'object').to.deep.equal data
cb()
describe "format and parse", ->
it "should reread object", (cb) ->
formatter.stringify data, format, (err, text) ->
expect(err, 'error').to.not.exist
expect(typeof text, 'type of result').to.equal 'string'
debug "result", chalk.grey text
formatter.parse text, format, (err, obj) ->
expect(obj, 'reread object').to.deep.equal data
cb()
it "should format with indent", (cb) ->
formatter.stringify data, format,
indent: 0
, (err, text) ->
expect(err, 'error').to.not.exist
expect(typeof text, 'type of result').to.equal 'string'
debug "result", chalk.grey text
formatter.parse text, format, (err, obj) ->
expect(obj, 'reread object').to.deep.equal data
cb()
| 218374 | chai = require 'chai'
expect = chai.expect
### eslint-env node, mocha ###
fs = require 'fs'
debug = require('debug') 'test'
chalk = require 'chalk'
formatter = require '../../src/index'
describe "JavaScript", ->
file = __dirname + '/../data/format.js'
format = 'js'
example = fs.readFileSync file, 'UTF8'
data =
null: null
boolean: true
string: 'test'
number: 5.6
date: "2016-05-10T19:06:36.909Z"
list: [1, 2, 3]
person:
name: "<NAME>"
job: "Developer"
complex: [
{name: '<NAME>'}
{name: '<NAME>'}
]
calc: 900000
math: 4
describe "parse preset file", ->
it "should get object", (cb) ->
formatter.parse example, format, (err, obj) ->
expect(err, 'error').to.not.exist
expect(obj, 'object').to.deep.equal data
cb()
it "should work with autodetect", (cb) ->
formatter.parse example, (err, obj) ->
expect(err, 'error').to.not.exist
expect(obj, 'object').to.deep.equal data
cb()
it "should work with filename", (cb) ->
formatter.parse example, file, (err, obj) ->
expect(err, 'error').to.not.exist
expect(obj, 'object').to.deep.equal data
cb()
describe "format and parse", ->
it "should reread object", (cb) ->
formatter.stringify data, format, (err, text) ->
expect(err, 'error').to.not.exist
expect(typeof text, 'type of result').to.equal 'string'
debug "result", chalk.grey text
formatter.parse text, format, (err, obj) ->
expect(obj, 'reread object').to.deep.equal data
cb()
it "should format with indent", (cb) ->
formatter.stringify data, format,
indent: 0
, (err, text) ->
expect(err, 'error').to.not.exist
expect(typeof text, 'type of result').to.equal 'string'
debug "result", chalk.grey text
formatter.parse text, format, (err, obj) ->
expect(obj, 'reread object').to.deep.equal data
cb()
| true | chai = require 'chai'
expect = chai.expect
### eslint-env node, mocha ###
fs = require 'fs'
debug = require('debug') 'test'
chalk = require 'chalk'
formatter = require '../../src/index'
describe "JavaScript", ->
file = __dirname + '/../data/format.js'
format = 'js'
example = fs.readFileSync file, 'UTF8'
data =
null: null
boolean: true
string: 'test'
number: 5.6
date: "2016-05-10T19:06:36.909Z"
list: [1, 2, 3]
person:
name: "PI:NAME:<NAME>END_PI"
job: "Developer"
complex: [
{name: 'PI:NAME:<NAME>END_PI'}
{name: 'PI:NAME:<NAME>END_PI'}
]
calc: 900000
math: 4
describe "parse preset file", ->
it "should get object", (cb) ->
formatter.parse example, format, (err, obj) ->
expect(err, 'error').to.not.exist
expect(obj, 'object').to.deep.equal data
cb()
it "should work with autodetect", (cb) ->
formatter.parse example, (err, obj) ->
expect(err, 'error').to.not.exist
expect(obj, 'object').to.deep.equal data
cb()
it "should work with filename", (cb) ->
formatter.parse example, file, (err, obj) ->
expect(err, 'error').to.not.exist
expect(obj, 'object').to.deep.equal data
cb()
describe "format and parse", ->
it "should reread object", (cb) ->
formatter.stringify data, format, (err, text) ->
expect(err, 'error').to.not.exist
expect(typeof text, 'type of result').to.equal 'string'
debug "result", chalk.grey text
formatter.parse text, format, (err, obj) ->
expect(obj, 'reread object').to.deep.equal data
cb()
it "should format with indent", (cb) ->
formatter.stringify data, format,
indent: 0
, (err, text) ->
expect(err, 'error').to.not.exist
expect(typeof text, 'type of result').to.equal 'string'
debug "result", chalk.grey text
formatter.parse text, format, (err, obj) ->
expect(obj, 'reread object').to.deep.equal data
cb()
|
[
{
"context": "###\njQuery Lighter\nCopyright 2015 Kevin Sylvestre\n1.3.4\n###\n\n\"use strict\"\n\n$ = jQuery\n\nclass Animat",
"end": 49,
"score": 0.9998558163642883,
"start": 34,
"tag": "NAME",
"value": "Kevin Sylvestre"
}
] | public/assets/lightbox/javascripts/jquery.lighter.coffee | roiiroyd/Museum_database | 33 | ###
jQuery Lighter
Copyright 2015 Kevin Sylvestre
1.3.4
###
"use strict"
$ = jQuery
class Animation
@transitions:
"webkitTransition": "webkitTransitionEnd"
"mozTransition": "mozTransitionEnd"
"oTransition": "oTransitionEnd"
"transition": "transitionend"
@transition: ($el) ->
for el in $el
return result for type, result of @transitions when el.style[type]?
@execute: ($el, callback) ->
transition = @transition($el)
if transition? then $el.one(transition, callback) else callback()
class Slide
constructor: (url) ->
@url = url
type: ->
switch
when @url.match(/\.(webp|jpeg|jpg|jpe|gif|png|bmp)$/i) then 'image'
else 'unknown'
preload: (callback) ->
image = new Image()
image.src = @url
image.onload = =>
@dimensions =
width: image.width
height: image.height
callback(@)
$content: ->
$("<img />").attr(src: @url)
class Lighter
@namespace: "lighter"
defaults:
loading: '#{Lighter.namespace}-loading'
fetched: '#{Lighter.namespace}-fetched'
padding: 40
dimensions:
width: 480
height: 480
template:
"""
<div class='#{Lighter.namespace} #{Lighter.namespace}-fade'>
<div class='#{Lighter.namespace}-container'>
<span class='#{Lighter.namespace}-content'></span>
<a class='#{Lighter.namespace}-close'>×</a>
<a class='#{Lighter.namespace}-prev'>‹</a>
<a class='#{Lighter.namespace}-next'>›</a>
</div>
<div class='#{Lighter.namespace}-spinner'>
<div class='#{Lighter.namespace}-dot'></div>
<div class='#{Lighter.namespace}-dot'></div>
<div class='#{Lighter.namespace}-dot'></div>
</div>
<div class='#{Lighter.namespace}-overlay'></div>
</div>
"""
@lighter: ($target, options = {}) ->
data = $target.data('_lighter')
$target.data('_lighter', data = new Lighter($target, options)) unless data
return data
$: (selector) =>
@$el.find(selector)
constructor: ($target, settings = {}) ->
@$target = $target
@settings = $.extend {}, @defaults, settings
@$el = $(@settings.template)
@$overlay = @$(".#{Lighter.namespace}-overlay")
@$content = @$(".#{Lighter.namespace}-content")
@$container = @$(".#{Lighter.namespace}-container")
@$close = @$(".#{Lighter.namespace}-close")
@$prev = @$(".#{Lighter.namespace}-prev")
@$next = @$(".#{Lighter.namespace}-next")
@$body = @$(".#{Lighter.namespace}-body")
@dimensions = @settings.dimensions
@process()
close: (event) =>
event?.preventDefault()
event?.stopPropagation()
@hide()
next: (event) =>
event?.preventDefault()
event?.stopPropagation()
# TODO
prev: =>
event?.preventDefault()
event?.stopPropagation()
# TODO
type: (href = @href()) =>
@settings.type or ("image" if @href().match(/\.(webp|jpeg|jpg|jpe|gif|png|bmp)$/i))
resize: (dimensions) =>
@dimensions = dimensions
@align()
process: =>
fetched = =>
@$el.removeClass("#{Lighter.namespace}-loading").addClass("#{Lighter.namespace}-fetched")
loading = =>
@$el.removeClass("#{Lighter.namespace}-fetched").addClass("#{Lighter.namespace}-loading")
@slide = new Slide(@$target.attr("href"))
loading()
@slide.preload (slide) =>
@resize(slide.dimensions)
@$content.html(@slide.$content())
fetched()
align: =>
size = @size()
@$container.css
width: size.width
height: size.height
margin: "-#{size.height / 2}px -#{size.width / 2}px"
size: =>
ratio = Math.max (@dimensions.height / ($(window).height() - @settings.padding)) , (@dimensions.width / ($(window).width() - @settings.padding))
width: if ratio > 1.0 then Math.round(@dimensions.width / ratio) else @dimensions.width
height: if ratio > 1.0 then Math.round(@dimensions.height / ratio) else @dimensions.height
keyup: (event) =>
return if event.target.form?
@close() if event.which is 27 # esc
@prev() if event.which is 37 # l-arrow
@next() if event.which is 39 # r-arrow
observe: (method = 'on') =>
$(window)[method] "resize", @align
$(document)[method] "keyup", @keyup
@$overlay[method] "click", @close
@$close[method] "click", @close
@$next[method] "click", @next
@$prev[method] "click", @prev
hide: =>
alpha = => @observe('off')
omega = => @$el.remove()
alpha()
@$el.position()
@$el.addClass("#{Lighter.namespace}-fade")
Animation.execute(@$el, omega)
show: =>
omega = => @observe('on')
alpha = => $(document.body).append @$el
alpha()
@$el.position()
@$el.removeClass("#{Lighter.namespace}-fade")
Animation.execute(@$el, omega)
$.fn.extend
lighter: (option = {}) ->
@each ->
$this = $(@)
options = $.extend {}, $.fn.lighter.defaults, typeof option is "object" and option
action = if typeof option is "string" then option else option.action
action ?= "show"
Lighter.lighter($this, options)[action]()
$(document).on "click", "[data-lighter]", (event) ->
event.preventDefault()
event.stopPropagation()
$(this).lighter()
| 140235 | ###
jQuery Lighter
Copyright 2015 <NAME>
1.3.4
###
"use strict"
$ = jQuery
class Animation
@transitions:
"webkitTransition": "webkitTransitionEnd"
"mozTransition": "mozTransitionEnd"
"oTransition": "oTransitionEnd"
"transition": "transitionend"
@transition: ($el) ->
for el in $el
return result for type, result of @transitions when el.style[type]?
@execute: ($el, callback) ->
transition = @transition($el)
if transition? then $el.one(transition, callback) else callback()
class Slide
constructor: (url) ->
@url = url
type: ->
switch
when @url.match(/\.(webp|jpeg|jpg|jpe|gif|png|bmp)$/i) then 'image'
else 'unknown'
preload: (callback) ->
image = new Image()
image.src = @url
image.onload = =>
@dimensions =
width: image.width
height: image.height
callback(@)
$content: ->
$("<img />").attr(src: @url)
class Lighter
@namespace: "lighter"
defaults:
loading: '#{Lighter.namespace}-loading'
fetched: '#{Lighter.namespace}-fetched'
padding: 40
dimensions:
width: 480
height: 480
template:
"""
<div class='#{Lighter.namespace} #{Lighter.namespace}-fade'>
<div class='#{Lighter.namespace}-container'>
<span class='#{Lighter.namespace}-content'></span>
<a class='#{Lighter.namespace}-close'>×</a>
<a class='#{Lighter.namespace}-prev'>‹</a>
<a class='#{Lighter.namespace}-next'>›</a>
</div>
<div class='#{Lighter.namespace}-spinner'>
<div class='#{Lighter.namespace}-dot'></div>
<div class='#{Lighter.namespace}-dot'></div>
<div class='#{Lighter.namespace}-dot'></div>
</div>
<div class='#{Lighter.namespace}-overlay'></div>
</div>
"""
@lighter: ($target, options = {}) ->
data = $target.data('_lighter')
$target.data('_lighter', data = new Lighter($target, options)) unless data
return data
$: (selector) =>
@$el.find(selector)
constructor: ($target, settings = {}) ->
@$target = $target
@settings = $.extend {}, @defaults, settings
@$el = $(@settings.template)
@$overlay = @$(".#{Lighter.namespace}-overlay")
@$content = @$(".#{Lighter.namespace}-content")
@$container = @$(".#{Lighter.namespace}-container")
@$close = @$(".#{Lighter.namespace}-close")
@$prev = @$(".#{Lighter.namespace}-prev")
@$next = @$(".#{Lighter.namespace}-next")
@$body = @$(".#{Lighter.namespace}-body")
@dimensions = @settings.dimensions
@process()
close: (event) =>
event?.preventDefault()
event?.stopPropagation()
@hide()
next: (event) =>
event?.preventDefault()
event?.stopPropagation()
# TODO
prev: =>
event?.preventDefault()
event?.stopPropagation()
# TODO
type: (href = @href()) =>
@settings.type or ("image" if @href().match(/\.(webp|jpeg|jpg|jpe|gif|png|bmp)$/i))
resize: (dimensions) =>
@dimensions = dimensions
@align()
process: =>
fetched = =>
@$el.removeClass("#{Lighter.namespace}-loading").addClass("#{Lighter.namespace}-fetched")
loading = =>
@$el.removeClass("#{Lighter.namespace}-fetched").addClass("#{Lighter.namespace}-loading")
@slide = new Slide(@$target.attr("href"))
loading()
@slide.preload (slide) =>
@resize(slide.dimensions)
@$content.html(@slide.$content())
fetched()
align: =>
size = @size()
@$container.css
width: size.width
height: size.height
margin: "-#{size.height / 2}px -#{size.width / 2}px"
size: =>
ratio = Math.max (@dimensions.height / ($(window).height() - @settings.padding)) , (@dimensions.width / ($(window).width() - @settings.padding))
width: if ratio > 1.0 then Math.round(@dimensions.width / ratio) else @dimensions.width
height: if ratio > 1.0 then Math.round(@dimensions.height / ratio) else @dimensions.height
keyup: (event) =>
return if event.target.form?
@close() if event.which is 27 # esc
@prev() if event.which is 37 # l-arrow
@next() if event.which is 39 # r-arrow
observe: (method = 'on') =>
$(window)[method] "resize", @align
$(document)[method] "keyup", @keyup
@$overlay[method] "click", @close
@$close[method] "click", @close
@$next[method] "click", @next
@$prev[method] "click", @prev
hide: =>
alpha = => @observe('off')
omega = => @$el.remove()
alpha()
@$el.position()
@$el.addClass("#{Lighter.namespace}-fade")
Animation.execute(@$el, omega)
show: =>
omega = => @observe('on')
alpha = => $(document.body).append @$el
alpha()
@$el.position()
@$el.removeClass("#{Lighter.namespace}-fade")
Animation.execute(@$el, omega)
$.fn.extend
lighter: (option = {}) ->
@each ->
$this = $(@)
options = $.extend {}, $.fn.lighter.defaults, typeof option is "object" and option
action = if typeof option is "string" then option else option.action
action ?= "show"
Lighter.lighter($this, options)[action]()
$(document).on "click", "[data-lighter]", (event) ->
event.preventDefault()
event.stopPropagation()
$(this).lighter()
| true | ###
jQuery Lighter
Copyright 2015 PI:NAME:<NAME>END_PI
1.3.4
###
"use strict"
$ = jQuery
class Animation
@transitions:
"webkitTransition": "webkitTransitionEnd"
"mozTransition": "mozTransitionEnd"
"oTransition": "oTransitionEnd"
"transition": "transitionend"
@transition: ($el) ->
for el in $el
return result for type, result of @transitions when el.style[type]?
@execute: ($el, callback) ->
transition = @transition($el)
if transition? then $el.one(transition, callback) else callback()
class Slide
constructor: (url) ->
@url = url
type: ->
switch
when @url.match(/\.(webp|jpeg|jpg|jpe|gif|png|bmp)$/i) then 'image'
else 'unknown'
preload: (callback) ->
image = new Image()
image.src = @url
image.onload = =>
@dimensions =
width: image.width
height: image.height
callback(@)
$content: ->
$("<img />").attr(src: @url)
class Lighter
@namespace: "lighter"
defaults:
loading: '#{Lighter.namespace}-loading'
fetched: '#{Lighter.namespace}-fetched'
padding: 40
dimensions:
width: 480
height: 480
template:
"""
<div class='#{Lighter.namespace} #{Lighter.namespace}-fade'>
<div class='#{Lighter.namespace}-container'>
<span class='#{Lighter.namespace}-content'></span>
<a class='#{Lighter.namespace}-close'>×</a>
<a class='#{Lighter.namespace}-prev'>‹</a>
<a class='#{Lighter.namespace}-next'>›</a>
</div>
<div class='#{Lighter.namespace}-spinner'>
<div class='#{Lighter.namespace}-dot'></div>
<div class='#{Lighter.namespace}-dot'></div>
<div class='#{Lighter.namespace}-dot'></div>
</div>
<div class='#{Lighter.namespace}-overlay'></div>
</div>
"""
@lighter: ($target, options = {}) ->
data = $target.data('_lighter')
$target.data('_lighter', data = new Lighter($target, options)) unless data
return data
$: (selector) =>
@$el.find(selector)
constructor: ($target, settings = {}) ->
@$target = $target
@settings = $.extend {}, @defaults, settings
@$el = $(@settings.template)
@$overlay = @$(".#{Lighter.namespace}-overlay")
@$content = @$(".#{Lighter.namespace}-content")
@$container = @$(".#{Lighter.namespace}-container")
@$close = @$(".#{Lighter.namespace}-close")
@$prev = @$(".#{Lighter.namespace}-prev")
@$next = @$(".#{Lighter.namespace}-next")
@$body = @$(".#{Lighter.namespace}-body")
@dimensions = @settings.dimensions
@process()
close: (event) =>
event?.preventDefault()
event?.stopPropagation()
@hide()
next: (event) =>
event?.preventDefault()
event?.stopPropagation()
# TODO
prev: =>
event?.preventDefault()
event?.stopPropagation()
# TODO
type: (href = @href()) =>
@settings.type or ("image" if @href().match(/\.(webp|jpeg|jpg|jpe|gif|png|bmp)$/i))
resize: (dimensions) =>
@dimensions = dimensions
@align()
process: =>
fetched = =>
@$el.removeClass("#{Lighter.namespace}-loading").addClass("#{Lighter.namespace}-fetched")
loading = =>
@$el.removeClass("#{Lighter.namespace}-fetched").addClass("#{Lighter.namespace}-loading")
@slide = new Slide(@$target.attr("href"))
loading()
@slide.preload (slide) =>
@resize(slide.dimensions)
@$content.html(@slide.$content())
fetched()
align: =>
size = @size()
@$container.css
width: size.width
height: size.height
margin: "-#{size.height / 2}px -#{size.width / 2}px"
size: =>
ratio = Math.max (@dimensions.height / ($(window).height() - @settings.padding)) , (@dimensions.width / ($(window).width() - @settings.padding))
width: if ratio > 1.0 then Math.round(@dimensions.width / ratio) else @dimensions.width
height: if ratio > 1.0 then Math.round(@dimensions.height / ratio) else @dimensions.height
keyup: (event) =>
return if event.target.form?
@close() if event.which is 27 # esc
@prev() if event.which is 37 # l-arrow
@next() if event.which is 39 # r-arrow
observe: (method = 'on') =>
$(window)[method] "resize", @align
$(document)[method] "keyup", @keyup
@$overlay[method] "click", @close
@$close[method] "click", @close
@$next[method] "click", @next
@$prev[method] "click", @prev
hide: =>
alpha = => @observe('off')
omega = => @$el.remove()
alpha()
@$el.position()
@$el.addClass("#{Lighter.namespace}-fade")
Animation.execute(@$el, omega)
show: =>
omega = => @observe('on')
alpha = => $(document.body).append @$el
alpha()
@$el.position()
@$el.removeClass("#{Lighter.namespace}-fade")
Animation.execute(@$el, omega)
$.fn.extend
lighter: (option = {}) ->
@each ->
$this = $(@)
options = $.extend {}, $.fn.lighter.defaults, typeof option is "object" and option
action = if typeof option is "string" then option else option.action
action ?= "show"
Lighter.lighter($this, options)[action]()
$(document).on "click", "[data-lighter]", (event) ->
event.preventDefault()
event.stopPropagation()
$(this).lighter()
|
[
{
"context": "nable()\n\n toggleViolationMetadata: ->\n key = 'showViolationMetadata'\n currentValue = Config.get(key)\n Config.se",
"end": 1483,
"score": 0.9541182518005371,
"start": 1462,
"tag": "KEY",
"value": "showViolationMetadata"
}
] | lib/atom-lint.coffee | lee-dohm/atom-lint | 36 | # Minimize additional startup time of Atom caused by atom-lint.
LintView = null
LintStatusView = null
Config = null
_ = null
module.exports =
configDefaults:
ignoredNames: []
showViolationMetadata: true
activate: ->
atom.workspaceView.command 'lint:toggle', => @toggle()
atom.workspaceView.command 'lint:toggle-violation-metadata', => @toggleViolationMetadata()
@lintViews = []
@enable()
deactivate: ->
atom.workspaceView?.off('lint:toggle-violation-metadata')
atom.workspaceView?.off('lint:toggle')
@disable()
enable: ->
@enabled = true
# Subscribing to every current and future editor
@editorViewSubscription = atom.workspaceView.eachEditorView (editorView) =>
@injectLintViewIntoEditorView(editorView)
@injectLintStatusViewIntoStatusBar()
atom.packages.once 'activated', =>
@injectLintStatusViewIntoStatusBar()
Config ?= require './config'
@configSubscription = Config.onDidChange (event) =>
return unless @shouldRefleshWithConfigChange(event.oldValue, event.newValue)
for lintView in @lintViews
lintView.refresh()
disable: ->
@lintStatusView?.remove()
@lintStatusView = null
@configSubscription?.off()
@editorViewSubscription?.off()
while view = @lintViews.shift()
view.remove()
@enabled = false
toggle: ->
if @enabled
@disable()
else
@enable()
toggleViolationMetadata: ->
key = 'showViolationMetadata'
currentValue = Config.get(key)
Config.set(key, !currentValue)
injectLintViewIntoEditorView: (editorView) ->
return unless editorView.getPane()?
return unless editorView.attached
return if editorView.lintView?
LintView ?= require './lint-view'
lintView = new LintView(editorView)
@lintViews.push(lintView)
injectLintStatusViewIntoStatusBar: ->
return if @lintStatusView?
statusBar = atom.workspaceView.statusBar
return unless statusBar?
LintStatusView ?= require './lint-status-view'
@lintStatusView = new LintStatusView(statusBar)
statusBar.prependRight(@lintStatusView)
shouldRefleshWithConfigChange: (previous, current) ->
previous.showViolationMetadata = current.showViolationMetadata = null
_ ?= require 'lodash'
!_.isEqual(previous, current)
| 95832 | # Minimize additional startup time of Atom caused by atom-lint.
LintView = null
LintStatusView = null
Config = null
_ = null
module.exports =
configDefaults:
ignoredNames: []
showViolationMetadata: true
activate: ->
atom.workspaceView.command 'lint:toggle', => @toggle()
atom.workspaceView.command 'lint:toggle-violation-metadata', => @toggleViolationMetadata()
@lintViews = []
@enable()
deactivate: ->
atom.workspaceView?.off('lint:toggle-violation-metadata')
atom.workspaceView?.off('lint:toggle')
@disable()
enable: ->
@enabled = true
# Subscribing to every current and future editor
@editorViewSubscription = atom.workspaceView.eachEditorView (editorView) =>
@injectLintViewIntoEditorView(editorView)
@injectLintStatusViewIntoStatusBar()
atom.packages.once 'activated', =>
@injectLintStatusViewIntoStatusBar()
Config ?= require './config'
@configSubscription = Config.onDidChange (event) =>
return unless @shouldRefleshWithConfigChange(event.oldValue, event.newValue)
for lintView in @lintViews
lintView.refresh()
disable: ->
@lintStatusView?.remove()
@lintStatusView = null
@configSubscription?.off()
@editorViewSubscription?.off()
while view = @lintViews.shift()
view.remove()
@enabled = false
toggle: ->
if @enabled
@disable()
else
@enable()
toggleViolationMetadata: ->
key = '<KEY>'
currentValue = Config.get(key)
Config.set(key, !currentValue)
injectLintViewIntoEditorView: (editorView) ->
return unless editorView.getPane()?
return unless editorView.attached
return if editorView.lintView?
LintView ?= require './lint-view'
lintView = new LintView(editorView)
@lintViews.push(lintView)
injectLintStatusViewIntoStatusBar: ->
return if @lintStatusView?
statusBar = atom.workspaceView.statusBar
return unless statusBar?
LintStatusView ?= require './lint-status-view'
@lintStatusView = new LintStatusView(statusBar)
statusBar.prependRight(@lintStatusView)
shouldRefleshWithConfigChange: (previous, current) ->
previous.showViolationMetadata = current.showViolationMetadata = null
_ ?= require 'lodash'
!_.isEqual(previous, current)
| true | # Minimize additional startup time of Atom caused by atom-lint.
LintView = null
LintStatusView = null
Config = null
_ = null
module.exports =
configDefaults:
ignoredNames: []
showViolationMetadata: true
activate: ->
atom.workspaceView.command 'lint:toggle', => @toggle()
atom.workspaceView.command 'lint:toggle-violation-metadata', => @toggleViolationMetadata()
@lintViews = []
@enable()
deactivate: ->
atom.workspaceView?.off('lint:toggle-violation-metadata')
atom.workspaceView?.off('lint:toggle')
@disable()
enable: ->
@enabled = true
# Subscribing to every current and future editor
@editorViewSubscription = atom.workspaceView.eachEditorView (editorView) =>
@injectLintViewIntoEditorView(editorView)
@injectLintStatusViewIntoStatusBar()
atom.packages.once 'activated', =>
@injectLintStatusViewIntoStatusBar()
Config ?= require './config'
@configSubscription = Config.onDidChange (event) =>
return unless @shouldRefleshWithConfigChange(event.oldValue, event.newValue)
for lintView in @lintViews
lintView.refresh()
disable: ->
@lintStatusView?.remove()
@lintStatusView = null
@configSubscription?.off()
@editorViewSubscription?.off()
while view = @lintViews.shift()
view.remove()
@enabled = false
toggle: ->
if @enabled
@disable()
else
@enable()
toggleViolationMetadata: ->
key = 'PI:KEY:<KEY>END_PI'
currentValue = Config.get(key)
Config.set(key, !currentValue)
injectLintViewIntoEditorView: (editorView) ->
return unless editorView.getPane()?
return unless editorView.attached
return if editorView.lintView?
LintView ?= require './lint-view'
lintView = new LintView(editorView)
@lintViews.push(lintView)
injectLintStatusViewIntoStatusBar: ->
return if @lintStatusView?
statusBar = atom.workspaceView.statusBar
return unless statusBar?
LintStatusView ?= require './lint-status-view'
@lintStatusView = new LintStatusView(statusBar)
statusBar.prependRight(@lintStatusView)
shouldRefleshWithConfigChange: (previous, current) ->
previous.showViolationMetadata = current.showViolationMetadata = null
_ ?= require 'lodash'
!_.isEqual(previous, current)
|
[
{
"context": "work: 'wifi'\n\t\twifiSsid: 'mywifissid'\n\t\twifiKey: 'mywifikey'\n\n\tinit.configure(images.raspberrypi, UUIDS.raspb",
"end": 2855,
"score": 0.9946384429931641,
"start": 2846,
"tag": "KEY",
"value": "mywifikey"
},
{
"context": "work: 'wifi'\n\t\twifiSsid: 'mywifissid'\n\t\twifiKey: 'mywifikey'\n\n\tresin.models.device.get(UUIDS.edison).then (de",
"end": 6971,
"score": 0.9896867275238037,
"start": 6962,
"tag": "KEY",
"value": "mywifikey"
},
{
"context": "work: 'wifi'\n\t\twifiSsid: 'mywifissid'\n\t\twifiKey: 'mywifikey'\n\n\tspy = m.sinon.spy()\n\n\tinit.configure(images.ed",
"end": 7953,
"score": 0.9939249157905579,
"start": 7944,
"tag": "KEY",
"value": "mywifikey"
},
{
"context": "work: 'wifi'\n\t\twifiSsid: 'mywifissid'\n\t\twifiKey: 'mywifikey'\n\n\tstdout = ''\n\tstderr = ''\n\n\tresin.models.device",
"end": 8358,
"score": 0.9971847534179688,
"start": 8349,
"tag": "KEY",
"value": "mywifikey"
},
{
"context": "\n\temail: process.env.RESIN_E2E_USERNAME\n\tpassword: process.env.RESIN_E2E_PASSWORD\n.then ->\n\tconsole.log('Logged in')\n\tPromise.props",
"end": 8996,
"score": 0.9980012774467468,
"start": 8966,
"tag": "PASSWORD",
"value": "process.env.RESIN_E2E_PASSWORD"
}
] | tests/e2e.coffee | everyside/resin-device-init | 0 | m = require('mochainon')
_ = require('lodash')
os = require('os')
path = require('path')
Promise = require('bluebird')
fs = Promise.promisifyAll(require('fs'))
wary = require('wary')
resin = require('resin-sdk')
imagefs = require('resin-image-fs')
init = require('../lib/init')
RASPBERRYPI = path.join(__dirname, 'images', 'raspberrypi.img')
EDISON = path.join(__dirname, 'images', 'edison')
RANDOM = path.join(__dirname, 'images', 'device.random')
UUIDS = {}
prepareDevice = (deviceType) ->
applicationName = "DeviceInitE2E_#{deviceType.replace(/[- ]/, '_')}"
console.log("Creating #{applicationName}")
resin.models.application.has(applicationName).then (hasApplication) ->
return if hasApplication
resin.models.application.create(applicationName, deviceType)
.then(resin.models.device.generateUUID)
.then (uuid) ->
resin.models.device.register(applicationName, uuid)
.get('uuid')
extract = (stream) ->
return new Promise (resolve, reject) ->
result = ''
stream.on('error', reject)
stream.on 'data', (chunk) ->
result += chunk
stream.on 'end', ->
resolve(result)
waitStream = (stream) ->
return new Promise (resolve, reject) ->
stream.on('error', reject)
stream.on('close', resolve)
stream.on('end', resolve)
########################################################################
# Raspberry Pi
########################################################################
wary.it 'should add a correct config.json to a raspberry pi',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
resin.models.device.get(UUIDS.raspberrypi).then (device) ->
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.deviceType).to.equal('raspberry-pi')
m.chai.expect(config.applicationId).to.equal(device.application[0].id)
m.chai.expect(config.deviceId).to.equal(device.id)
m.chai.expect(config.uuid).to.equal(UUIDS.raspberrypi)
wary.it 'should configure a raspberry pi with ethernet',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
networkConfig = config.files['network/network.config']
m.chai.expect(networkConfig).to.not.include('wifi')
m.chai.expect(networkConfig).to.include('ethernet')
wary.it 'should configure a raspberry pi with wifi',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: 'mywifikey'
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
networkConfig = config.files['network/network.config']
m.chai.expect(networkConfig).to.include('wifi')
m.chai.expect(networkConfig).to.include("Name = #{options.wifiSsid}")
m.chai.expect(networkConfig).to.include("Passphrase = #{options.wifiKey}")
wary.it 'should not trigger a stat event when configuring a rasperry pi',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
spy = m.sinon.spy()
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then (configuration) ->
configuration.on('state', spy)
return waitStream(configuration)
.then ->
m.chai.expect(spy).to.not.have.been.called
wary.it 'should initialize a raspberry pi image',
raspberrypi: RASPBERRYPI
random: RANDOM
, (images) ->
options =
network: 'ethernet'
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream).then ->
init.initialize(images.raspberrypi, 'raspberry-pi', drive: images.random)
.then(waitStream).then ->
Promise.props
raspberrypi: fs.readFileAsync(images.raspberrypi)
random: fs.readFileAsync(images.random)
.then (results) ->
m.chai.expect(results.random).to.deep.equal(results.raspberrypi)
wary.it 'should emit state events when initializing a raspberry pi',
raspberrypi: RASPBERRYPI
random: RANDOM
, (images) ->
options =
network: 'ethernet'
spy = m.sinon.spy()
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream).then ->
init.initialize(images.raspberrypi, 'raspberry-pi', drive: images.random)
.then (initialization) ->
initialization.on('state', spy)
return waitStream(initialization)
.then ->
m.chai.expect(spy).to.have.been.calledOnce
args = spy.firstCall.args
m.chai.expect(args[0].operation.command).to.equal('burn')
m.chai.expect(args[0].percentage).to.equal(100)
wary.it 'should emit burn events when initializing a raspberry pi',
raspberrypi: RASPBERRYPI
random: RANDOM
, (images) ->
options =
network: 'ethernet'
spy = m.sinon.spy()
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream).then ->
init.initialize(images.raspberrypi, 'raspberry-pi', drive: images.random)
.then (initialization) ->
initialization.on('burn', spy)
return waitStream(initialization)
.then ->
m.chai.expect(spy).to.have.been.called
args = spy.lastCall.args
m.chai.expect(args[0].percentage).to.equal(100)
m.chai.expect(args[0].eta).to.equal(0)
wary.it 'should accept an appUpdatePollInterval setting',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
appUpdatePollInterval: 2
resin.models.device.get(UUIDS.raspberrypi).then (device) ->
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.appUpdatePollInterval).to.equal('120000')
wary.it 'should default appUpdatePollInterval to 1 second',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
resin.models.device.get(UUIDS.raspberrypi).then (device) ->
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.appUpdatePollInterval).to.equal(60000)
########################################################################
# Intel Edison
########################################################################
wary.it 'should add a correct config.json to an intel edison',
edison: EDISON
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: 'mywifikey'
resin.models.device.get(UUIDS.edison).then (device) ->
init.configure(images.edison, UUIDS.edison, options)
.then(waitStream)
.then _.partial imagefs.read,
image: path.join(images.edison, 'config.img')
path: '/config.json'
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.deviceType).to.equal('intel-edison')
m.chai.expect(config.applicationId).to.equal(device.application[0].id)
m.chai.expect(config.deviceId).to.equal(device.id)
m.chai.expect(config.uuid).to.equal(UUIDS.edison)
networkConfig = config.files['network/network.config']
m.chai.expect(networkConfig).to.include('wifi')
m.chai.expect(networkConfig).to.include("Name = #{options.wifiSsid}")
m.chai.expect(networkConfig).to.include("Passphrase = #{options.wifiKey}")
wary.it 'should not trigger a stat event when configuring an intel edison',
edison: EDISON
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: 'mywifikey'
spy = m.sinon.spy()
init.configure(images.edison, UUIDS.edison, options)
.then (configuration) ->
configuration.on('state', spy)
return waitStream(configuration)
.then ->
m.chai.expect(spy).to.not.have.been.called
wary.it 'should be able to initialize an intel edison with a script',
edison: EDISON
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: 'mywifikey'
stdout = ''
stderr = ''
resin.models.device.get(UUIDS.edison).then (device) ->
init.configure(images.edison, UUIDS.edison, options)
.then(waitStream)
.then ->
init.initialize(images.edison, 'intel-edison', options)
.then (initialization) ->
initialization.on 'stdout', (data) ->
stdout += data
initialization.on 'stderr', (data) ->
stderr += data
return waitStream(initialization)
.then ->
m.chai.expect(stdout.replace(/[\n\r]/g, '')).to.equal('Hello World')
m.chai.expect(stderr).to.equal('')
resin.auth.login
email: process.env.RESIN_E2E_USERNAME
password: process.env.RESIN_E2E_PASSWORD
.then ->
console.log('Logged in')
Promise.props
raspberrypi: prepareDevice('Raspberry Pi')
edison: prepareDevice('Intel Edison')
.then (uuids) ->
UUIDS = uuids
wary.run().catch (error) ->
console.error(error, error.stack)
process.exit(1)
| 97543 | m = require('mochainon')
_ = require('lodash')
os = require('os')
path = require('path')
Promise = require('bluebird')
fs = Promise.promisifyAll(require('fs'))
wary = require('wary')
resin = require('resin-sdk')
imagefs = require('resin-image-fs')
init = require('../lib/init')
RASPBERRYPI = path.join(__dirname, 'images', 'raspberrypi.img')
EDISON = path.join(__dirname, 'images', 'edison')
RANDOM = path.join(__dirname, 'images', 'device.random')
UUIDS = {}
prepareDevice = (deviceType) ->
applicationName = "DeviceInitE2E_#{deviceType.replace(/[- ]/, '_')}"
console.log("Creating #{applicationName}")
resin.models.application.has(applicationName).then (hasApplication) ->
return if hasApplication
resin.models.application.create(applicationName, deviceType)
.then(resin.models.device.generateUUID)
.then (uuid) ->
resin.models.device.register(applicationName, uuid)
.get('uuid')
extract = (stream) ->
return new Promise (resolve, reject) ->
result = ''
stream.on('error', reject)
stream.on 'data', (chunk) ->
result += chunk
stream.on 'end', ->
resolve(result)
waitStream = (stream) ->
return new Promise (resolve, reject) ->
stream.on('error', reject)
stream.on('close', resolve)
stream.on('end', resolve)
########################################################################
# Raspberry Pi
########################################################################
wary.it 'should add a correct config.json to a raspberry pi',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
resin.models.device.get(UUIDS.raspberrypi).then (device) ->
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.deviceType).to.equal('raspberry-pi')
m.chai.expect(config.applicationId).to.equal(device.application[0].id)
m.chai.expect(config.deviceId).to.equal(device.id)
m.chai.expect(config.uuid).to.equal(UUIDS.raspberrypi)
wary.it 'should configure a raspberry pi with ethernet',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
networkConfig = config.files['network/network.config']
m.chai.expect(networkConfig).to.not.include('wifi')
m.chai.expect(networkConfig).to.include('ethernet')
wary.it 'should configure a raspberry pi with wifi',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: '<KEY>'
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
networkConfig = config.files['network/network.config']
m.chai.expect(networkConfig).to.include('wifi')
m.chai.expect(networkConfig).to.include("Name = #{options.wifiSsid}")
m.chai.expect(networkConfig).to.include("Passphrase = #{options.wifiKey}")
wary.it 'should not trigger a stat event when configuring a rasperry pi',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
spy = m.sinon.spy()
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then (configuration) ->
configuration.on('state', spy)
return waitStream(configuration)
.then ->
m.chai.expect(spy).to.not.have.been.called
wary.it 'should initialize a raspberry pi image',
raspberrypi: RASPBERRYPI
random: RANDOM
, (images) ->
options =
network: 'ethernet'
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream).then ->
init.initialize(images.raspberrypi, 'raspberry-pi', drive: images.random)
.then(waitStream).then ->
Promise.props
raspberrypi: fs.readFileAsync(images.raspberrypi)
random: fs.readFileAsync(images.random)
.then (results) ->
m.chai.expect(results.random).to.deep.equal(results.raspberrypi)
wary.it 'should emit state events when initializing a raspberry pi',
raspberrypi: RASPBERRYPI
random: RANDOM
, (images) ->
options =
network: 'ethernet'
spy = m.sinon.spy()
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream).then ->
init.initialize(images.raspberrypi, 'raspberry-pi', drive: images.random)
.then (initialization) ->
initialization.on('state', spy)
return waitStream(initialization)
.then ->
m.chai.expect(spy).to.have.been.calledOnce
args = spy.firstCall.args
m.chai.expect(args[0].operation.command).to.equal('burn')
m.chai.expect(args[0].percentage).to.equal(100)
wary.it 'should emit burn events when initializing a raspberry pi',
raspberrypi: RASPBERRYPI
random: RANDOM
, (images) ->
options =
network: 'ethernet'
spy = m.sinon.spy()
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream).then ->
init.initialize(images.raspberrypi, 'raspberry-pi', drive: images.random)
.then (initialization) ->
initialization.on('burn', spy)
return waitStream(initialization)
.then ->
m.chai.expect(spy).to.have.been.called
args = spy.lastCall.args
m.chai.expect(args[0].percentage).to.equal(100)
m.chai.expect(args[0].eta).to.equal(0)
wary.it 'should accept an appUpdatePollInterval setting',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
appUpdatePollInterval: 2
resin.models.device.get(UUIDS.raspberrypi).then (device) ->
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.appUpdatePollInterval).to.equal('120000')
wary.it 'should default appUpdatePollInterval to 1 second',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
resin.models.device.get(UUIDS.raspberrypi).then (device) ->
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.appUpdatePollInterval).to.equal(60000)
########################################################################
# Intel Edison
########################################################################
wary.it 'should add a correct config.json to an intel edison',
edison: EDISON
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: '<KEY>'
resin.models.device.get(UUIDS.edison).then (device) ->
init.configure(images.edison, UUIDS.edison, options)
.then(waitStream)
.then _.partial imagefs.read,
image: path.join(images.edison, 'config.img')
path: '/config.json'
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.deviceType).to.equal('intel-edison')
m.chai.expect(config.applicationId).to.equal(device.application[0].id)
m.chai.expect(config.deviceId).to.equal(device.id)
m.chai.expect(config.uuid).to.equal(UUIDS.edison)
networkConfig = config.files['network/network.config']
m.chai.expect(networkConfig).to.include('wifi')
m.chai.expect(networkConfig).to.include("Name = #{options.wifiSsid}")
m.chai.expect(networkConfig).to.include("Passphrase = #{options.wifiKey}")
wary.it 'should not trigger a stat event when configuring an intel edison',
edison: EDISON
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: '<KEY>'
spy = m.sinon.spy()
init.configure(images.edison, UUIDS.edison, options)
.then (configuration) ->
configuration.on('state', spy)
return waitStream(configuration)
.then ->
m.chai.expect(spy).to.not.have.been.called
wary.it 'should be able to initialize an intel edison with a script',
edison: EDISON
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: '<KEY>'
stdout = ''
stderr = ''
resin.models.device.get(UUIDS.edison).then (device) ->
init.configure(images.edison, UUIDS.edison, options)
.then(waitStream)
.then ->
init.initialize(images.edison, 'intel-edison', options)
.then (initialization) ->
initialization.on 'stdout', (data) ->
stdout += data
initialization.on 'stderr', (data) ->
stderr += data
return waitStream(initialization)
.then ->
m.chai.expect(stdout.replace(/[\n\r]/g, '')).to.equal('Hello World')
m.chai.expect(stderr).to.equal('')
resin.auth.login
email: process.env.RESIN_E2E_USERNAME
password: <PASSWORD>
.then ->
console.log('Logged in')
Promise.props
raspberrypi: prepareDevice('Raspberry Pi')
edison: prepareDevice('Intel Edison')
.then (uuids) ->
UUIDS = uuids
wary.run().catch (error) ->
console.error(error, error.stack)
process.exit(1)
| true | m = require('mochainon')
_ = require('lodash')
os = require('os')
path = require('path')
Promise = require('bluebird')
fs = Promise.promisifyAll(require('fs'))
wary = require('wary')
resin = require('resin-sdk')
imagefs = require('resin-image-fs')
init = require('../lib/init')
RASPBERRYPI = path.join(__dirname, 'images', 'raspberrypi.img')
EDISON = path.join(__dirname, 'images', 'edison')
RANDOM = path.join(__dirname, 'images', 'device.random')
UUIDS = {}
prepareDevice = (deviceType) ->
applicationName = "DeviceInitE2E_#{deviceType.replace(/[- ]/, '_')}"
console.log("Creating #{applicationName}")
resin.models.application.has(applicationName).then (hasApplication) ->
return if hasApplication
resin.models.application.create(applicationName, deviceType)
.then(resin.models.device.generateUUID)
.then (uuid) ->
resin.models.device.register(applicationName, uuid)
.get('uuid')
extract = (stream) ->
return new Promise (resolve, reject) ->
result = ''
stream.on('error', reject)
stream.on 'data', (chunk) ->
result += chunk
stream.on 'end', ->
resolve(result)
waitStream = (stream) ->
return new Promise (resolve, reject) ->
stream.on('error', reject)
stream.on('close', resolve)
stream.on('end', resolve)
########################################################################
# Raspberry Pi
########################################################################
wary.it 'should add a correct config.json to a raspberry pi',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
resin.models.device.get(UUIDS.raspberrypi).then (device) ->
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.deviceType).to.equal('raspberry-pi')
m.chai.expect(config.applicationId).to.equal(device.application[0].id)
m.chai.expect(config.deviceId).to.equal(device.id)
m.chai.expect(config.uuid).to.equal(UUIDS.raspberrypi)
wary.it 'should configure a raspberry pi with ethernet',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
networkConfig = config.files['network/network.config']
m.chai.expect(networkConfig).to.not.include('wifi')
m.chai.expect(networkConfig).to.include('ethernet')
wary.it 'should configure a raspberry pi with wifi',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: 'PI:KEY:<KEY>END_PI'
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
networkConfig = config.files['network/network.config']
m.chai.expect(networkConfig).to.include('wifi')
m.chai.expect(networkConfig).to.include("Name = #{options.wifiSsid}")
m.chai.expect(networkConfig).to.include("Passphrase = #{options.wifiKey}")
wary.it 'should not trigger a stat event when configuring a rasperry pi',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
spy = m.sinon.spy()
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then (configuration) ->
configuration.on('state', spy)
return waitStream(configuration)
.then ->
m.chai.expect(spy).to.not.have.been.called
wary.it 'should initialize a raspberry pi image',
raspberrypi: RASPBERRYPI
random: RANDOM
, (images) ->
options =
network: 'ethernet'
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream).then ->
init.initialize(images.raspberrypi, 'raspberry-pi', drive: images.random)
.then(waitStream).then ->
Promise.props
raspberrypi: fs.readFileAsync(images.raspberrypi)
random: fs.readFileAsync(images.random)
.then (results) ->
m.chai.expect(results.random).to.deep.equal(results.raspberrypi)
wary.it 'should emit state events when initializing a raspberry pi',
raspberrypi: RASPBERRYPI
random: RANDOM
, (images) ->
options =
network: 'ethernet'
spy = m.sinon.spy()
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream).then ->
init.initialize(images.raspberrypi, 'raspberry-pi', drive: images.random)
.then (initialization) ->
initialization.on('state', spy)
return waitStream(initialization)
.then ->
m.chai.expect(spy).to.have.been.calledOnce
args = spy.firstCall.args
m.chai.expect(args[0].operation.command).to.equal('burn')
m.chai.expect(args[0].percentage).to.equal(100)
wary.it 'should emit burn events when initializing a raspberry pi',
raspberrypi: RASPBERRYPI
random: RANDOM
, (images) ->
options =
network: 'ethernet'
spy = m.sinon.spy()
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream).then ->
init.initialize(images.raspberrypi, 'raspberry-pi', drive: images.random)
.then (initialization) ->
initialization.on('burn', spy)
return waitStream(initialization)
.then ->
m.chai.expect(spy).to.have.been.called
args = spy.lastCall.args
m.chai.expect(args[0].percentage).to.equal(100)
m.chai.expect(args[0].eta).to.equal(0)
wary.it 'should accept an appUpdatePollInterval setting',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
appUpdatePollInterval: 2
resin.models.device.get(UUIDS.raspberrypi).then (device) ->
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.appUpdatePollInterval).to.equal('120000')
wary.it 'should default appUpdatePollInterval to 1 second',
raspberrypi: RASPBERRYPI
, (images) ->
options =
network: 'ethernet'
resin.models.device.get(UUIDS.raspberrypi).then (device) ->
init.configure(images.raspberrypi, UUIDS.raspberrypi, options)
.then(waitStream)
.then _.partial imagefs.read,
partition:
primary: 4
logical: 1
path: '/config.json'
image: images.raspberrypi
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.appUpdatePollInterval).to.equal(60000)
########################################################################
# Intel Edison
########################################################################
wary.it 'should add a correct config.json to an intel edison',
edison: EDISON
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: 'PI:KEY:<KEY>END_PI'
resin.models.device.get(UUIDS.edison).then (device) ->
init.configure(images.edison, UUIDS.edison, options)
.then(waitStream)
.then _.partial imagefs.read,
image: path.join(images.edison, 'config.img')
path: '/config.json'
.then(extract)
.then(JSON.parse)
.then (config) ->
m.chai.expect(config.deviceType).to.equal('intel-edison')
m.chai.expect(config.applicationId).to.equal(device.application[0].id)
m.chai.expect(config.deviceId).to.equal(device.id)
m.chai.expect(config.uuid).to.equal(UUIDS.edison)
networkConfig = config.files['network/network.config']
m.chai.expect(networkConfig).to.include('wifi')
m.chai.expect(networkConfig).to.include("Name = #{options.wifiSsid}")
m.chai.expect(networkConfig).to.include("Passphrase = #{options.wifiKey}")
wary.it 'should not trigger a stat event when configuring an intel edison',
edison: EDISON
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: 'PI:KEY:<KEY>END_PI'
spy = m.sinon.spy()
init.configure(images.edison, UUIDS.edison, options)
.then (configuration) ->
configuration.on('state', spy)
return waitStream(configuration)
.then ->
m.chai.expect(spy).to.not.have.been.called
wary.it 'should be able to initialize an intel edison with a script',
edison: EDISON
, (images) ->
options =
network: 'wifi'
wifiSsid: 'mywifissid'
wifiKey: 'PI:KEY:<KEY>END_PI'
stdout = ''
stderr = ''
resin.models.device.get(UUIDS.edison).then (device) ->
init.configure(images.edison, UUIDS.edison, options)
.then(waitStream)
.then ->
init.initialize(images.edison, 'intel-edison', options)
.then (initialization) ->
initialization.on 'stdout', (data) ->
stdout += data
initialization.on 'stderr', (data) ->
stderr += data
return waitStream(initialization)
.then ->
m.chai.expect(stdout.replace(/[\n\r]/g, '')).to.equal('Hello World')
m.chai.expect(stderr).to.equal('')
resin.auth.login
email: process.env.RESIN_E2E_USERNAME
password: PI:PASSWORD:<PASSWORD>END_PI
.then ->
console.log('Logged in')
Promise.props
raspberrypi: prepareDevice('Raspberry Pi')
edison: prepareDevice('Intel Edison')
.then (uuids) ->
UUIDS = uuids
wary.run().catch (error) ->
console.error(error, error.stack)
process.exit(1)
|
[
{
"context": "##\n * Federated Wiki : Node Server\n *\n * Copyright Ward Cunningham and other contributors\n * Licensed under the MIT ",
"end": 67,
"score": 0.9998734593391418,
"start": 52,
"tag": "NAME",
"value": "Ward Cunningham"
},
{
"context": "d under the MIT license.\n * https://github.com/fedwiki/wiki-node-server/blob/master/LICENSE.txt\n###\n# **",
"end": 155,
"score": 0.7041336894035339,
"start": 151,
"tag": "USERNAME",
"value": "wiki"
}
] | node_modules/wiki-server/lib/security.coffee | jpietrok-pnnl/wiki | 0 | ###
* Federated Wiki : Node Server
*
* Copyright Ward Cunningham and other contributors
* Licensed under the MIT license.
* https://github.com/fedwiki/wiki-node-server/blob/master/LICENSE.txt
###
# **security.coffee**
# Module for default site security.
#
# This module is not intented for use, but is here to catch a problem with
# configuration of security. It does not provide any authentication, but will
# allow the server to run read-only.
#### Requires ####
fs = require 'fs'
# Export a function that generates security handler
# when called with options object.
module.exports = exports = (log, loga, argv) ->
security={}
#### Private utility methods. ####
user = ''
owner = ''
admin = argv.admin
# save the location of the identity file
idFile = argv.id
#### Public stuff ####
security.authenticate_session = ->
(req, res, next) ->
# not possible to login, so always false
req.isAuthenticated = ->
return false
next()
# Retrieve owner infomation from identity file in status directory
security.retrieveOwner = (cb) ->
fs.exists idFile, (exists) ->
if exists
fs.readFile(idFile, (err, data) ->
if err then return cb err
owner += data
cb())
else
owner = ''
cb()
# Return the owners name
security.getOwner = ->
if !owner.name?
ownerName = ''
else
ownerName = owner.name
ownerName
security.getUser = (req) ->
return ''
security.isAuthorized = (req) ->
# nobody is authorized - everything is read-only
# unless legacy support, when unclaimed sites can be editted.
if owner == ''
if argv.security_legacy
return true
else
return false
else
return false
# Wiki server admin
security.isAdmin = ->
return false
security.defineRoutes = (app, cors, updateOwner) ->
# default security does not have any routes
security
| 73246 | ###
* Federated Wiki : Node Server
*
* Copyright <NAME> and other contributors
* Licensed under the MIT license.
* https://github.com/fedwiki/wiki-node-server/blob/master/LICENSE.txt
###
# **security.coffee**
# Module for default site security.
#
# This module is not intented for use, but is here to catch a problem with
# configuration of security. It does not provide any authentication, but will
# allow the server to run read-only.
#### Requires ####
fs = require 'fs'
# Export a function that generates security handler
# when called with options object.
module.exports = exports = (log, loga, argv) ->
security={}
#### Private utility methods. ####
user = ''
owner = ''
admin = argv.admin
# save the location of the identity file
idFile = argv.id
#### Public stuff ####
security.authenticate_session = ->
(req, res, next) ->
# not possible to login, so always false
req.isAuthenticated = ->
return false
next()
# Retrieve owner infomation from identity file in status directory
security.retrieveOwner = (cb) ->
fs.exists idFile, (exists) ->
if exists
fs.readFile(idFile, (err, data) ->
if err then return cb err
owner += data
cb())
else
owner = ''
cb()
# Return the owners name
security.getOwner = ->
if !owner.name?
ownerName = ''
else
ownerName = owner.name
ownerName
security.getUser = (req) ->
return ''
security.isAuthorized = (req) ->
# nobody is authorized - everything is read-only
# unless legacy support, when unclaimed sites can be editted.
if owner == ''
if argv.security_legacy
return true
else
return false
else
return false
# Wiki server admin
security.isAdmin = ->
return false
security.defineRoutes = (app, cors, updateOwner) ->
# default security does not have any routes
security
| true | ###
* Federated Wiki : Node Server
*
* Copyright PI:NAME:<NAME>END_PI and other contributors
* Licensed under the MIT license.
* https://github.com/fedwiki/wiki-node-server/blob/master/LICENSE.txt
###
# **security.coffee**
# Module for default site security.
#
# This module is not intented for use, but is here to catch a problem with
# configuration of security. It does not provide any authentication, but will
# allow the server to run read-only.
#### Requires ####
fs = require 'fs'
# Export a function that generates security handler
# when called with options object.
module.exports = exports = (log, loga, argv) ->
security={}
#### Private utility methods. ####
user = ''
owner = ''
admin = argv.admin
# save the location of the identity file
idFile = argv.id
#### Public stuff ####
security.authenticate_session = ->
(req, res, next) ->
# not possible to login, so always false
req.isAuthenticated = ->
return false
next()
# Retrieve owner infomation from identity file in status directory
security.retrieveOwner = (cb) ->
fs.exists idFile, (exists) ->
if exists
fs.readFile(idFile, (err, data) ->
if err then return cb err
owner += data
cb())
else
owner = ''
cb()
# Return the owners name
security.getOwner = ->
if !owner.name?
ownerName = ''
else
ownerName = owner.name
ownerName
security.getUser = (req) ->
return ''
security.isAuthorized = (req) ->
# nobody is authorized - everything is read-only
# unless legacy support, when unclaimed sites can be editted.
if owner == ''
if argv.security_legacy
return true
else
return false
else
return false
# Wiki server admin
security.isAdmin = ->
return false
security.defineRoutes = (app, cors, updateOwner) ->
# default security does not have any routes
security
|
[
{
"context": "ionMixin]\n\n bindings:\n '#curr-password-in' : 'password_params.current_password'\n '#new-password-in' : 'password_params.new_pa",
"end": 281,
"score": 0.9451252222061157,
"start": 249,
"tag": "PASSWORD",
"value": "password_params.current_password"
},
{
"context": "arams.current_password'\n '#new-password-in' : 'password_params.new_password'\n \"#password-confr-in\" : 'password_params.pass",
"end": 337,
"score": 0.9705199003219604,
"start": 309,
"tag": "PASSWORD",
"value": "password_params.new_password"
},
{
"context": "_params.new_password'\n \"#password-confr-in\" : 'password_params.password_confirmation'\n\n triggers:\n 'click #save-btn': 'profile:pas",
"end": 404,
"score": 0.9887617826461792,
"start": 367,
"tag": "PASSWORD",
"value": "password_params.password_confirmation"
}
] | app/assets/javascripts/core/apps/profile/password-view.coffee | houzelio/houzel | 2 | import ValidationMixin from 'mixins/validation'
import template from './templates/password.pug'
export default class extends Marionette.View
template: template
tagName: "div"
mixins: [ValidationMixin]
bindings:
'#curr-password-in' : 'password_params.current_password'
'#new-password-in' : 'password_params.new_password'
"#password-confr-in" : 'password_params.password_confirmation'
triggers:
'click #save-btn': 'profile:password:save'
| 198377 | import ValidationMixin from 'mixins/validation'
import template from './templates/password.pug'
export default class extends Marionette.View
template: template
tagName: "div"
mixins: [ValidationMixin]
bindings:
'#curr-password-in' : '<PASSWORD>'
'#new-password-in' : '<PASSWORD>'
"#password-confr-in" : '<PASSWORD>'
triggers:
'click #save-btn': 'profile:password:save'
| true | import ValidationMixin from 'mixins/validation'
import template from './templates/password.pug'
export default class extends Marionette.View
template: template
tagName: "div"
mixins: [ValidationMixin]
bindings:
'#curr-password-in' : 'PI:PASSWORD:<PASSWORD>END_PI'
'#new-password-in' : 'PI:PASSWORD:<PASSWORD>END_PI'
"#password-confr-in" : 'PI:PASSWORD:<PASSWORD>END_PI'
triggers:
'click #save-btn': 'profile:password:save'
|
[
{
"context": " [\n {\n id: 1\n name: 'Some Account'\n balance: 10.00\n updated_at: '",
"end": 180,
"score": 0.9873279333114624,
"start": 168,
"tag": "NAME",
"value": "Some Account"
},
{
"context": " }\n {\n id: 2\n name: 'Some Other Account'\n balance: 12.00\n updated_at: '",
"end": 363,
"score": 0.8884549736976624,
"start": 345,
"tag": "NAME",
"value": "Some Other Account"
},
{
"context": " }\n {\n id: 3\n name: 'Some Debt'\n balance: -12.00\n updated_at: ",
"end": 538,
"score": 0.9971120357513428,
"start": 529,
"tag": "NAME",
"value": "Some Debt"
}
] | spec/javascripts/dot_ledger/views/accounts/list_spec.js.coffee | timobleeker/dotledger | 0 | describe "DotLedger.Views.Accounts.List", ->
createView = ->
collection = new DotLedger.Collections.Accounts(
[
{
id: 1
name: 'Some Account'
balance: 10.00
updated_at: '2013-01-01T01:00:00Z'
unsorted_transaction_count: 0
}
{
id: 2
name: 'Some Other Account'
balance: 12.00
updated_at: '2013-01-02T01:00:00Z'
unsorted_transaction_count: 10
}
{
id: 3
name: 'Some Debt'
balance: -12.00
updated_at: '2013-01-03T01:00:00Z'
unsorted_transaction_count: 12
}
]
)
view = new DotLedger.Views.Accounts.List
collection: collection
view
it "should be defined", ->
expect(DotLedger.Views.Accounts.List).toBeDefined()
it "should use the correct template", ->
expect(DotLedger.Views.Accounts.List).toUseTemplate('accounts/list')
it "can be rendered", ->
view = createView()
expect(view.render).not.toThrow()
it "renders the account names", ->
view = createView().render()
expect(view.$el).toHaveText(/Some Account/)
expect(view.$el).toHaveText(/Some Other Account/)
expect(view.$el).toHaveText(/Some Debt/)
it "renders the account links", ->
view = createView().render()
expect(view.$el).toContainElement('a[href="/accounts/1"]')
expect(view.$el).toContainElement('a[href="/accounts/2"]')
expect(view.$el).toContainElement('a[href="/accounts/3"]')
it "renders the udated at times", ->
view = createView().render()
expect(view.$el).toContainElement('time[datetime="2013-01-01T01:00:00Z"]')
expect(view.$el).toContainElement('time[datetime="2013-01-02T01:00:00Z"]')
expect(view.$el).toContainElement('time[datetime="2013-01-03T01:00:00Z"]')
it "render the unsorted transaction counts", ->
view = createView().render()
expect(view.$el).toHaveText(/12 unsorted/)
expect(view.$el).toHaveText(/10 unsorted/)
it "renders the heading", ->
view = createView().render()
expect(view.$el).toContainText('Accounts')
it "renders the total cash", ->
view = createView().render()
expect(view.$el.text()).toContain('Total cash: $22.00')
it "renders the total debt", ->
view = createView().render()
expect(view.$el.text()).toContain('Total debt: $12.00')
it "renders the difference", ->
view = createView().render()
expect(view.$el.text()).toContain('Difference: $10.00')
| 8189 | describe "DotLedger.Views.Accounts.List", ->
createView = ->
collection = new DotLedger.Collections.Accounts(
[
{
id: 1
name: '<NAME>'
balance: 10.00
updated_at: '2013-01-01T01:00:00Z'
unsorted_transaction_count: 0
}
{
id: 2
name: '<NAME>'
balance: 12.00
updated_at: '2013-01-02T01:00:00Z'
unsorted_transaction_count: 10
}
{
id: 3
name: '<NAME>'
balance: -12.00
updated_at: '2013-01-03T01:00:00Z'
unsorted_transaction_count: 12
}
]
)
view = new DotLedger.Views.Accounts.List
collection: collection
view
it "should be defined", ->
expect(DotLedger.Views.Accounts.List).toBeDefined()
it "should use the correct template", ->
expect(DotLedger.Views.Accounts.List).toUseTemplate('accounts/list')
it "can be rendered", ->
view = createView()
expect(view.render).not.toThrow()
it "renders the account names", ->
view = createView().render()
expect(view.$el).toHaveText(/Some Account/)
expect(view.$el).toHaveText(/Some Other Account/)
expect(view.$el).toHaveText(/Some Debt/)
it "renders the account links", ->
view = createView().render()
expect(view.$el).toContainElement('a[href="/accounts/1"]')
expect(view.$el).toContainElement('a[href="/accounts/2"]')
expect(view.$el).toContainElement('a[href="/accounts/3"]')
it "renders the udated at times", ->
view = createView().render()
expect(view.$el).toContainElement('time[datetime="2013-01-01T01:00:00Z"]')
expect(view.$el).toContainElement('time[datetime="2013-01-02T01:00:00Z"]')
expect(view.$el).toContainElement('time[datetime="2013-01-03T01:00:00Z"]')
it "render the unsorted transaction counts", ->
view = createView().render()
expect(view.$el).toHaveText(/12 unsorted/)
expect(view.$el).toHaveText(/10 unsorted/)
it "renders the heading", ->
view = createView().render()
expect(view.$el).toContainText('Accounts')
it "renders the total cash", ->
view = createView().render()
expect(view.$el.text()).toContain('Total cash: $22.00')
it "renders the total debt", ->
view = createView().render()
expect(view.$el.text()).toContain('Total debt: $12.00')
it "renders the difference", ->
view = createView().render()
expect(view.$el.text()).toContain('Difference: $10.00')
| true | describe "DotLedger.Views.Accounts.List", ->
createView = ->
collection = new DotLedger.Collections.Accounts(
[
{
id: 1
name: 'PI:NAME:<NAME>END_PI'
balance: 10.00
updated_at: '2013-01-01T01:00:00Z'
unsorted_transaction_count: 0
}
{
id: 2
name: 'PI:NAME:<NAME>END_PI'
balance: 12.00
updated_at: '2013-01-02T01:00:00Z'
unsorted_transaction_count: 10
}
{
id: 3
name: 'PI:NAME:<NAME>END_PI'
balance: -12.00
updated_at: '2013-01-03T01:00:00Z'
unsorted_transaction_count: 12
}
]
)
view = new DotLedger.Views.Accounts.List
collection: collection
view
it "should be defined", ->
expect(DotLedger.Views.Accounts.List).toBeDefined()
it "should use the correct template", ->
expect(DotLedger.Views.Accounts.List).toUseTemplate('accounts/list')
it "can be rendered", ->
view = createView()
expect(view.render).not.toThrow()
it "renders the account names", ->
view = createView().render()
expect(view.$el).toHaveText(/Some Account/)
expect(view.$el).toHaveText(/Some Other Account/)
expect(view.$el).toHaveText(/Some Debt/)
it "renders the account links", ->
view = createView().render()
expect(view.$el).toContainElement('a[href="/accounts/1"]')
expect(view.$el).toContainElement('a[href="/accounts/2"]')
expect(view.$el).toContainElement('a[href="/accounts/3"]')
it "renders the udated at times", ->
view = createView().render()
expect(view.$el).toContainElement('time[datetime="2013-01-01T01:00:00Z"]')
expect(view.$el).toContainElement('time[datetime="2013-01-02T01:00:00Z"]')
expect(view.$el).toContainElement('time[datetime="2013-01-03T01:00:00Z"]')
it "render the unsorted transaction counts", ->
view = createView().render()
expect(view.$el).toHaveText(/12 unsorted/)
expect(view.$el).toHaveText(/10 unsorted/)
it "renders the heading", ->
view = createView().render()
expect(view.$el).toContainText('Accounts')
it "renders the total cash", ->
view = createView().render()
expect(view.$el.text()).toContain('Total cash: $22.00')
it "renders the total debt", ->
view = createView().render()
expect(view.$el.text()).toContain('Total debt: $12.00')
it "renders the difference", ->
view = createView().render()
expect(view.$el.text()).toContain('Difference: $10.00')
|
[
{
"context": ":\r\n selector: \"H1\"\r\n expectedText: \"Herman Melville - Moby-Dick\"\r\n @search =\r\n url: \"http://w",
"end": 163,
"score": 0.999843180179596,
"start": 148,
"tag": "NAME",
"value": "Herman Melville"
},
{
"context": "or: \"H1\"\r\n expectedText: \"Herman Melville - Moby-Dick\"\r\n @search =\r\n url: \"http://www.google.co",
"end": 175,
"score": 0.9995158910751343,
"start": 166,
"tag": "NAME",
"value": "Moby-Dick"
},
{
"context": ":\r\n selector: \"h3\"\r\n expectedText: \"Tom's ramblings | Random opinionated blurbs\"\r\n \r",
"end": 356,
"score": 0.7592976093292236,
"start": 351,
"tag": "NAME",
"value": "Tom's"
}
] | test/system.coffee | ToJans/story | 1 | class System
constructor: ->
@html =
url: "http://httpbin.org/html"
heading:
selector: "H1"
expectedText: "Herman Melville - Moby-Dick"
@search =
url: "http://www.google.com"
data:
q: "core bvba"
@searchResults =
titles:
selector: "h3"
expectedText: "Tom's ramblings | Random opinionated blurbs"
module.exports = new System()
| 120481 | class System
constructor: ->
@html =
url: "http://httpbin.org/html"
heading:
selector: "H1"
expectedText: "<NAME> - <NAME>"
@search =
url: "http://www.google.com"
data:
q: "core bvba"
@searchResults =
titles:
selector: "h3"
expectedText: "<NAME> ramblings | Random opinionated blurbs"
module.exports = new System()
| true | class System
constructor: ->
@html =
url: "http://httpbin.org/html"
heading:
selector: "H1"
expectedText: "PI:NAME:<NAME>END_PI - PI:NAME:<NAME>END_PI"
@search =
url: "http://www.google.com"
data:
q: "core bvba"
@searchResults =
titles:
selector: "h3"
expectedText: "PI:NAME:<NAME>END_PI ramblings | Random opinionated blurbs"
module.exports = new System()
|
[
{
"context": " Authorization: 'OAuth realm=\"\",' + (\"#{key}=\\\"#{utils.special_encode(val)}\\\"\" for key, val of head",
"end": 5979,
"score": 0.7422197461128235,
"start": 5977,
"tag": "KEY",
"value": "#{"
},
{
"context": " 'OAuth realm=\"\",' + (\"#{key}=\\\"#{utils.special_encode(val)}\\\"\" for key, val of headers).join ','\n 'Co",
"end": 6000,
"score": 0.7004715204238892,
"start": 5993,
"tag": "KEY",
"value": "encode("
},
{
"context": "realm=\"\",' + (\"#{key}=\\\"#{utils.special_encode(val)}\\\"\" for key, val of headers).join ','\n 'Content-Ty",
"end": 6003,
"score": 0.8504767417907715,
"start": 6003,
"tag": "KEY",
"value": ""
}
] | src/extensions/outcomes.coffee | Brightspace/ims-lti | 1 | crypto = require 'crypto'
http = require 'http'
https = require 'https'
url = require 'url'
uuid = require 'node-uuid'
xml2js = require 'xml2js'
xml_builder = require 'xmlbuilder'
errors = require '../errors'
HMAC_SHA1 = require '../hmac-sha1'
utils = require '../utils'
navigateXml = (xmlObject, path) ->
for part in path.split '.'
xmlObject = xmlObject?[part]?[0]
return xmlObject
class OutcomeDocument
constructor: (type, source_did, @outcome_service) ->
# Build and configure the document
xmldec =
version: '1.0'
encoding: 'UTF-8'
@doc = xml_builder.create 'imsx_POXEnvelopeRequest', xmldec
@doc.attribute 'xmlns', 'http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0'
@head = @doc.ele('imsx_POXHeader').ele('imsx_POXRequestHeaderInfo')
@body = @doc.ele('imsx_POXBody').ele(type + 'Request').ele('resultRecord')
# Generate a unique identifier and apply the version to the header information
@head.ele 'imsx_version', 'V1.0'
@head.ele 'imsx_messageIdentifier', uuid.v1()
# Apply the source DID to the body
@body.ele('sourcedGUID').ele('sourcedId', source_did)
add_score: (score, language) ->
if (typeof score != 'number' or score < 0 or score > 1.0)
throw new errors.ParameterError 'Score must be a floating point number >= 0 and <= 1'
eScore = @_result_ele().ele('resultScore')
eScore.ele('language', language)
eScore.ele('textString', score)
add_text: (text) ->
@_add_payload('text', text)
add_url: (url) ->
@_add_payload('url', url)
finalize: () ->
@doc.end(pretty: true)
_result_ele: () ->
@result or (@result = @body.ele('result'))
_add_payload: (type, value) ->
throw new errors.ExtensionError('Result data payload has already been set') if @has_payload
throw new errors.ExtensionError('Result data type is not supported') if !@outcome_service.supports_result_data(type)
@_result_ele().ele('resultData').ele(type, value)
@has_payload = true
class OutcomeService
REQUEST_REPLACE: 'replaceResult'
REQUEST_READ: 'readResult'
REQUEST_DELETE: 'deleteResult'
constructor: (options = {}) ->
@consumer_key = options.consumer_key
@consumer_secret = options.consumer_secret
@service_url = options.service_url
@source_did = options.source_did
@result_data_types = options.result_data_types or []
@signer = options.signer or (new HMAC_SHA1())
@cert_authority = options.cert_authority or null
@language = options.language or 'en'
# Break apart the service url into the url fragments for use by OAuth signing, additionally prepare the OAuth
# specific url that used exclusively in the signing process.
parts = @service_url_parts = url.parse @service_url, true
@service_url_oauth = parts.protocol + '//' + parts.host + parts.pathname
send_replace_result: (score, callback) ->
doc = new OutcomeDocument @REQUEST_REPLACE, @source_did, @
try
doc.add_score score, @language
@_send_request doc, callback
catch err
callback err, false
send_replace_result_with_text: (score, text, callback) ->
doc = new OutcomeDocument @REQUEST_REPLACE, @source_did, @
try
doc.add_score score, @language,
doc.add_text text
@_send_request doc, callback
catch err
callback err, false
send_replace_result_with_url: (score, url, callback) ->
doc = new OutcomeDocument @REQUEST_REPLACE, @source_did, @
try
doc.add_score score, @language,
doc.add_url url
@_send_request doc, callback
catch err
callback err, false
send_read_result: (callback) ->
doc = new OutcomeDocument @REQUEST_READ, @source_did, @
@_send_request doc, (err, result, xml) =>
return callback(err, result) if err
score = navigateXml(xml, 'imsx_POXBody.readResultResponse.result.resultScore.textString')
if (score != '')
score = parseFloat score, 10
if (score != '' && isNaN(score))
callback new errors.OutcomeResponseError('Invalid score response', 'invalidlineitemtype'), false
else
callback null, score
send_delete_result: (callback) ->
doc = new OutcomeDocument @REQUEST_DELETE, @source_did, @
@_send_request doc, callback
supports_result_data: (type) ->
return @result_data_types.length and (!type or @result_data_types.indexOf(type) != -1)
_send_request: (doc, callback) ->
xml = doc.finalize()
body = ''
is_ssl = @service_url_parts.protocol == 'https:'
options =
hostname: @service_url_parts.hostname
path: @service_url_parts.path
method: 'POST'
headers: @_build_headers xml
if @cert_authority and is_ssl
options.ca = @cert_authority
else
options.agent = if is_ssl then https.globalAgent else http.globalAgent
if @service_url_parts.port
options.port = @service_url_parts.port
# Make the request to the TC, verifying that the status code is valid and fetching the entire response body.
req = (if is_ssl then https else http).request options, (res) =>
res.setEncoding 'utf8'
res.on 'data', (chunk) => body += chunk
res.on 'end', () =>
@_process_response body, callback
req.on 'error', (err) =>
callback err, false
req.write xml
req.end()
_build_headers: (body) ->
headers =
oauth_version: '1.0'
oauth_nonce: uuid.v4()
oauth_timestamp: Math.round Date.now() / 1000
oauth_consumer_key: @consumer_key
oauth_body_hash: crypto.createHash('sha1').update(body).digest('base64')
oauth_signature_method: 'HMAC-SHA1'
headers.oauth_signature = @signer.build_signature_raw @service_url_oauth, @service_url_parts, 'POST', headers, @consumer_secret
Authorization: 'OAuth realm="",' + ("#{key}=\"#{utils.special_encode(val)}\"" for key, val of headers).join ','
'Content-Type': 'application/xml'
'Content-Length': body.length
_process_response: (body, callback) ->
xml2js.parseString body, trim: true, (err, result) =>
return callback new errors.OutcomeResponseError('The server responsed with an invalid XML document', 'invaliddata'), false if err
response = result?.imsx_POXEnvelopeResponse
code = navigateXml response, 'imsx_POXHeader.imsx_POXResponseHeaderInfo.imsx_statusInfo.imsx_codeMajor'
if code != 'success'
msg = navigateXml response, 'imsx_POXHeader.imsx_POXResponseHeaderInfo.imsx_statusInfo.imsx_description'
codeMinor = navigateXml response, 'imsx_POXHeader.imsx_POXResponseHeaderInfo.imsx_statusInfo.imsx_codeMinor'
callback new errors.OutcomeResponseError(msg, codeMinor), false
else
callback null, true, response
exports.init = (provider) ->
if (provider.body.lis_outcome_service_url and provider.body.lis_result_sourcedid)
# The LTI 1.1 spec says that the language parameter is usually implied to be en, so the OutcomeService object
# defaults to en until the spec updates and says there's other possible format options.
accepted_vals = provider.body.ext_outcome_data_values_accepted
provider.outcome_service = new OutcomeService(
consumer_key: provider.consumer_key
consumer_secret: provider.consumer_secret
service_url: provider.body.lis_outcome_service_url,
source_did: provider.body.lis_result_sourcedid,
result_data_types: accepted_vals and accepted_vals.split(',') or []
signer: provider.signer
)
else
provider.outcome_service = false
exports.OutcomeService = OutcomeService
| 125489 | crypto = require 'crypto'
http = require 'http'
https = require 'https'
url = require 'url'
uuid = require 'node-uuid'
xml2js = require 'xml2js'
xml_builder = require 'xmlbuilder'
errors = require '../errors'
HMAC_SHA1 = require '../hmac-sha1'
utils = require '../utils'
navigateXml = (xmlObject, path) ->
for part in path.split '.'
xmlObject = xmlObject?[part]?[0]
return xmlObject
class OutcomeDocument
constructor: (type, source_did, @outcome_service) ->
# Build and configure the document
xmldec =
version: '1.0'
encoding: 'UTF-8'
@doc = xml_builder.create 'imsx_POXEnvelopeRequest', xmldec
@doc.attribute 'xmlns', 'http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0'
@head = @doc.ele('imsx_POXHeader').ele('imsx_POXRequestHeaderInfo')
@body = @doc.ele('imsx_POXBody').ele(type + 'Request').ele('resultRecord')
# Generate a unique identifier and apply the version to the header information
@head.ele 'imsx_version', 'V1.0'
@head.ele 'imsx_messageIdentifier', uuid.v1()
# Apply the source DID to the body
@body.ele('sourcedGUID').ele('sourcedId', source_did)
add_score: (score, language) ->
if (typeof score != 'number' or score < 0 or score > 1.0)
throw new errors.ParameterError 'Score must be a floating point number >= 0 and <= 1'
eScore = @_result_ele().ele('resultScore')
eScore.ele('language', language)
eScore.ele('textString', score)
add_text: (text) ->
@_add_payload('text', text)
add_url: (url) ->
@_add_payload('url', url)
finalize: () ->
@doc.end(pretty: true)
_result_ele: () ->
@result or (@result = @body.ele('result'))
_add_payload: (type, value) ->
throw new errors.ExtensionError('Result data payload has already been set') if @has_payload
throw new errors.ExtensionError('Result data type is not supported') if !@outcome_service.supports_result_data(type)
@_result_ele().ele('resultData').ele(type, value)
@has_payload = true
class OutcomeService
REQUEST_REPLACE: 'replaceResult'
REQUEST_READ: 'readResult'
REQUEST_DELETE: 'deleteResult'
constructor: (options = {}) ->
@consumer_key = options.consumer_key
@consumer_secret = options.consumer_secret
@service_url = options.service_url
@source_did = options.source_did
@result_data_types = options.result_data_types or []
@signer = options.signer or (new HMAC_SHA1())
@cert_authority = options.cert_authority or null
@language = options.language or 'en'
# Break apart the service url into the url fragments for use by OAuth signing, additionally prepare the OAuth
# specific url that used exclusively in the signing process.
parts = @service_url_parts = url.parse @service_url, true
@service_url_oauth = parts.protocol + '//' + parts.host + parts.pathname
send_replace_result: (score, callback) ->
doc = new OutcomeDocument @REQUEST_REPLACE, @source_did, @
try
doc.add_score score, @language
@_send_request doc, callback
catch err
callback err, false
send_replace_result_with_text: (score, text, callback) ->
doc = new OutcomeDocument @REQUEST_REPLACE, @source_did, @
try
doc.add_score score, @language,
doc.add_text text
@_send_request doc, callback
catch err
callback err, false
send_replace_result_with_url: (score, url, callback) ->
doc = new OutcomeDocument @REQUEST_REPLACE, @source_did, @
try
doc.add_score score, @language,
doc.add_url url
@_send_request doc, callback
catch err
callback err, false
send_read_result: (callback) ->
doc = new OutcomeDocument @REQUEST_READ, @source_did, @
@_send_request doc, (err, result, xml) =>
return callback(err, result) if err
score = navigateXml(xml, 'imsx_POXBody.readResultResponse.result.resultScore.textString')
if (score != '')
score = parseFloat score, 10
if (score != '' && isNaN(score))
callback new errors.OutcomeResponseError('Invalid score response', 'invalidlineitemtype'), false
else
callback null, score
send_delete_result: (callback) ->
doc = new OutcomeDocument @REQUEST_DELETE, @source_did, @
@_send_request doc, callback
supports_result_data: (type) ->
return @result_data_types.length and (!type or @result_data_types.indexOf(type) != -1)
_send_request: (doc, callback) ->
xml = doc.finalize()
body = ''
is_ssl = @service_url_parts.protocol == 'https:'
options =
hostname: @service_url_parts.hostname
path: @service_url_parts.path
method: 'POST'
headers: @_build_headers xml
if @cert_authority and is_ssl
options.ca = @cert_authority
else
options.agent = if is_ssl then https.globalAgent else http.globalAgent
if @service_url_parts.port
options.port = @service_url_parts.port
# Make the request to the TC, verifying that the status code is valid and fetching the entire response body.
req = (if is_ssl then https else http).request options, (res) =>
res.setEncoding 'utf8'
res.on 'data', (chunk) => body += chunk
res.on 'end', () =>
@_process_response body, callback
req.on 'error', (err) =>
callback err, false
req.write xml
req.end()
_build_headers: (body) ->
headers =
oauth_version: '1.0'
oauth_nonce: uuid.v4()
oauth_timestamp: Math.round Date.now() / 1000
oauth_consumer_key: @consumer_key
oauth_body_hash: crypto.createHash('sha1').update(body).digest('base64')
oauth_signature_method: 'HMAC-SHA1'
headers.oauth_signature = @signer.build_signature_raw @service_url_oauth, @service_url_parts, 'POST', headers, @consumer_secret
Authorization: 'OAuth realm="",' + ("#{key}=\"<KEY>utils.special_<KEY>val<KEY>)}\"" for key, val of headers).join ','
'Content-Type': 'application/xml'
'Content-Length': body.length
_process_response: (body, callback) ->
xml2js.parseString body, trim: true, (err, result) =>
return callback new errors.OutcomeResponseError('The server responsed with an invalid XML document', 'invaliddata'), false if err
response = result?.imsx_POXEnvelopeResponse
code = navigateXml response, 'imsx_POXHeader.imsx_POXResponseHeaderInfo.imsx_statusInfo.imsx_codeMajor'
if code != 'success'
msg = navigateXml response, 'imsx_POXHeader.imsx_POXResponseHeaderInfo.imsx_statusInfo.imsx_description'
codeMinor = navigateXml response, 'imsx_POXHeader.imsx_POXResponseHeaderInfo.imsx_statusInfo.imsx_codeMinor'
callback new errors.OutcomeResponseError(msg, codeMinor), false
else
callback null, true, response
exports.init = (provider) ->
if (provider.body.lis_outcome_service_url and provider.body.lis_result_sourcedid)
# The LTI 1.1 spec says that the language parameter is usually implied to be en, so the OutcomeService object
# defaults to en until the spec updates and says there's other possible format options.
accepted_vals = provider.body.ext_outcome_data_values_accepted
provider.outcome_service = new OutcomeService(
consumer_key: provider.consumer_key
consumer_secret: provider.consumer_secret
service_url: provider.body.lis_outcome_service_url,
source_did: provider.body.lis_result_sourcedid,
result_data_types: accepted_vals and accepted_vals.split(',') or []
signer: provider.signer
)
else
provider.outcome_service = false
exports.OutcomeService = OutcomeService
| true | crypto = require 'crypto'
http = require 'http'
https = require 'https'
url = require 'url'
uuid = require 'node-uuid'
xml2js = require 'xml2js'
xml_builder = require 'xmlbuilder'
errors = require '../errors'
HMAC_SHA1 = require '../hmac-sha1'
utils = require '../utils'
navigateXml = (xmlObject, path) ->
for part in path.split '.'
xmlObject = xmlObject?[part]?[0]
return xmlObject
class OutcomeDocument
constructor: (type, source_did, @outcome_service) ->
# Build and configure the document
xmldec =
version: '1.0'
encoding: 'UTF-8'
@doc = xml_builder.create 'imsx_POXEnvelopeRequest', xmldec
@doc.attribute 'xmlns', 'http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0'
@head = @doc.ele('imsx_POXHeader').ele('imsx_POXRequestHeaderInfo')
@body = @doc.ele('imsx_POXBody').ele(type + 'Request').ele('resultRecord')
# Generate a unique identifier and apply the version to the header information
@head.ele 'imsx_version', 'V1.0'
@head.ele 'imsx_messageIdentifier', uuid.v1()
# Apply the source DID to the body
@body.ele('sourcedGUID').ele('sourcedId', source_did)
add_score: (score, language) ->
if (typeof score != 'number' or score < 0 or score > 1.0)
throw new errors.ParameterError 'Score must be a floating point number >= 0 and <= 1'
eScore = @_result_ele().ele('resultScore')
eScore.ele('language', language)
eScore.ele('textString', score)
add_text: (text) ->
@_add_payload('text', text)
add_url: (url) ->
@_add_payload('url', url)
finalize: () ->
@doc.end(pretty: true)
_result_ele: () ->
@result or (@result = @body.ele('result'))
_add_payload: (type, value) ->
throw new errors.ExtensionError('Result data payload has already been set') if @has_payload
throw new errors.ExtensionError('Result data type is not supported') if !@outcome_service.supports_result_data(type)
@_result_ele().ele('resultData').ele(type, value)
@has_payload = true
class OutcomeService
REQUEST_REPLACE: 'replaceResult'
REQUEST_READ: 'readResult'
REQUEST_DELETE: 'deleteResult'
constructor: (options = {}) ->
@consumer_key = options.consumer_key
@consumer_secret = options.consumer_secret
@service_url = options.service_url
@source_did = options.source_did
@result_data_types = options.result_data_types or []
@signer = options.signer or (new HMAC_SHA1())
@cert_authority = options.cert_authority or null
@language = options.language or 'en'
# Break apart the service url into the url fragments for use by OAuth signing, additionally prepare the OAuth
# specific url that used exclusively in the signing process.
parts = @service_url_parts = url.parse @service_url, true
@service_url_oauth = parts.protocol + '//' + parts.host + parts.pathname
send_replace_result: (score, callback) ->
doc = new OutcomeDocument @REQUEST_REPLACE, @source_did, @
try
doc.add_score score, @language
@_send_request doc, callback
catch err
callback err, false
send_replace_result_with_text: (score, text, callback) ->
doc = new OutcomeDocument @REQUEST_REPLACE, @source_did, @
try
doc.add_score score, @language,
doc.add_text text
@_send_request doc, callback
catch err
callback err, false
send_replace_result_with_url: (score, url, callback) ->
doc = new OutcomeDocument @REQUEST_REPLACE, @source_did, @
try
doc.add_score score, @language,
doc.add_url url
@_send_request doc, callback
catch err
callback err, false
send_read_result: (callback) ->
doc = new OutcomeDocument @REQUEST_READ, @source_did, @
@_send_request doc, (err, result, xml) =>
return callback(err, result) if err
score = navigateXml(xml, 'imsx_POXBody.readResultResponse.result.resultScore.textString')
if (score != '')
score = parseFloat score, 10
if (score != '' && isNaN(score))
callback new errors.OutcomeResponseError('Invalid score response', 'invalidlineitemtype'), false
else
callback null, score
send_delete_result: (callback) ->
doc = new OutcomeDocument @REQUEST_DELETE, @source_did, @
@_send_request doc, callback
supports_result_data: (type) ->
return @result_data_types.length and (!type or @result_data_types.indexOf(type) != -1)
_send_request: (doc, callback) ->
xml = doc.finalize()
body = ''
is_ssl = @service_url_parts.protocol == 'https:'
options =
hostname: @service_url_parts.hostname
path: @service_url_parts.path
method: 'POST'
headers: @_build_headers xml
if @cert_authority and is_ssl
options.ca = @cert_authority
else
options.agent = if is_ssl then https.globalAgent else http.globalAgent
if @service_url_parts.port
options.port = @service_url_parts.port
# Make the request to the TC, verifying that the status code is valid and fetching the entire response body.
req = (if is_ssl then https else http).request options, (res) =>
res.setEncoding 'utf8'
res.on 'data', (chunk) => body += chunk
res.on 'end', () =>
@_process_response body, callback
req.on 'error', (err) =>
callback err, false
req.write xml
req.end()
_build_headers: (body) ->
headers =
oauth_version: '1.0'
oauth_nonce: uuid.v4()
oauth_timestamp: Math.round Date.now() / 1000
oauth_consumer_key: @consumer_key
oauth_body_hash: crypto.createHash('sha1').update(body).digest('base64')
oauth_signature_method: 'HMAC-SHA1'
headers.oauth_signature = @signer.build_signature_raw @service_url_oauth, @service_url_parts, 'POST', headers, @consumer_secret
Authorization: 'OAuth realm="",' + ("#{key}=\"PI:KEY:<KEY>END_PIutils.special_PI:KEY:<KEY>END_PIvalPI:KEY:<KEY>END_PI)}\"" for key, val of headers).join ','
'Content-Type': 'application/xml'
'Content-Length': body.length
_process_response: (body, callback) ->
xml2js.parseString body, trim: true, (err, result) =>
return callback new errors.OutcomeResponseError('The server responsed with an invalid XML document', 'invaliddata'), false if err
response = result?.imsx_POXEnvelopeResponse
code = navigateXml response, 'imsx_POXHeader.imsx_POXResponseHeaderInfo.imsx_statusInfo.imsx_codeMajor'
if code != 'success'
msg = navigateXml response, 'imsx_POXHeader.imsx_POXResponseHeaderInfo.imsx_statusInfo.imsx_description'
codeMinor = navigateXml response, 'imsx_POXHeader.imsx_POXResponseHeaderInfo.imsx_statusInfo.imsx_codeMinor'
callback new errors.OutcomeResponseError(msg, codeMinor), false
else
callback null, true, response
exports.init = (provider) ->
if (provider.body.lis_outcome_service_url and provider.body.lis_result_sourcedid)
# The LTI 1.1 spec says that the language parameter is usually implied to be en, so the OutcomeService object
# defaults to en until the spec updates and says there's other possible format options.
accepted_vals = provider.body.ext_outcome_data_values_accepted
provider.outcome_service = new OutcomeService(
consumer_key: provider.consumer_key
consumer_secret: provider.consumer_secret
service_url: provider.body.lis_outcome_service_url,
source_did: provider.body.lis_result_sourcedid,
result_data_types: accepted_vals and accepted_vals.split(',') or []
signer: provider.signer
)
else
provider.outcome_service = false
exports.OutcomeService = OutcomeService
|
[
{
"context": "ame = 'test1'\n @credsUrl = 'http://admin:athena@127.0.0.1:5984' # Admin host to couchdb\n @couc",
"end": 419,
"score": 0.7599099278450012,
"start": 413,
"tag": "USERNAME",
"value": "athena"
},
{
"context": " = 'test1'\n @credsUrl = 'http://admin:athena@127.0.0.1:5984' # Admin host to couchdb\n @couchUrl = '",
"end": 429,
"score": 0.9997181296348572,
"start": 420,
"tag": "IP_ADDRESS",
"value": "127.0.0.1"
},
{
"context": "# Admin host to couchdb\n @couchUrl = 'http://127.0.0.1:5984' # Admin host to couchdb\n @s",
"end": 495,
"score": 0.9995558261871338,
"start": 486,
"tag": "IP_ADDRESS",
"value": "127.0.0.1"
},
{
"context": ".data( 'Hues' )\n # console.log( 'Manager.data(@Pracs)', @nav, @Hues )\n\n @Kit = { \"_id\":\"mittens\", \"",
"end": 3577,
"score": 0.9971530437469482,
"start": 3572,
"tag": "USERNAME",
"value": "Pracs"
},
{
"context": "data(@Pracs)', @nav, @Hues )\n\n @Kit = { \"_id\":\"mittens\", \"name\": \"Mittens\", \"occupation\": \"kitten\", \"age",
"end": 3623,
"score": 0.881885290145874,
"start": 3616,
"tag": "USERNAME",
"value": "mittens"
},
{
"context": ", @Hues )\n\n @Kit = { \"_id\":\"mittens\", \"name\": \"Mittens\", \"occupation\": \"kitten\", \"age\": 3,\n \"hobbies\"",
"end": 3642,
"score": 0.9996585845947266,
"start": 3635,
"tag": "NAME",
"value": "Mittens"
}
] | src/data/store/Manager.coffee | axiom6/aug | 0 |
import Memory from '../../../lib/pub/data/Memory.js'
import Local from '../../../lib/pub/data/Local.js'
import Index from '../../../lib/pub/data/Index.js'
import Fire from '../../../lib/pub/data/Fire.js'
#mport Couch from '../../../lib/pub/data/Couch.js'
#mport Mongo from '../../../lib/pub/data/Mongo.js'
class Manager
constructor:( @nav ) ->
@dbName = 'test1'
@credsUrl = 'http://admin:athena@127.0.0.1:5984' # Admin host to couchdb
@couchUrl = 'http://127.0.0.1:5984' # Admin host to couchdb
@stream = @nav.stream
@Prac = null
@Hues = null
@Kit = null
@source = null
test:( name ) ->
@store = switch name
when 'Local' then new Local( @stream, @dbName )
when 'Index' then new Index( @stream, @dbName )
when 'Fire' then new Fire( @stream, @dbName )
when 'Couch' then new Memory( @stream, @dbName, @couchUrl )
when 'Memory' then new Memory( @stream, @dbName )
when 'Mongo' then new Memory( @stream, @dbName )
else
console.error( 'Manager.test() unknown name', name )
null
@source = @store.source
@store.openTable( 'Prac')
@store.openTable( 'Hues')
@openIndex( @store ) if name is 'Index'
@suite() if name isnt 'Index'
return
openIndex:( idb ) ->
idb.openDB( idb.dbName, idb.dbVersion )
.then( (db) =>
idb.db = db
@suite( idb )
return )
.catch( (error) =>
idb.onerror( idb.tables, 'openDB', error )
return )
return
subscribe:( table, op ) =>
onSubscribe = ( obj ) =>
console.log( 'Mgr', { table:table, op:op, source:@source, obj:obj } )
whereS = (obj) -> true
whereD = (obj) -> obj.column is 'Embrace'
switch op
when 'add' then @store.get( table, obj.id )
when 'put' then @store.del( table, obj.id )
when 'insert' then @store.select( table, whereS )
when 'update' then @store.remove( table, whereD )
@store.subscribe( table, op, @store.source, onSubscribe )
return
suite:() ->
console.log( 'Manager.suite()', @store.source )
@data()
@subscribe( 'Prac', 'add' )
@subscribe( 'Prac', 'get' )
@subscribe( 'Prac', 'put' )
@subscribe( 'Prac', 'del' )
@subscribe( 'Hues', 'insert' )
@subscribe( 'Hues', 'select' )
@subscribe( 'Hues', 'update' )
@subscribe( 'Hues', 'remove' )
@subscribe( 'Tables', 'show' )
@subscribe( 'Prac', 'open' )
@subscribe( 'Prac', 'drop' )
@store.show()
@store.add( 'Prac', @Prac.id, @Prac )
#tore.get( 'Prac', @Prac.id ) # Called after add
@store.put( 'Prac', @Prac.id, @Prac )
#tore.del( 'Prac', @Prac.id ) # Called after put
@store.insert( 'Hues', @Hues )
#tore.select( 'Hues', (obj) -> true ) # Called after insert
@Hues['Green'].column = 'Embrace'
@Hues['Orange'].column = 'Embrace'
@Hues['Violet'].column = 'Embrace'
@store.update( 'Hues', @Hues )
#here = (obj) -> obj.column is 'Embrace' # Called after update
#tore.remove( 'Hues', where )
#console.log( "Manager.test()", { subjects:@store.stream.subjects } )
return
data:() ->
@Prac = { "_id":"Involve", "id":"Involve", "table":"prac","type":"pane", "hsv":[195,90,60],"column":"Embrace",
"row":"Learn","plane":"Know","icon":"fas fa-users",
"cells":[5,12,7,12], "dir":"nw", "neg":"Greed" }
@Hues = @nav.data( 'Hues' )
# console.log( 'Manager.data(@Pracs)', @nav, @Hues )
@Kit = { "_id":"mittens", "name": "Mittens", "occupation": "kitten", "age": 3,
"hobbies": [ "playing with balls of yarn", "chasing laser pointers", "lookin' hella cute" ] }
export default Manager | 216930 |
import Memory from '../../../lib/pub/data/Memory.js'
import Local from '../../../lib/pub/data/Local.js'
import Index from '../../../lib/pub/data/Index.js'
import Fire from '../../../lib/pub/data/Fire.js'
#mport Couch from '../../../lib/pub/data/Couch.js'
#mport Mongo from '../../../lib/pub/data/Mongo.js'
class Manager
constructor:( @nav ) ->
@dbName = 'test1'
@credsUrl = 'http://admin:athena@127.0.0.1:5984' # Admin host to couchdb
@couchUrl = 'http://127.0.0.1:5984' # Admin host to couchdb
@stream = @nav.stream
@Prac = null
@Hues = null
@Kit = null
@source = null
test:( name ) ->
@store = switch name
when 'Local' then new Local( @stream, @dbName )
when 'Index' then new Index( @stream, @dbName )
when 'Fire' then new Fire( @stream, @dbName )
when 'Couch' then new Memory( @stream, @dbName, @couchUrl )
when 'Memory' then new Memory( @stream, @dbName )
when 'Mongo' then new Memory( @stream, @dbName )
else
console.error( 'Manager.test() unknown name', name )
null
@source = @store.source
@store.openTable( 'Prac')
@store.openTable( 'Hues')
@openIndex( @store ) if name is 'Index'
@suite() if name isnt 'Index'
return
openIndex:( idb ) ->
idb.openDB( idb.dbName, idb.dbVersion )
.then( (db) =>
idb.db = db
@suite( idb )
return )
.catch( (error) =>
idb.onerror( idb.tables, 'openDB', error )
return )
return
subscribe:( table, op ) =>
onSubscribe = ( obj ) =>
console.log( 'Mgr', { table:table, op:op, source:@source, obj:obj } )
whereS = (obj) -> true
whereD = (obj) -> obj.column is 'Embrace'
switch op
when 'add' then @store.get( table, obj.id )
when 'put' then @store.del( table, obj.id )
when 'insert' then @store.select( table, whereS )
when 'update' then @store.remove( table, whereD )
@store.subscribe( table, op, @store.source, onSubscribe )
return
suite:() ->
console.log( 'Manager.suite()', @store.source )
@data()
@subscribe( 'Prac', 'add' )
@subscribe( 'Prac', 'get' )
@subscribe( 'Prac', 'put' )
@subscribe( 'Prac', 'del' )
@subscribe( 'Hues', 'insert' )
@subscribe( 'Hues', 'select' )
@subscribe( 'Hues', 'update' )
@subscribe( 'Hues', 'remove' )
@subscribe( 'Tables', 'show' )
@subscribe( 'Prac', 'open' )
@subscribe( 'Prac', 'drop' )
@store.show()
@store.add( 'Prac', @Prac.id, @Prac )
#tore.get( 'Prac', @Prac.id ) # Called after add
@store.put( 'Prac', @Prac.id, @Prac )
#tore.del( 'Prac', @Prac.id ) # Called after put
@store.insert( 'Hues', @Hues )
#tore.select( 'Hues', (obj) -> true ) # Called after insert
@Hues['Green'].column = 'Embrace'
@Hues['Orange'].column = 'Embrace'
@Hues['Violet'].column = 'Embrace'
@store.update( 'Hues', @Hues )
#here = (obj) -> obj.column is 'Embrace' # Called after update
#tore.remove( 'Hues', where )
#console.log( "Manager.test()", { subjects:@store.stream.subjects } )
return
data:() ->
@Prac = { "_id":"Involve", "id":"Involve", "table":"prac","type":"pane", "hsv":[195,90,60],"column":"Embrace",
"row":"Learn","plane":"Know","icon":"fas fa-users",
"cells":[5,12,7,12], "dir":"nw", "neg":"Greed" }
@Hues = @nav.data( 'Hues' )
# console.log( 'Manager.data(@Pracs)', @nav, @Hues )
@Kit = { "_id":"mittens", "name": "<NAME>", "occupation": "kitten", "age": 3,
"hobbies": [ "playing with balls of yarn", "chasing laser pointers", "lookin' hella cute" ] }
export default Manager | true |
import Memory from '../../../lib/pub/data/Memory.js'
import Local from '../../../lib/pub/data/Local.js'
import Index from '../../../lib/pub/data/Index.js'
import Fire from '../../../lib/pub/data/Fire.js'
#mport Couch from '../../../lib/pub/data/Couch.js'
#mport Mongo from '../../../lib/pub/data/Mongo.js'
class Manager
constructor:( @nav ) ->
@dbName = 'test1'
@credsUrl = 'http://admin:athena@127.0.0.1:5984' # Admin host to couchdb
@couchUrl = 'http://127.0.0.1:5984' # Admin host to couchdb
@stream = @nav.stream
@Prac = null
@Hues = null
@Kit = null
@source = null
test:( name ) ->
@store = switch name
when 'Local' then new Local( @stream, @dbName )
when 'Index' then new Index( @stream, @dbName )
when 'Fire' then new Fire( @stream, @dbName )
when 'Couch' then new Memory( @stream, @dbName, @couchUrl )
when 'Memory' then new Memory( @stream, @dbName )
when 'Mongo' then new Memory( @stream, @dbName )
else
console.error( 'Manager.test() unknown name', name )
null
@source = @store.source
@store.openTable( 'Prac')
@store.openTable( 'Hues')
@openIndex( @store ) if name is 'Index'
@suite() if name isnt 'Index'
return
openIndex:( idb ) ->
idb.openDB( idb.dbName, idb.dbVersion )
.then( (db) =>
idb.db = db
@suite( idb )
return )
.catch( (error) =>
idb.onerror( idb.tables, 'openDB', error )
return )
return
subscribe:( table, op ) =>
onSubscribe = ( obj ) =>
console.log( 'Mgr', { table:table, op:op, source:@source, obj:obj } )
whereS = (obj) -> true
whereD = (obj) -> obj.column is 'Embrace'
switch op
when 'add' then @store.get( table, obj.id )
when 'put' then @store.del( table, obj.id )
when 'insert' then @store.select( table, whereS )
when 'update' then @store.remove( table, whereD )
@store.subscribe( table, op, @store.source, onSubscribe )
return
suite:() ->
console.log( 'Manager.suite()', @store.source )
@data()
@subscribe( 'Prac', 'add' )
@subscribe( 'Prac', 'get' )
@subscribe( 'Prac', 'put' )
@subscribe( 'Prac', 'del' )
@subscribe( 'Hues', 'insert' )
@subscribe( 'Hues', 'select' )
@subscribe( 'Hues', 'update' )
@subscribe( 'Hues', 'remove' )
@subscribe( 'Tables', 'show' )
@subscribe( 'Prac', 'open' )
@subscribe( 'Prac', 'drop' )
@store.show()
@store.add( 'Prac', @Prac.id, @Prac )
#tore.get( 'Prac', @Prac.id ) # Called after add
@store.put( 'Prac', @Prac.id, @Prac )
#tore.del( 'Prac', @Prac.id ) # Called after put
@store.insert( 'Hues', @Hues )
#tore.select( 'Hues', (obj) -> true ) # Called after insert
@Hues['Green'].column = 'Embrace'
@Hues['Orange'].column = 'Embrace'
@Hues['Violet'].column = 'Embrace'
@store.update( 'Hues', @Hues )
#here = (obj) -> obj.column is 'Embrace' # Called after update
#tore.remove( 'Hues', where )
#console.log( "Manager.test()", { subjects:@store.stream.subjects } )
return
data:() ->
@Prac = { "_id":"Involve", "id":"Involve", "table":"prac","type":"pane", "hsv":[195,90,60],"column":"Embrace",
"row":"Learn","plane":"Know","icon":"fas fa-users",
"cells":[5,12,7,12], "dir":"nw", "neg":"Greed" }
@Hues = @nav.data( 'Hues' )
# console.log( 'Manager.data(@Pracs)', @nav, @Hues )
@Kit = { "_id":"mittens", "name": "PI:NAME:<NAME>END_PI", "occupation": "kitten", "age": 3,
"hobbies": [ "playing with balls of yarn", "chasing laser pointers", "lookin' hella cute" ] }
export default Manager |
[
{
"context": "obal-ignore-lastIndex\", stringSample2, re, [\n \"Argle\"\n \"bargle\"\n \"glop\"\n \"glyf\"\n], [], 18, 22\n\n# Ca",
"end": 4266,
"score": 0.5690932869911194,
"start": 4263,
"tag": "NAME",
"value": "gle"
}
] | deps/v8/test/mjsunit/string-match.coffee | lxe/io.coffee | 0 | # Copyright 2009 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.
###*
@fileoverview Test String.prototype.match
###
testMatch = (name, input, regexp, result, captures, from, to) ->
matchResult = input.match(regexp)
assertEquals result, matchResult, name + "-match"
match = input.substring(from, to)
preMatch = input.substring(0, from)
postMatch = input.substring(to)
lastParen = (if captures.length > 0 then captures[captures.length - 1] else "")
if regexp.global
# Returns array of matched strings.
lastMatch = matchResult[matchResult.length - 1]
assertEquals match, lastMatch, name + "-match-string_g"
else
# Returns array of match and captures.
assertEquals match, matchResult[0], name + "-match-string"
assertEquals captures.length + 1, matchResult.length, name + "-cap-return"
i = 1
while i < matchResult.length
assertEquals captures[i - 1], matchResult[i], name + "-cap-return-" + i
i++
assertEquals match, RegExp["$&"], name + "-$&"
assertEquals match, RegExp.lastMatch, name + "-lastMatch"
assertEquals `undefined`, RegExp.$0, name + "-nocapture-10"
i = 1
while i <= 9
if i <= captures.length
assertEquals captures[i - 1], RegExp["$" + i], name + "-capture-" + i
else
assertEquals "", RegExp["$" + i], name + "-nocapture-" + i
i++
assertEquals `undefined`, RegExp.$10, name + "-nocapture-10"
assertEquals input, RegExp.input, name + "-input"
assertEquals input, RegExp.$_, name + "-$_"
assertEquals preMatch, RegExp["$`"], name + "-$`"
assertEquals preMatch, RegExp.leftContext, name + "-leftContex"
assertEquals postMatch, RegExp["$'"], name + "-$'"
assertEquals postMatch, RegExp.rightContext, name + "-rightContex"
assertEquals lastParen, RegExp["$+"], name + "-$+"
assertEquals lastParen, RegExp.lastParen, name + "-lastParen"
return
stringSample = "A man, a plan, a canal: Panama"
stringSample2 = "Argle bargle glop glyf!"
stringSample3 = "abcdefghijxxxxxxxxxx"
# Non-capturing, non-global regexp.
re_nog = /\w+/
testMatch "Nonglobal", stringSample, re_nog, ["A"], [], 0, 1
re_nog.lastIndex = 2
testMatch "Nonglobal-ignore-lastIndex", stringSample, re_nog, ["A"], [], 0, 1
# Capturing non-global regexp.
re_multicap = /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)/
testMatch "Capture-Nonglobal", stringSample3, re_multicap, [
"abcdefghij"
"a"
"b"
"c"
"d"
"e"
"f"
"g"
"h"
"i"
"j"
], [
"a"
"b"
"c"
"d"
"e"
"f"
"g"
"h"
"i"
"j"
], 0, 10
# Global regexp (also check that capture from before are cleared)
re = /\w+/g
testMatch "Global", stringSample2, re, [
"Argle"
"bargle"
"glop"
"glyf"
], [], 18, 22
re.lastIndex = 10
testMatch "Global-ignore-lastIndex", stringSample2, re, [
"Argle"
"bargle"
"glop"
"glyf"
], [], 18, 22
# Capturing global regexp
re_cap = /\w(\w*)/g
testMatch "Capture-Global", stringSample, re_cap, [
"A"
"man"
"a"
"plan"
"a"
"canal"
"Panama"
], ["anama"], 24, 30
# Atom, non-global
re_atom = /an/
testMatch "Atom", stringSample, re_atom, ["an"], [], 3, 5
# Atom, global
re_atomg = /an/g
testMatch "Global-Atom", stringSample, re_atomg, [
"an"
"an"
"an"
"an"
], [], 25, 27
| 113787 | # Copyright 2009 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.
###*
@fileoverview Test String.prototype.match
###
testMatch = (name, input, regexp, result, captures, from, to) ->
matchResult = input.match(regexp)
assertEquals result, matchResult, name + "-match"
match = input.substring(from, to)
preMatch = input.substring(0, from)
postMatch = input.substring(to)
lastParen = (if captures.length > 0 then captures[captures.length - 1] else "")
if regexp.global
# Returns array of matched strings.
lastMatch = matchResult[matchResult.length - 1]
assertEquals match, lastMatch, name + "-match-string_g"
else
# Returns array of match and captures.
assertEquals match, matchResult[0], name + "-match-string"
assertEquals captures.length + 1, matchResult.length, name + "-cap-return"
i = 1
while i < matchResult.length
assertEquals captures[i - 1], matchResult[i], name + "-cap-return-" + i
i++
assertEquals match, RegExp["$&"], name + "-$&"
assertEquals match, RegExp.lastMatch, name + "-lastMatch"
assertEquals `undefined`, RegExp.$0, name + "-nocapture-10"
i = 1
while i <= 9
if i <= captures.length
assertEquals captures[i - 1], RegExp["$" + i], name + "-capture-" + i
else
assertEquals "", RegExp["$" + i], name + "-nocapture-" + i
i++
assertEquals `undefined`, RegExp.$10, name + "-nocapture-10"
assertEquals input, RegExp.input, name + "-input"
assertEquals input, RegExp.$_, name + "-$_"
assertEquals preMatch, RegExp["$`"], name + "-$`"
assertEquals preMatch, RegExp.leftContext, name + "-leftContex"
assertEquals postMatch, RegExp["$'"], name + "-$'"
assertEquals postMatch, RegExp.rightContext, name + "-rightContex"
assertEquals lastParen, RegExp["$+"], name + "-$+"
assertEquals lastParen, RegExp.lastParen, name + "-lastParen"
return
stringSample = "A man, a plan, a canal: Panama"
stringSample2 = "Argle bargle glop glyf!"
stringSample3 = "abcdefghijxxxxxxxxxx"
# Non-capturing, non-global regexp.
re_nog = /\w+/
testMatch "Nonglobal", stringSample, re_nog, ["A"], [], 0, 1
re_nog.lastIndex = 2
testMatch "Nonglobal-ignore-lastIndex", stringSample, re_nog, ["A"], [], 0, 1
# Capturing non-global regexp.
re_multicap = /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)/
testMatch "Capture-Nonglobal", stringSample3, re_multicap, [
"abcdefghij"
"a"
"b"
"c"
"d"
"e"
"f"
"g"
"h"
"i"
"j"
], [
"a"
"b"
"c"
"d"
"e"
"f"
"g"
"h"
"i"
"j"
], 0, 10
# Global regexp (also check that capture from before are cleared)
re = /\w+/g
testMatch "Global", stringSample2, re, [
"Argle"
"bargle"
"glop"
"glyf"
], [], 18, 22
re.lastIndex = 10
testMatch "Global-ignore-lastIndex", stringSample2, re, [
"Ar<NAME>"
"bargle"
"glop"
"glyf"
], [], 18, 22
# Capturing global regexp
re_cap = /\w(\w*)/g
testMatch "Capture-Global", stringSample, re_cap, [
"A"
"man"
"a"
"plan"
"a"
"canal"
"Panama"
], ["anama"], 24, 30
# Atom, non-global
re_atom = /an/
testMatch "Atom", stringSample, re_atom, ["an"], [], 3, 5
# Atom, global
re_atomg = /an/g
testMatch "Global-Atom", stringSample, re_atomg, [
"an"
"an"
"an"
"an"
], [], 25, 27
| true | # Copyright 2009 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.
###*
@fileoverview Test String.prototype.match
###
testMatch = (name, input, regexp, result, captures, from, to) ->
matchResult = input.match(regexp)
assertEquals result, matchResult, name + "-match"
match = input.substring(from, to)
preMatch = input.substring(0, from)
postMatch = input.substring(to)
lastParen = (if captures.length > 0 then captures[captures.length - 1] else "")
if regexp.global
# Returns array of matched strings.
lastMatch = matchResult[matchResult.length - 1]
assertEquals match, lastMatch, name + "-match-string_g"
else
# Returns array of match and captures.
assertEquals match, matchResult[0], name + "-match-string"
assertEquals captures.length + 1, matchResult.length, name + "-cap-return"
i = 1
while i < matchResult.length
assertEquals captures[i - 1], matchResult[i], name + "-cap-return-" + i
i++
assertEquals match, RegExp["$&"], name + "-$&"
assertEquals match, RegExp.lastMatch, name + "-lastMatch"
assertEquals `undefined`, RegExp.$0, name + "-nocapture-10"
i = 1
while i <= 9
if i <= captures.length
assertEquals captures[i - 1], RegExp["$" + i], name + "-capture-" + i
else
assertEquals "", RegExp["$" + i], name + "-nocapture-" + i
i++
assertEquals `undefined`, RegExp.$10, name + "-nocapture-10"
assertEquals input, RegExp.input, name + "-input"
assertEquals input, RegExp.$_, name + "-$_"
assertEquals preMatch, RegExp["$`"], name + "-$`"
assertEquals preMatch, RegExp.leftContext, name + "-leftContex"
assertEquals postMatch, RegExp["$'"], name + "-$'"
assertEquals postMatch, RegExp.rightContext, name + "-rightContex"
assertEquals lastParen, RegExp["$+"], name + "-$+"
assertEquals lastParen, RegExp.lastParen, name + "-lastParen"
return
stringSample = "A man, a plan, a canal: Panama"
stringSample2 = "Argle bargle glop glyf!"
stringSample3 = "abcdefghijxxxxxxxxxx"
# Non-capturing, non-global regexp.
re_nog = /\w+/
testMatch "Nonglobal", stringSample, re_nog, ["A"], [], 0, 1
re_nog.lastIndex = 2
testMatch "Nonglobal-ignore-lastIndex", stringSample, re_nog, ["A"], [], 0, 1
# Capturing non-global regexp.
re_multicap = /(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)/
testMatch "Capture-Nonglobal", stringSample3, re_multicap, [
"abcdefghij"
"a"
"b"
"c"
"d"
"e"
"f"
"g"
"h"
"i"
"j"
], [
"a"
"b"
"c"
"d"
"e"
"f"
"g"
"h"
"i"
"j"
], 0, 10
# Global regexp (also check that capture from before are cleared)
re = /\w+/g
testMatch "Global", stringSample2, re, [
"Argle"
"bargle"
"glop"
"glyf"
], [], 18, 22
re.lastIndex = 10
testMatch "Global-ignore-lastIndex", stringSample2, re, [
"ArPI:NAME:<NAME>END_PI"
"bargle"
"glop"
"glyf"
], [], 18, 22
# Capturing global regexp
re_cap = /\w(\w*)/g
testMatch "Capture-Global", stringSample, re_cap, [
"A"
"man"
"a"
"plan"
"a"
"canal"
"Panama"
], ["anama"], 24, 30
# Atom, non-global
re_atom = /an/
testMatch "Atom", stringSample, re_atom, ["an"], [], 3, 5
# Atom, global
re_atomg = /an/g
testMatch "Global-Atom", stringSample, re_atomg, [
"an"
"an"
"an"
"an"
], [], 25, 27
|
[
{
"context": "# Copyright (C) 2011 by Florian Mayer <florian.mayer@bitsrc.org>\n#\n# Permission is here",
"end": 37,
"score": 0.9998602867126465,
"start": 24,
"tag": "NAME",
"value": "Florian Mayer"
},
{
"context": "# Copyright (C) 2011 by Florian Mayer <florian.mayer@bitsrc.org>\n#\n# Permission is hereby granted, free of charge",
"end": 63,
"score": 0.9999319314956665,
"start": 39,
"tag": "EMAIL",
"value": "florian.mayer@bitsrc.org"
}
] | utils/utils.coffee | segfaulthunter/life | 2 | # Copyright (C) 2011 by Florian Mayer <florian.mayer@bitsrc.org>
#
# 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.
define(['utils/underscore.string']
->
sum = (arr, init=0) ->
for elem in arr
init += elem
init
max = (x, y) -> if x > y then x else y
min = (x, y) -> if x < y then x else y
mod = (x, y) -> if (m = x % y) < 0 then m + y else m
rem = (x, y) -> x % y
parseGet = (search) ->
ret = {}
for v in _.words(search[1...], '&')
[k, v] = _.words(v, '=')
ret[k] = v
ret
return {sum: sum, min: min, max: max, mod: mod, rem: rem, parseGet: parseGet}
)
| 152354 | # Copyright (C) 2011 by <NAME> <<EMAIL>>
#
# 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.
define(['utils/underscore.string']
->
sum = (arr, init=0) ->
for elem in arr
init += elem
init
max = (x, y) -> if x > y then x else y
min = (x, y) -> if x < y then x else y
mod = (x, y) -> if (m = x % y) < 0 then m + y else m
rem = (x, y) -> x % y
parseGet = (search) ->
ret = {}
for v in _.words(search[1...], '&')
[k, v] = _.words(v, '=')
ret[k] = v
ret
return {sum: sum, min: min, max: max, mod: mod, rem: rem, parseGet: parseGet}
)
| true | # Copyright (C) 2011 by PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>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.
define(['utils/underscore.string']
->
sum = (arr, init=0) ->
for elem in arr
init += elem
init
max = (x, y) -> if x > y then x else y
min = (x, y) -> if x < y then x else y
mod = (x, y) -> if (m = x % y) < 0 then m + y else m
rem = (x, y) -> x % y
parseGet = (search) ->
ret = {}
for v in _.words(search[1...], '&')
[k, v] = _.words(v, '=')
ret[k] = v
ret
return {sum: sum, min: min, max: max, mod: mod, rem: rem, parseGet: parseGet}
)
|
[
{
"context": " <input type=\"text\" name=\"user[name]\" value=\"John Doe\" />\n <input type=\"text\" name=\"user[email]\"",
"end": 254,
"score": 0.999815821647644,
"start": 246,
"tag": "NAME",
"value": "John Doe"
},
{
"context": " <input type=\"text\" name=\"user[email]\" value=\"john@email.com\" />\n <input type=\"checkbox\" name=\"user[new",
"end": 326,
"score": 0.9999275207519531,
"start": 312,
"tag": "EMAIL",
"value": "john@email.com"
},
{
"context": " value = @serializer._serializeField('email', 'test@email.com')\n expect(value).to.eql(email: 'test@email",
"end": 1655,
"score": 0.9999279975891113,
"start": 1641,
"tag": "EMAIL",
"value": "test@email.com"
},
{
"context": "@email.com')\n expect(value).to.eql(email: 'test@email.com')\n\n context 'if the name is an array field nam",
"end": 1709,
"score": 0.9999265670776367,
"start": 1695,
"tag": "EMAIL",
"value": "test@email.com"
},
{
"context": " value = @serializer._serializeField('emails[]', 'test@email.com')\n expect(value).to.have.key('emails')\n\n",
"end": 1916,
"score": 0.9999278783798218,
"start": 1902,
"tag": "EMAIL",
"value": "test@email.com"
},
{
"context": " value = @serializer._serializeField('emails[]', 'test@email.com')\n expect(value).to.eql(emails: ['test@ema",
"end": 2075,
"score": 0.9999251365661621,
"start": 2061,
"tag": "EMAIL",
"value": "test@email.com"
},
{
"context": "mail.com')\n expect(value).to.eql(emails: ['test@email.com'])\n\n it 'should merge consecutive calls to t",
"end": 2131,
"score": 0.9999247789382935,
"start": 2117,
"tag": "EMAIL",
"value": "test@email.com"
},
{
"context": "\n @serializer._serializeField('emails[]', 'test1@email.com')\n value = @serializer._serializeField('em",
"end": 2270,
"score": 0.9999246001243591,
"start": 2255,
"tag": "EMAIL",
"value": "test1@email.com"
},
{
"context": " value = @serializer._serializeField('emails[]', 'test2@email.com')\n expect(value).to.eql(emails: ['test1@em",
"end": 2345,
"score": 0.9999225735664368,
"start": 2330,
"tag": "EMAIL",
"value": "test2@email.com"
},
{
"context": "mail.com')\n expect(value).to.eql(emails: ['test1@email.com', 'test2@email.com'])\n\n context 'if the name i",
"end": 2402,
"score": 0.9999246001243591,
"start": 2387,
"tag": "EMAIL",
"value": "test1@email.com"
},
{
"context": "expect(value).to.eql(emails: ['test1@email.com', 'test2@email.com'])\n\n context 'if the name is a named array fie",
"end": 2421,
"score": 0.9999217391014099,
"start": 2406,
"tag": "EMAIL",
"value": "test2@email.com"
},
{
"context": "ue = @serializer._serializeField('emails[john]', 'john@email.com')\n expect(value).to.have.key('emails')\n\n",
"end": 2638,
"score": 0.9999198913574219,
"start": 2624,
"tag": "EMAIL",
"value": "john@email.com"
},
{
"context": "ue = @serializer._serializeField('emails[john]', 'john@email.com')\n expect(value).to.eql\n emails:\n",
"end": 2806,
"score": 0.9999136924743652,
"start": 2792,
"tag": "EMAIL",
"value": "john@email.com"
},
{
"context": "alue).to.eql\n emails:\n john: 'john@email.com'\n\n it 'should handle nested attributes', ->\n",
"end": 2889,
"score": 0.9999161958694458,
"start": 2875,
"tag": "EMAIL",
"value": "john@email.com"
},
{
"context": "ializer._serializeField('emails[john][current]', 'john@email.com')\n expect(value).to.eql\n emails:\n",
"end": 3023,
"score": 0.9999183416366577,
"start": 3009,
"tag": "EMAIL",
"value": "john@email.com"
},
{
"context": "emails:\n john:\n current: 'john@email.com'\n\n describe '._getSubmittableFieldValues(options",
"end": 3129,
"score": 0.9999176263809204,
"start": 3115,
"tag": "EMAIL",
"value": "john@email.com"
},
{
"context": "e: \"ABC\" },\n { name: \"user[name]\", value: \"John Doe\" },\n { name: \"user[email]\", value: \"john@e",
"end": 3523,
"score": 0.9997457265853882,
"start": 3515,
"tag": "NAME",
"value": "John Doe"
},
{
"context": "hn Doe\" },\n { name: \"user[email]\", value: \"john@email.com\" },\n { name: \"user[newsletter]\", value: tr",
"end": 3581,
"score": 0.9999241828918457,
"start": 3567,
"tag": "EMAIL",
"value": "john@email.com"
},
{
"context": " token: 'ABC'\n user:\n name: \"John Doe\"\n email: \"john@email.com\"\n news",
"end": 6422,
"score": 0.9997765421867371,
"start": 6414,
"tag": "NAME",
"value": "John Doe"
},
{
"context": "ser:\n name: \"John Doe\"\n email: \"john@email.com\"\n newsletter: true\n country: \"C",
"end": 6456,
"score": 0.9999265670776367,
"start": 6442,
"tag": "EMAIL",
"value": "john@email.com"
}
] | specs/test/serializer_spec.coffee | avarest/jquery.form.serializer | 1 |
describe '$._jQueryFormSerializer.Serializer', ->
beforeEach ->
@sandbox = sinon.sandbox.create()
@$form = $ """
<form>
<input type="hidden" name="token" value="ABC" />
<input type="text" name="user[name]" value="John Doe" />
<input type="text" name="user[email]" value="john@email.com" />
<input type="checkbox" name="user[newsletter]" checked />
<input type="file" name="user[image]" value="../dummy/image.png" />
<select name="user[country]">
<option value="CL" selected>Chile</option>
</select>
<input type="radio" name="user[gender]" value="male" checked />
<input type="radio" name="user[gender]" value="female" />
<input type="checkbox" name="user[skills][]" value="JS" checked />
<input type="checkbox" name="user[skills][]" value="C++" />
<input type="checkbox" name="user[skills][]" value="Java" />
<input type="checkbox" name="user[skills][]" value="CSS" checked />
<input type="button" name="my-submit" value="Submit Form" />
</form>
"""
afterEach ->
@sandbox.restore()
describe 'constructor($this)', ->
it 'should save the element as an instance variable', ->
$this = $()
serializer = new $._jQueryFormSerializer.Serializer($this)
expect(serializer.$this).to.eq($this)
describe '._serializeField(name, value)', ->
beforeEach ->
@serializer = new $._jQueryFormSerializer.Serializer
context 'if the name is a simple field name', ->
it 'should return a plain value', ->
value = @serializer._serializeField('email', 'test@email.com')
expect(value).to.eql(email: 'test@email.com')
context 'if the name is an array field name', ->
context 'the key', ->
it 'should not contain the brackets', ->
value = @serializer._serializeField('emails[]', 'test@email.com')
expect(value).to.have.key('emails')
it 'should return an array', ->
value = @serializer._serializeField('emails[]', 'test@email.com')
expect(value).to.eql(emails: ['test@email.com'])
it 'should merge consecutive calls to the same array field', ->
@serializer._serializeField('emails[]', 'test1@email.com')
value = @serializer._serializeField('emails[]', 'test2@email.com')
expect(value).to.eql(emails: ['test1@email.com', 'test2@email.com'])
context 'if the name is a named array field name', ->
context 'the key', ->
it 'should not contain the brackets', ->
value = @serializer._serializeField('emails[john]', 'john@email.com')
expect(value).to.have.key('emails')
it 'should return a json object', ->
value = @serializer._serializeField('emails[john]', 'john@email.com')
expect(value).to.eql
emails:
john: 'john@email.com'
it 'should handle nested attributes', ->
value = @serializer._serializeField('emails[john][current]', 'john@email.com')
expect(value).to.eql
emails:
john:
current: 'john@email.com'
describe '._getSubmittableFieldValues(options)', ->
beforeEach ->
@serializer = new $._jQueryFormSerializer.Serializer(@$form)
it 'should return all submittable fields as a name, value json array', ->
fields = @serializer._getSubmittableFieldValues()
expect(fields).to.eql [
{ name: "token", value: "ABC" },
{ name: "user[name]", value: "John Doe" },
{ name: "user[email]", value: "john@email.com" },
{ name: "user[newsletter]", value: true },
{ name: "user[country]", value: "CL" },
{ name: "user[gender]", value: "male" },
{ name: "user[skills][]", value: "JS" },
{ name: "user[skills][]", value: "CSS" }
]
it 'should ignore fields without a name', ->
@$form.html """
<input type="text" name="test" value="valid" />
<input type="text" value="invalid" />
"""
fields = @serializer._getSubmittableFieldValues()
expect(fields).to.eql [name: "test", value: "valid"]
it 'should be customizable by passing options', ->
@$form.html """
<input type="text" name="test1" value="enabled" />
<input type="text" name="test2" value="disabled" disabled />
"""
fields = @serializer._getSubmittableFieldValues
filters:
enabledOnly: false
expect(fields).to.eql [
{ name: "test1", value: "enabled" }
{ name: "test2", value: "disabled" }
]
context 'working with custom controls', ->
beforeEach ->
$.valHooks.custom_control =
get: (el) ->
$(el).data("value")
afterEach ->
delete $.valHooks.custom_control
it 'should work with custom control types', ->
$control = $("""<div class="custom-control" name="custom"/>""")
$control.data("value": "my value")
$control.get(0).type = "custom_control"
@$form.html($control)
fields = @serializer._getSubmittableFieldValues
submittable: "#{$.jQueryFormSerializer.submittable.selector}, .custom-control"
expect(fields).to.eql [name: "custom", value: "my value"]
it 'should call value castings on every field', ->
@$form.html """
<input type="text" value="123" name="field1" class="numeric" />
<input type="text" value="123" name="field2" />
"""
fields = @serializer._getSubmittableFieldValues
castings:
numericFields: ->
if $(this).hasClass("numeric")
parseInt($(this).val())
expect(fields).to.eql [
{ name: "field1", value: 123 }
{ name: "field2", value: "123" }
]
it 'should allow to customize castings by passing options', ->
@$form.html """
<input type="checkbox" name="test" checked />
"""
fields = @serializer._getSubmittableFieldValues
castings:
booleanCheckbox: false
expect(fields).to.eql [{ name: "test", value: "on" }]
describe '.toJSON(options = {})', ->
beforeEach ->
@serializer = new $._jQueryFormSerializer.Serializer(@$form)
it 'should return a json with all the submittable field values serialized', ->
expect(@serializer.toJSON()).to.eql
token: 'ABC'
user:
name: "John Doe"
email: "john@email.com"
newsletter: true
country: "CL"
gender: "male"
skills: ["JS", "CSS"]
it 'should pass the options to _getSubmittableFieldValues', ->
@sandbox.spy $._jQueryFormSerializer.Serializer.prototype, "_getSubmittableFieldValues"
options = { option1: 1 }
@serializer.toJSON(options)
expect($._jQueryFormSerializer.Serializer::_getSubmittableFieldValues).to
.have.been.calledWith(options)
| 92474 |
describe '$._jQueryFormSerializer.Serializer', ->
beforeEach ->
@sandbox = sinon.sandbox.create()
@$form = $ """
<form>
<input type="hidden" name="token" value="ABC" />
<input type="text" name="user[name]" value="<NAME>" />
<input type="text" name="user[email]" value="<EMAIL>" />
<input type="checkbox" name="user[newsletter]" checked />
<input type="file" name="user[image]" value="../dummy/image.png" />
<select name="user[country]">
<option value="CL" selected>Chile</option>
</select>
<input type="radio" name="user[gender]" value="male" checked />
<input type="radio" name="user[gender]" value="female" />
<input type="checkbox" name="user[skills][]" value="JS" checked />
<input type="checkbox" name="user[skills][]" value="C++" />
<input type="checkbox" name="user[skills][]" value="Java" />
<input type="checkbox" name="user[skills][]" value="CSS" checked />
<input type="button" name="my-submit" value="Submit Form" />
</form>
"""
afterEach ->
@sandbox.restore()
describe 'constructor($this)', ->
it 'should save the element as an instance variable', ->
$this = $()
serializer = new $._jQueryFormSerializer.Serializer($this)
expect(serializer.$this).to.eq($this)
describe '._serializeField(name, value)', ->
beforeEach ->
@serializer = new $._jQueryFormSerializer.Serializer
context 'if the name is a simple field name', ->
it 'should return a plain value', ->
value = @serializer._serializeField('email', '<EMAIL>')
expect(value).to.eql(email: '<EMAIL>')
context 'if the name is an array field name', ->
context 'the key', ->
it 'should not contain the brackets', ->
value = @serializer._serializeField('emails[]', '<EMAIL>')
expect(value).to.have.key('emails')
it 'should return an array', ->
value = @serializer._serializeField('emails[]', '<EMAIL>')
expect(value).to.eql(emails: ['<EMAIL>'])
it 'should merge consecutive calls to the same array field', ->
@serializer._serializeField('emails[]', '<EMAIL>')
value = @serializer._serializeField('emails[]', '<EMAIL>')
expect(value).to.eql(emails: ['<EMAIL>', '<EMAIL>'])
context 'if the name is a named array field name', ->
context 'the key', ->
it 'should not contain the brackets', ->
value = @serializer._serializeField('emails[john]', '<EMAIL>')
expect(value).to.have.key('emails')
it 'should return a json object', ->
value = @serializer._serializeField('emails[john]', '<EMAIL>')
expect(value).to.eql
emails:
john: '<EMAIL>'
it 'should handle nested attributes', ->
value = @serializer._serializeField('emails[john][current]', '<EMAIL>')
expect(value).to.eql
emails:
john:
current: '<EMAIL>'
describe '._getSubmittableFieldValues(options)', ->
beforeEach ->
@serializer = new $._jQueryFormSerializer.Serializer(@$form)
it 'should return all submittable fields as a name, value json array', ->
fields = @serializer._getSubmittableFieldValues()
expect(fields).to.eql [
{ name: "token", value: "ABC" },
{ name: "user[name]", value: "<NAME>" },
{ name: "user[email]", value: "<EMAIL>" },
{ name: "user[newsletter]", value: true },
{ name: "user[country]", value: "CL" },
{ name: "user[gender]", value: "male" },
{ name: "user[skills][]", value: "JS" },
{ name: "user[skills][]", value: "CSS" }
]
it 'should ignore fields without a name', ->
@$form.html """
<input type="text" name="test" value="valid" />
<input type="text" value="invalid" />
"""
fields = @serializer._getSubmittableFieldValues()
expect(fields).to.eql [name: "test", value: "valid"]
it 'should be customizable by passing options', ->
@$form.html """
<input type="text" name="test1" value="enabled" />
<input type="text" name="test2" value="disabled" disabled />
"""
fields = @serializer._getSubmittableFieldValues
filters:
enabledOnly: false
expect(fields).to.eql [
{ name: "test1", value: "enabled" }
{ name: "test2", value: "disabled" }
]
context 'working with custom controls', ->
beforeEach ->
$.valHooks.custom_control =
get: (el) ->
$(el).data("value")
afterEach ->
delete $.valHooks.custom_control
it 'should work with custom control types', ->
$control = $("""<div class="custom-control" name="custom"/>""")
$control.data("value": "my value")
$control.get(0).type = "custom_control"
@$form.html($control)
fields = @serializer._getSubmittableFieldValues
submittable: "#{$.jQueryFormSerializer.submittable.selector}, .custom-control"
expect(fields).to.eql [name: "custom", value: "my value"]
it 'should call value castings on every field', ->
@$form.html """
<input type="text" value="123" name="field1" class="numeric" />
<input type="text" value="123" name="field2" />
"""
fields = @serializer._getSubmittableFieldValues
castings:
numericFields: ->
if $(this).hasClass("numeric")
parseInt($(this).val())
expect(fields).to.eql [
{ name: "field1", value: 123 }
{ name: "field2", value: "123" }
]
it 'should allow to customize castings by passing options', ->
@$form.html """
<input type="checkbox" name="test" checked />
"""
fields = @serializer._getSubmittableFieldValues
castings:
booleanCheckbox: false
expect(fields).to.eql [{ name: "test", value: "on" }]
describe '.toJSON(options = {})', ->
beforeEach ->
@serializer = new $._jQueryFormSerializer.Serializer(@$form)
it 'should return a json with all the submittable field values serialized', ->
expect(@serializer.toJSON()).to.eql
token: 'ABC'
user:
name: "<NAME>"
email: "<EMAIL>"
newsletter: true
country: "CL"
gender: "male"
skills: ["JS", "CSS"]
it 'should pass the options to _getSubmittableFieldValues', ->
@sandbox.spy $._jQueryFormSerializer.Serializer.prototype, "_getSubmittableFieldValues"
options = { option1: 1 }
@serializer.toJSON(options)
expect($._jQueryFormSerializer.Serializer::_getSubmittableFieldValues).to
.have.been.calledWith(options)
| true |
describe '$._jQueryFormSerializer.Serializer', ->
beforeEach ->
@sandbox = sinon.sandbox.create()
@$form = $ """
<form>
<input type="hidden" name="token" value="ABC" />
<input type="text" name="user[name]" value="PI:NAME:<NAME>END_PI" />
<input type="text" name="user[email]" value="PI:EMAIL:<EMAIL>END_PI" />
<input type="checkbox" name="user[newsletter]" checked />
<input type="file" name="user[image]" value="../dummy/image.png" />
<select name="user[country]">
<option value="CL" selected>Chile</option>
</select>
<input type="radio" name="user[gender]" value="male" checked />
<input type="radio" name="user[gender]" value="female" />
<input type="checkbox" name="user[skills][]" value="JS" checked />
<input type="checkbox" name="user[skills][]" value="C++" />
<input type="checkbox" name="user[skills][]" value="Java" />
<input type="checkbox" name="user[skills][]" value="CSS" checked />
<input type="button" name="my-submit" value="Submit Form" />
</form>
"""
afterEach ->
@sandbox.restore()
describe 'constructor($this)', ->
it 'should save the element as an instance variable', ->
$this = $()
serializer = new $._jQueryFormSerializer.Serializer($this)
expect(serializer.$this).to.eq($this)
describe '._serializeField(name, value)', ->
beforeEach ->
@serializer = new $._jQueryFormSerializer.Serializer
context 'if the name is a simple field name', ->
it 'should return a plain value', ->
value = @serializer._serializeField('email', 'PI:EMAIL:<EMAIL>END_PI')
expect(value).to.eql(email: 'PI:EMAIL:<EMAIL>END_PI')
context 'if the name is an array field name', ->
context 'the key', ->
it 'should not contain the brackets', ->
value = @serializer._serializeField('emails[]', 'PI:EMAIL:<EMAIL>END_PI')
expect(value).to.have.key('emails')
it 'should return an array', ->
value = @serializer._serializeField('emails[]', 'PI:EMAIL:<EMAIL>END_PI')
expect(value).to.eql(emails: ['PI:EMAIL:<EMAIL>END_PI'])
it 'should merge consecutive calls to the same array field', ->
@serializer._serializeField('emails[]', 'PI:EMAIL:<EMAIL>END_PI')
value = @serializer._serializeField('emails[]', 'PI:EMAIL:<EMAIL>END_PI')
expect(value).to.eql(emails: ['PI:EMAIL:<EMAIL>END_PI', 'PI:EMAIL:<EMAIL>END_PI'])
context 'if the name is a named array field name', ->
context 'the key', ->
it 'should not contain the brackets', ->
value = @serializer._serializeField('emails[john]', 'PI:EMAIL:<EMAIL>END_PI')
expect(value).to.have.key('emails')
it 'should return a json object', ->
value = @serializer._serializeField('emails[john]', 'PI:EMAIL:<EMAIL>END_PI')
expect(value).to.eql
emails:
john: 'PI:EMAIL:<EMAIL>END_PI'
it 'should handle nested attributes', ->
value = @serializer._serializeField('emails[john][current]', 'PI:EMAIL:<EMAIL>END_PI')
expect(value).to.eql
emails:
john:
current: 'PI:EMAIL:<EMAIL>END_PI'
describe '._getSubmittableFieldValues(options)', ->
beforeEach ->
@serializer = new $._jQueryFormSerializer.Serializer(@$form)
it 'should return all submittable fields as a name, value json array', ->
fields = @serializer._getSubmittableFieldValues()
expect(fields).to.eql [
{ name: "token", value: "ABC" },
{ name: "user[name]", value: "PI:NAME:<NAME>END_PI" },
{ name: "user[email]", value: "PI:EMAIL:<EMAIL>END_PI" },
{ name: "user[newsletter]", value: true },
{ name: "user[country]", value: "CL" },
{ name: "user[gender]", value: "male" },
{ name: "user[skills][]", value: "JS" },
{ name: "user[skills][]", value: "CSS" }
]
it 'should ignore fields without a name', ->
@$form.html """
<input type="text" name="test" value="valid" />
<input type="text" value="invalid" />
"""
fields = @serializer._getSubmittableFieldValues()
expect(fields).to.eql [name: "test", value: "valid"]
it 'should be customizable by passing options', ->
@$form.html """
<input type="text" name="test1" value="enabled" />
<input type="text" name="test2" value="disabled" disabled />
"""
fields = @serializer._getSubmittableFieldValues
filters:
enabledOnly: false
expect(fields).to.eql [
{ name: "test1", value: "enabled" }
{ name: "test2", value: "disabled" }
]
context 'working with custom controls', ->
beforeEach ->
$.valHooks.custom_control =
get: (el) ->
$(el).data("value")
afterEach ->
delete $.valHooks.custom_control
it 'should work with custom control types', ->
$control = $("""<div class="custom-control" name="custom"/>""")
$control.data("value": "my value")
$control.get(0).type = "custom_control"
@$form.html($control)
fields = @serializer._getSubmittableFieldValues
submittable: "#{$.jQueryFormSerializer.submittable.selector}, .custom-control"
expect(fields).to.eql [name: "custom", value: "my value"]
it 'should call value castings on every field', ->
@$form.html """
<input type="text" value="123" name="field1" class="numeric" />
<input type="text" value="123" name="field2" />
"""
fields = @serializer._getSubmittableFieldValues
castings:
numericFields: ->
if $(this).hasClass("numeric")
parseInt($(this).val())
expect(fields).to.eql [
{ name: "field1", value: 123 }
{ name: "field2", value: "123" }
]
it 'should allow to customize castings by passing options', ->
@$form.html """
<input type="checkbox" name="test" checked />
"""
fields = @serializer._getSubmittableFieldValues
castings:
booleanCheckbox: false
expect(fields).to.eql [{ name: "test", value: "on" }]
describe '.toJSON(options = {})', ->
beforeEach ->
@serializer = new $._jQueryFormSerializer.Serializer(@$form)
it 'should return a json with all the submittable field values serialized', ->
expect(@serializer.toJSON()).to.eql
token: 'ABC'
user:
name: "PI:NAME:<NAME>END_PI"
email: "PI:EMAIL:<EMAIL>END_PI"
newsletter: true
country: "CL"
gender: "male"
skills: ["JS", "CSS"]
it 'should pass the options to _getSubmittableFieldValues', ->
@sandbox.spy $._jQueryFormSerializer.Serializer.prototype, "_getSubmittableFieldValues"
options = { option1: 1 }
@serializer.toJSON(options)
expect($._jQueryFormSerializer.Serializer::_getSubmittableFieldValues).to
.have.been.calledWith(options)
|
[
{
"context": "an Garden', address: 'Västgötagatan 18',\n\t\tdesc: 'Rezaul Karim, founder and owner of Indian Garden. Born in Bang",
"end": 121,
"score": 0.9970265626907349,
"start": 109,
"tag": "NAME",
"value": "Rezaul Karim"
},
{
"context": "e his mother in the kitchen.'\n\t,\n\t\t\tid: 3, name: 'Underbar', address: 'Drottninggatan 102',\n\t\t\tdesc: 'Libano",
"end": 374,
"score": 0.9967072010040283,
"start": 366,
"tag": "NAME",
"value": "Underbar"
},
{
"context": "\t\t\tdesc: 'Libanon i Stockholm'\n\t,\n\t\tid: 1, name: 'La Neta', address: 'Drottninggatan 132',\n\t\tdesc: 'Our tac",
"end": 465,
"score": 0.9996852278709412,
"start": 458,
"tag": "NAME",
"value": "La Neta"
},
{
"context": "ree and lactose-free options.'\n\t,\n\t\tid: 4, name: 'Martins Gröna', address: 'Regeringsgatan 91',\n\t\tdesc: 'Martin G",
"end": 695,
"score": 0.9998999834060669,
"start": 682,
"tag": "NAME",
"value": "Martins Gröna"
},
{
"context": "ns Gröna', address: 'Regeringsgatan 91',\n\t\tdesc: 'Martin Green is a vegetarian lunch restaurant situated in cent",
"end": 749,
"score": 0.9995582103729248,
"start": 737,
"tag": "NAME",
"value": "Martin Green"
},
{
"context": "ver the world with much love.'\n\t,\n\t\tid: 2, name: 'Rolfs Kök', address: 'Tegnérgatan 41',\n\t\tdesc: 'Rolfs Kitch",
"end": 960,
"score": 0.9998929500579834,
"start": 951,
"tag": "NAME",
"value": "Rolfs Kök"
},
{
"context": "\"out\".'\n\t]\n\n\tselectedRestaurant: \n\t\tid: 1, name: 'La Neta', address: 'Drottninggatan 132',\n\t\tdesc: 'Our tac",
"end": 1271,
"score": 0.9996504187583923,
"start": 1264,
"tag": "NAME",
"value": "La Neta"
},
{
"context": "itle burger and too litle beer',\n\t\t\tuser: {name: 'Martin', initials: 'M', color: ''}\n\t\t2:\n\t\t\tid: 2, ts: 14",
"end": 1632,
"score": 0.9996166825294495,
"start": 1626,
"tag": "NAME",
"value": "Martin"
},
{
"context": "eat food but a bit noisy place',\n\t\t\tuser: {name: 'Tina', initials: 'T', color: ''}\n\t\t3:\n\t\t\tid: 3, ts: 14",
"end": 1783,
"score": 0.9995614886283875,
"start": 1779,
"tag": "NAME",
"value": "Tina"
},
{
"context": " 5,\n\t\t\ttext: 'Gott och snabbt!',\n\t\t\tuser: {name: 'Malin', initials: 'M', color: ''}\n\t\t4:\n\t\t\tid: 4, ts: 14",
"end": 1919,
"score": 0.9996463060379028,
"start": 1914,
"tag": "NAME",
"value": "Malin"
},
{
"context": "2, stars: 5,\n\t\t\ttext: 'Bra mat!'\n\t\t\tuser: {name: 'Nova', initials: 'N', color: ''}\n\n",
"end": 2045,
"score": 0.99985671043396,
"start": 2041,
"tag": "NAME",
"value": "Nova"
},
{
"context": "xt: 'Bra mat!'\n\t\t\tuser: {name: 'Nova', initials: 'N', color: ''}\n\n",
"end": 2060,
"score": 0.5070297718048096,
"start": 2059,
"tag": "NAME",
"value": "N"
}
] | examples/restaurant-reviewer/src/base/mockState.coffee | Cottin/oublie | 0 | module.exports =
restaurantsSorted: [
id: 5, name: 'Indian Garden', address: 'Västgötagatan 18',
desc: 'Rezaul Karim, founder and owner of Indian Garden. Born in Bangladesh in 1975 and came to Sweden 19 years old. Even as a child in Bangladesh, he showed a great interest in cooking and spent much time alongside his mother in the kitchen.'
,
id: 3, name: 'Underbar', address: 'Drottninggatan 102',
desc: 'Libanon i Stockholm'
,
id: 1, name: 'La Neta', address: 'Drottninggatan 132',
desc: 'Our tacos and quesadillas perfect catering for corporate events or private parties. We even have vegetarian, vegan, gluten-free and lactose-free options.'
,
id: 4, name: 'Martins Gröna', address: 'Regeringsgatan 91',
desc: 'Martin Green is a vegetarian lunch restaurant situated in central Stockholm. Since 1998 we have served vegetarian food using fresh ingredients and spices from all over the world with much love.'
,
id: 2, name: 'Rolfs Kök', address: 'Tegnérgatan 41',
desc: 'Rolfs Kitchen repaired only food that we like ourselves. It is based on simplicity and quality, without fuss and frills. Here are the joy of food and the atmosphere is more important than trends and what is "in" or "out".'
]
selectedRestaurant:
id: 1, name: 'La Neta', address: 'Drottninggatan 132',
desc: 'Our tacos and quesadillas perfect catering for corporate events or private parties. We even have vegetarian, vegan, gluten-free and lactose-free options.'
reviewItems:
1:
id: 1, ts: 1480086468, restaurant: 1, stars: 2,
text: 'Not really my thing, too litle burger and too litle beer',
user: {name: 'Martin', initials: 'M', color: ''}
2:
id: 2, ts: 1480186468, restaurant: 1, stars: 4,
text: 'Great food but a bit noisy place',
user: {name: 'Tina', initials: 'T', color: ''}
3:
id: 3, ts: 1481186468, restaurant: 1, stars: 5,
text: 'Gott och snabbt!',
user: {name: 'Malin', initials: 'M', color: ''}
4:
id: 4, ts: 1480286468, restaurant: 2, stars: 5,
text: 'Bra mat!'
user: {name: 'Nova', initials: 'N', color: ''}
| 193342 | module.exports =
restaurantsSorted: [
id: 5, name: 'Indian Garden', address: 'Västgötagatan 18',
desc: '<NAME>, founder and owner of Indian Garden. Born in Bangladesh in 1975 and came to Sweden 19 years old. Even as a child in Bangladesh, he showed a great interest in cooking and spent much time alongside his mother in the kitchen.'
,
id: 3, name: '<NAME>', address: 'Drottninggatan 102',
desc: 'Libanon i Stockholm'
,
id: 1, name: '<NAME>', address: 'Drottninggatan 132',
desc: 'Our tacos and quesadillas perfect catering for corporate events or private parties. We even have vegetarian, vegan, gluten-free and lactose-free options.'
,
id: 4, name: '<NAME>', address: 'Regeringsgatan 91',
desc: '<NAME> is a vegetarian lunch restaurant situated in central Stockholm. Since 1998 we have served vegetarian food using fresh ingredients and spices from all over the world with much love.'
,
id: 2, name: '<NAME>', address: 'Tegnérgatan 41',
desc: 'Rolfs Kitchen repaired only food that we like ourselves. It is based on simplicity and quality, without fuss and frills. Here are the joy of food and the atmosphere is more important than trends and what is "in" or "out".'
]
selectedRestaurant:
id: 1, name: '<NAME>', address: 'Drottninggatan 132',
desc: 'Our tacos and quesadillas perfect catering for corporate events or private parties. We even have vegetarian, vegan, gluten-free and lactose-free options.'
reviewItems:
1:
id: 1, ts: 1480086468, restaurant: 1, stars: 2,
text: 'Not really my thing, too litle burger and too litle beer',
user: {name: '<NAME>', initials: 'M', color: ''}
2:
id: 2, ts: 1480186468, restaurant: 1, stars: 4,
text: 'Great food but a bit noisy place',
user: {name: '<NAME>', initials: 'T', color: ''}
3:
id: 3, ts: 1481186468, restaurant: 1, stars: 5,
text: 'Gott och snabbt!',
user: {name: '<NAME>', initials: 'M', color: ''}
4:
id: 4, ts: 1480286468, restaurant: 2, stars: 5,
text: 'Bra mat!'
user: {name: '<NAME>', initials: '<NAME>', color: ''}
| true | module.exports =
restaurantsSorted: [
id: 5, name: 'Indian Garden', address: 'Västgötagatan 18',
desc: 'PI:NAME:<NAME>END_PI, founder and owner of Indian Garden. Born in Bangladesh in 1975 and came to Sweden 19 years old. Even as a child in Bangladesh, he showed a great interest in cooking and spent much time alongside his mother in the kitchen.'
,
id: 3, name: 'PI:NAME:<NAME>END_PI', address: 'Drottninggatan 102',
desc: 'Libanon i Stockholm'
,
id: 1, name: 'PI:NAME:<NAME>END_PI', address: 'Drottninggatan 132',
desc: 'Our tacos and quesadillas perfect catering for corporate events or private parties. We even have vegetarian, vegan, gluten-free and lactose-free options.'
,
id: 4, name: 'PI:NAME:<NAME>END_PI', address: 'Regeringsgatan 91',
desc: 'PI:NAME:<NAME>END_PI is a vegetarian lunch restaurant situated in central Stockholm. Since 1998 we have served vegetarian food using fresh ingredients and spices from all over the world with much love.'
,
id: 2, name: 'PI:NAME:<NAME>END_PI', address: 'Tegnérgatan 41',
desc: 'Rolfs Kitchen repaired only food that we like ourselves. It is based on simplicity and quality, without fuss and frills. Here are the joy of food and the atmosphere is more important than trends and what is "in" or "out".'
]
selectedRestaurant:
id: 1, name: 'PI:NAME:<NAME>END_PI', address: 'Drottninggatan 132',
desc: 'Our tacos and quesadillas perfect catering for corporate events or private parties. We even have vegetarian, vegan, gluten-free and lactose-free options.'
reviewItems:
1:
id: 1, ts: 1480086468, restaurant: 1, stars: 2,
text: 'Not really my thing, too litle burger and too litle beer',
user: {name: 'PI:NAME:<NAME>END_PI', initials: 'M', color: ''}
2:
id: 2, ts: 1480186468, restaurant: 1, stars: 4,
text: 'Great food but a bit noisy place',
user: {name: 'PI:NAME:<NAME>END_PI', initials: 'T', color: ''}
3:
id: 3, ts: 1481186468, restaurant: 1, stars: 5,
text: 'Gott och snabbt!',
user: {name: 'PI:NAME:<NAME>END_PI', initials: 'M', color: ''}
4:
id: 4, ts: 1480286468, restaurant: 2, stars: 5,
text: 'Bra mat!'
user: {name: 'PI:NAME:<NAME>END_PI', initials: 'PI:NAME:<NAME>END_PI', color: ''}
|
[
{
"context": "e': 'registered',\n 'profile': {\n 'nickname': 'fatihacet',\n 'hash': '8afa54efe3a35ba0e9d7142843727154',",
"end": 386,
"score": 0.999421238899231,
"start": 377,
"tag": "USERNAME",
"value": "fatihacet"
},
{
"context": "a54efe3a35ba0e9d7142843727154',\n 'firstName': 'Fatih',\n 'lastName': 'Acet'\n },\n 'isExempt': false",
"end": 460,
"score": 0.9996649026870728,
"start": 455,
"tag": "NAME",
"value": "Fatih"
},
{
"context": "7154',\n 'firstName': 'Fatih',\n 'lastName': 'Acet'\n },\n 'isExempt': false,\n 'globalFlags': ['sup",
"end": 484,
"score": 0.999605655670166,
"start": 480,
"tag": "NAME",
"value": "Acet"
}
] | client/mocks/mock.jaccount.coffee | ezgikaysi/koding | 1 | module.exports = {
'watchers': {},
'bongo_': {
'constructorName': 'JAccount',
'instanceId': '63eaf04482cd89149ef98ed76e033aaf'
},
'socialApiId': '5',
'systemInfo': {
'defaultToLastUsedEnvironment': true
},
'counts': {
'followers': 0,
'following': 0,
'topics': 0,
'likes': 0
},
'type': 'registered',
'profile': {
'nickname': 'fatihacet',
'hash': '8afa54efe3a35ba0e9d7142843727154',
'firstName': 'Fatih',
'lastName': 'Acet'
},
'isExempt': false,
'globalFlags': ['super-admin'],
'meta': {
'data': {
'createdAt': '2015-12-24T21:29:42.909Z',
'modifiedAt': '2015-12-24T21:29:42.909Z',
'likes': 0
},
'createdAt': '2015-12-24T21:29:42.909Z',
'modifiedAt': '2015-12-24T21:29:42.909Z',
'likes': 0
},
'onlineStatus': 'online',
'_id': '567c63c6178902000012673f'
}
| 58216 | module.exports = {
'watchers': {},
'bongo_': {
'constructorName': 'JAccount',
'instanceId': '63eaf04482cd89149ef98ed76e033aaf'
},
'socialApiId': '5',
'systemInfo': {
'defaultToLastUsedEnvironment': true
},
'counts': {
'followers': 0,
'following': 0,
'topics': 0,
'likes': 0
},
'type': 'registered',
'profile': {
'nickname': 'fatihacet',
'hash': '8afa54efe3a35ba0e9d7142843727154',
'firstName': '<NAME>',
'lastName': '<NAME>'
},
'isExempt': false,
'globalFlags': ['super-admin'],
'meta': {
'data': {
'createdAt': '2015-12-24T21:29:42.909Z',
'modifiedAt': '2015-12-24T21:29:42.909Z',
'likes': 0
},
'createdAt': '2015-12-24T21:29:42.909Z',
'modifiedAt': '2015-12-24T21:29:42.909Z',
'likes': 0
},
'onlineStatus': 'online',
'_id': '567c63c6178902000012673f'
}
| true | module.exports = {
'watchers': {},
'bongo_': {
'constructorName': 'JAccount',
'instanceId': '63eaf04482cd89149ef98ed76e033aaf'
},
'socialApiId': '5',
'systemInfo': {
'defaultToLastUsedEnvironment': true
},
'counts': {
'followers': 0,
'following': 0,
'topics': 0,
'likes': 0
},
'type': 'registered',
'profile': {
'nickname': 'fatihacet',
'hash': '8afa54efe3a35ba0e9d7142843727154',
'firstName': 'PI:NAME:<NAME>END_PI',
'lastName': 'PI:NAME:<NAME>END_PI'
},
'isExempt': false,
'globalFlags': ['super-admin'],
'meta': {
'data': {
'createdAt': '2015-12-24T21:29:42.909Z',
'modifiedAt': '2015-12-24T21:29:42.909Z',
'likes': 0
},
'createdAt': '2015-12-24T21:29:42.909Z',
'modifiedAt': '2015-12-24T21:29:42.909Z',
'likes': 0
},
'onlineStatus': 'online',
'_id': '567c63c6178902000012673f'
}
|
[
{
"context": "# Copyright Vladimir Andreev\n\n# Required modules\n\nHTTP = require('http')\nHTTPS",
"end": 28,
"score": 0.9998764395713806,
"start": 12,
"tag": "NAME",
"value": "Vladimir Andreev"
},
{
"context": "l)\n\n\t\tfullInput.answer = 'json'\n\t\tfullInput.user = @_userName\n\t\tfullInput.password = @_hash\n\n\t\tfullInput[key] =",
"end": 2191,
"score": 0.9989696145057678,
"start": 2181,
"tag": "USERNAME",
"value": "@_userName"
},
{
"context": "fullInput.user = @_userName\n\t\tfullInput.password = @_hash\n\n\t\tfullInput[key] = value for key, value of input",
"end": 2221,
"score": 0.9981896281242371,
"start": 2215,
"tag": "PASSWORD",
"value": "@_hash"
}
] | src/client.coffee | tucan/smsaero | 0 | # Copyright Vladimir Andreev
# Required modules
HTTP = require('http')
HTTPS = require('https')
Crypto = require('crypto')
Iconv = require('iconv-lite')
QS = require('qs')
# SMSAero client
class Client
# Connection default parameters
SERVER_PROTO = 'http'
SERVER_NAME = 'gate.smsaero.ru'
SERVER_PLAIN_PORT = 80
SERVER_SECURE_PORT = 443
# Request and response default parameters
REQUEST_CHARSET = 'utf-8'
# Object constructor
constructor: (options) ->
options ?= Object.create(null)
@_proto = options.proto ? SERVER_PROTO
@_HTTP = if @_proto is 'http' then HTTP else HTTPS
@_host = options.host ? SERVER_NAME
@_port = options.port ? if @_proto is 'http' then SERVER_PLAIN_PORT else SERVER_SECURE_PORT
@_charset = options.charset ? REQUEST_CHARSET
@_userName = options.userName
@_hash = Crypto.createHash('md5').update(options.password).digest('hex')
# Generates request options based on provided parameters
_requestOptions: (name, blob) ->
path = '/' + name + '/'
headers =
'Content-Type': 'application/x-www-form-urlencoded; charset=' + @_charset
'Content-Length': blob.length
options =
host: @_host, port: @_port
method: 'POST', path: path
headers: headers
options
# Generates onResponse handler for provided callback
_responseHandler: (callback) -> (response) =>
# Array for arriving chunks
chunks = []
# Assign necessary event handlers
response.on('readable', () ->
chunks.push(response.read())
return
)
response.on('end', () ->
return if typeof callback isnt 'function'
blob = Buffer.concat(chunks)
# Handle status code
firstDigit = response.statusCode // 100
switch firstDigit
when 2
output = JSON.parse(Iconv.decode(blob, 'utf-8') or '{}')
callback(null, output)
else
callback(new Error('Unexpected status code'))
return
)
return
# Generates onError handler for provided callback
_errorHandler: (callback) -> (error) =>
callback?(error)
return
# Invokes pointed method on the remote side
invokeMethod: (name, input, callback) ->
fullInput = Object.create(null)
fullInput.answer = 'json'
fullInput.user = @_userName
fullInput.password = @_hash
fullInput[key] = value for key, value of input
# Make serialization and derived text encoding
blob = Iconv.encode(QS.stringify(fullInput), @_charset)
# Create request using generated options
request = @_HTTP.request(@_requestOptions(name, blob))
# Assign necessary event handlers
request.on('response', @_responseHandler(callback))
request.on('error', @_errorHandler(callback))
# Write body and finish request
request.end(blob)
@
# Exported objects
module.exports = Client
| 27598 | # Copyright <NAME>
# Required modules
HTTP = require('http')
HTTPS = require('https')
Crypto = require('crypto')
Iconv = require('iconv-lite')
QS = require('qs')
# SMSAero client
class Client
# Connection default parameters
SERVER_PROTO = 'http'
SERVER_NAME = 'gate.smsaero.ru'
SERVER_PLAIN_PORT = 80
SERVER_SECURE_PORT = 443
# Request and response default parameters
REQUEST_CHARSET = 'utf-8'
# Object constructor
constructor: (options) ->
options ?= Object.create(null)
@_proto = options.proto ? SERVER_PROTO
@_HTTP = if @_proto is 'http' then HTTP else HTTPS
@_host = options.host ? SERVER_NAME
@_port = options.port ? if @_proto is 'http' then SERVER_PLAIN_PORT else SERVER_SECURE_PORT
@_charset = options.charset ? REQUEST_CHARSET
@_userName = options.userName
@_hash = Crypto.createHash('md5').update(options.password).digest('hex')
# Generates request options based on provided parameters
_requestOptions: (name, blob) ->
path = '/' + name + '/'
headers =
'Content-Type': 'application/x-www-form-urlencoded; charset=' + @_charset
'Content-Length': blob.length
options =
host: @_host, port: @_port
method: 'POST', path: path
headers: headers
options
# Generates onResponse handler for provided callback
_responseHandler: (callback) -> (response) =>
# Array for arriving chunks
chunks = []
# Assign necessary event handlers
response.on('readable', () ->
chunks.push(response.read())
return
)
response.on('end', () ->
return if typeof callback isnt 'function'
blob = Buffer.concat(chunks)
# Handle status code
firstDigit = response.statusCode // 100
switch firstDigit
when 2
output = JSON.parse(Iconv.decode(blob, 'utf-8') or '{}')
callback(null, output)
else
callback(new Error('Unexpected status code'))
return
)
return
# Generates onError handler for provided callback
_errorHandler: (callback) -> (error) =>
callback?(error)
return
# Invokes pointed method on the remote side
invokeMethod: (name, input, callback) ->
fullInput = Object.create(null)
fullInput.answer = 'json'
fullInput.user = @_userName
fullInput.password = <PASSWORD>
fullInput[key] = value for key, value of input
# Make serialization and derived text encoding
blob = Iconv.encode(QS.stringify(fullInput), @_charset)
# Create request using generated options
request = @_HTTP.request(@_requestOptions(name, blob))
# Assign necessary event handlers
request.on('response', @_responseHandler(callback))
request.on('error', @_errorHandler(callback))
# Write body and finish request
request.end(blob)
@
# Exported objects
module.exports = Client
| true | # Copyright PI:NAME:<NAME>END_PI
# Required modules
HTTP = require('http')
HTTPS = require('https')
Crypto = require('crypto')
Iconv = require('iconv-lite')
QS = require('qs')
# SMSAero client
class Client
# Connection default parameters
SERVER_PROTO = 'http'
SERVER_NAME = 'gate.smsaero.ru'
SERVER_PLAIN_PORT = 80
SERVER_SECURE_PORT = 443
# Request and response default parameters
REQUEST_CHARSET = 'utf-8'
# Object constructor
constructor: (options) ->
options ?= Object.create(null)
@_proto = options.proto ? SERVER_PROTO
@_HTTP = if @_proto is 'http' then HTTP else HTTPS
@_host = options.host ? SERVER_NAME
@_port = options.port ? if @_proto is 'http' then SERVER_PLAIN_PORT else SERVER_SECURE_PORT
@_charset = options.charset ? REQUEST_CHARSET
@_userName = options.userName
@_hash = Crypto.createHash('md5').update(options.password).digest('hex')
# Generates request options based on provided parameters
_requestOptions: (name, blob) ->
path = '/' + name + '/'
headers =
'Content-Type': 'application/x-www-form-urlencoded; charset=' + @_charset
'Content-Length': blob.length
options =
host: @_host, port: @_port
method: 'POST', path: path
headers: headers
options
# Generates onResponse handler for provided callback
_responseHandler: (callback) -> (response) =>
# Array for arriving chunks
chunks = []
# Assign necessary event handlers
response.on('readable', () ->
chunks.push(response.read())
return
)
response.on('end', () ->
return if typeof callback isnt 'function'
blob = Buffer.concat(chunks)
# Handle status code
firstDigit = response.statusCode // 100
switch firstDigit
when 2
output = JSON.parse(Iconv.decode(blob, 'utf-8') or '{}')
callback(null, output)
else
callback(new Error('Unexpected status code'))
return
)
return
# Generates onError handler for provided callback
_errorHandler: (callback) -> (error) =>
callback?(error)
return
# Invokes pointed method on the remote side
invokeMethod: (name, input, callback) ->
fullInput = Object.create(null)
fullInput.answer = 'json'
fullInput.user = @_userName
fullInput.password = PI:PASSWORD:<PASSWORD>END_PI
fullInput[key] = value for key, value of input
# Make serialization and derived text encoding
blob = Iconv.encode(QS.stringify(fullInput), @_charset)
# Create request using generated options
request = @_HTTP.request(@_requestOptions(name, blob))
# Assign necessary event handlers
request.on('response', @_responseHandler(callback))
request.on('error', @_errorHandler(callback))
# Write body and finish request
request.end(blob)
@
# Exported objects
module.exports = Client
|
[
{
"context": "html.md](http://neocotic.com/html.md) \n# (c) 2013 Alasdair Mercer \n# Freely distributable under the MIT license. ",
"end": 69,
"score": 0.999872624874115,
"start": 54,
"tag": "NAME",
"value": "Alasdair Mercer"
},
{
"context": " \n# Based on [Make.text](http://homepage.mac.com/tjim/) 1.5 \n# (c) 2007 Trevor Jim \n# For all details",
"end": 171,
"score": 0.9571465253829956,
"start": 167,
"tag": "USERNAME",
"value": "tjim"
},
{
"context": "t](http://homepage.mac.com/tjim/) 1.5 \n# (c) 2007 Trevor Jim \n# For all details and documentation: \n# <http:",
"end": 201,
"score": 0.99988853931427,
"start": 191,
"tag": "NAME",
"value": "Trevor Jim"
}
] | src/md.coffee | Stormtv/html.md | 1 | # [html.md](http://neocotic.com/html.md)
# (c) 2013 Alasdair Mercer
# Freely distributable under the MIT license.
# Based on [Make.text](http://homepage.mac.com/tjim/) 1.5
# (c) 2007 Trevor Jim
# For all details and documentation:
# <http://neocotic.com/html.md>
# Private constants
# -----------------
# Default option values.
DEFAULT_OPTIONS =
absolute: no
base: if window? then window.document.baseURI else "file://#{process.cwd()}"
debug: no
inline: no
# Save the previous value of the global `md` variable for *noConflict* mode.
PREVIOUS_MD = @md
# Map of replacement strings for *special* Markdown characters.
REPLACEMENTS =
'\\\\': '\\\\'
'\\[': '\\['
'\\]': '\\]'
'>': '\\>'
'_': '\\_'
'\\*': '\\*'
'`': '\\`'
'#': '\\#'
'([0-9])\\.(\\s|$)': '$1\\.$2'
'\u00a9': '(c)'
'\u00ae': '(r)'
'\u2122': '(tm)'
'\u00a0': ' '
'\u00b7': '\\*'
'\u2002': ' '
'\u2003': ' '
'\u2009': ' '
'\u2018': '\''
'\u2019': '\''
'\u201c': '"'
'\u201d': '"'
'\u2026': '...'
'\u2013': '--'
'\u2014': '---'
# Regular expression to extract all `display` and `visibility` CSS properties from an inline style
# attribute.
R_HIDDEN_STYLES = /(display|visibility)\s*:\s*[a-z]+/gi
# Regular expression to check for *hidden* values of CSS properties.
R_HIDDEN_VALUE = /(none|hidden)\s*$/i
# Regular expression to identify elements to be generally ignored, along with their children.
R_IGNORE_CHILDREN = /// ^ (
APPLET
| AREA
| AUDIO
| BUTTON
| CANVAS
| DATALIST
| EMBED
| HEAD
| INPUT
| MAP
| MENU
| METER
| NOFRAMES
| NOSCRIPT
| OBJECT
| OPTGROUP
| OPTION
| PARAM
| PROGRESS
| RP
| RT
| RUBY
| SCRIPT
| SELECT
| STYLE
| TEXTAREA
| TITLE
| VIDEO
) $ ///
# Regular expression to identify elements to be parsed as simple paragraphs.
R_PARAGRAPH_ONLY = /// ^ (
ADDRESS
| ARTICLE
| ASIDE
| DIV
| FIELDSET
| FOOTER
| HEADER
| NAV
| P
| SECTION
) $ ///
# Create a map of regular expressions for all of the *special* Markdown characters to simplify
# access.
REGEX = (
result = {}
result[key] = new RegExp key, 'g' for own key of REPLACEMENTS
result
)
# Helper functions
# ----------------
# Left pad `str` with the given padding string for the specified number of `times`.
padLeft = (str = '', times = 0, padStr = ' ') ->
return str unless padStr
str = padStr + str for i in [0...times]
str
# Remove whitespace from both ends of `str`.
# This tries to use the native `String.prototype.trim` function where possible.
trim = (str = '') ->
if str.trim then str.trim() else str.replace /^\s+|\s+$/g, ''
# HTML Parser
# -----------
# Parses HTML code and/or elements into valid Markdown.
# Elements are parsed recursively, meaning their children are also parsed.
class HtmlParser
# Creates a new `HtmlParser` for the arguments provided.
constructor: (@html = '', @options = {}) ->
@atLeft = @atNoWS = @atP = yes
@buffer = ''
@exceptions = []
@order = 1
@listDepth = 0
@inCode = @inPre = @inOrderedList = no
@last = null
@left = '\n'
@links = []
@linkMap = {}
@unhandled = {}
@options = {} if typeof @options isnt 'object'
# Copy all default option values across to `options` only where they were not specified.
for own key, defaultValue of DEFAULT_OPTIONS
@options[key] = defaultValue if typeof @options[key] is 'undefined'
# Create a DOM if `window` doesn't exist (i.e. when running in node).
@win = window ? null
unless @win?
doc = require('jsdom').jsdom
features: FetchExternalResources: no
url: @options.base
@win = doc.defaultView
# Create the Node constants if Node doesn't exist (i.e. when running in IE < 9).
unless @win.Node?
@win.Node =
ELEMENT_NODE: 1
TEXT_NODE: 3
# Append `str` to the buffer string.
append: (str) ->
@buffer += @last if @last?
@last = str
# Access the value of `attribute` either directly or using `getAttribute` if possible.
attr: (ele, attribute, direct = yes) ->
value = if direct or typeof ele.getAttribute isnt 'function'
ele[attribute]
else
ele.getAttribute attribute
value ? ''
# Append a Markdown line break to the buffer string.
br: ->
@append " #{@left}"
@atLeft = @atNoWS = yes
# Prepare the parser for a `code` element.
code: ->
old = @inCode
@inCode = yes
=> @inCode = old
# Determine whether the specified element has the `attribute` provided either directory or using
# `hasAttribute` if possible.
has: (ele, attribute, direct = yes) ->
if direct or typeof ele.hasAttribute isnt 'function'
ele.hasOwnProperty attribute
else
ele.hasAttribute attribute
# Replace any special characters that can cause problems within code sections.
inCodeProcess: (str) ->
str.replace /`/g, '\\`'
# Determine whether or not the specified element is visible based on its CSS style.
isVisible: (ele) ->
style = @attr ele, 'style', no
properties = style?.match? R_HIDDEN_STYLES
visible = yes
# Test all relevant CSS properties for possible hiding behaviours.
if properties?
visible = not R_HIDDEN_VALUE.test property for property in properties
# Attempt to derive elements visibility based on its computed CSS style where appropriate.
if visible and typeof @win.getComputedStyle is 'function'
try
style = @win.getComputedStyle ele, null
if typeof style?.getPropertyValue is 'function'
display = style.getPropertyValue 'display'
visibility = style.getPropertyValue 'visibility'
visible = display isnt 'none' and visibility isnt 'hidden'
catch err
@thrown err, 'getComputedStyle'
visible
# Append a Markdown list item based on the context of the current list.
li: ->
str = if @inOrderedList then "#{@order++}. " else '* '
str = padLeft str, (@listDepth - 1) * 2
@append str
# Replace any special characters that can cause problems in normal Markdown blocks.
nonPreProcess: (str) ->
str = str.replace /\n([ \t]*\n)+/g, '\n'
str = str.replace /\n[ \t]+/g, '\n'
str = str.replace /[ \t]+/g, ' '
str = str.replace REGEX[key], value for own key, value of REPLACEMENTS
str
# Prepare the parser for an `ol` element.
ol: ->
do @p if @listDepth is 0
inOrderedList = @inOrderedList
order = @order
@inOrderedList = yes
@order = 1
@listDepth++
=>
@inOrderedList = inOrderedList
@order = order
@listDepth--
# Append `str` to the buffer string.
output: (str) ->
return unless str
# Strip leading whitespace when code blocks accordingly.
unless @inPre
str = if @atNoWS
str.replace /^[ \t\n]+/, ''
else if /^[ \t]*\n/.test str
str.replace /^[ \t\n]+/, '\n'
else
str.replace /^[ \t]+/, ' '
return if str is ''
# Ensure this parser is in the correct context.
@atP = /\n\n$/.test str
@atLeft = /\n$/.test str
@atNoWS = /[ \t\n]$/.test str
@append str.replace /\n/g, @left
# Create a function that can be called later to append `str` to the buffer string while keeping
# the parser in context.
# This function is just a lazy shorthand.
outputLater: (str) ->
=> @output str
# Append a Markdown paragraph section to the buffer string.
p: ->
return if @atP
unless @atLeft
@append @left
@atLeft = yes
@append @left
@atNoWS = @atP = yes
# Parse the configured HTML into valid Markdown.
parse: ->
@buffer = ''
return @buffer unless @html
# Create a wrapper element to insert the configured HTML into.
container = @win.document.createElement 'div'
if typeof @html is 'string'
container.innerHTML = @html
else
container.appendChild @html
# Process the contents (i.e. the preconfigured HTML) of the wrapper element.
@process container
# Ensure all link references are correctly appended to be end of the buffer string.
if @links.length
@append '\n\n'
@append "[#{i}]: #{link}\n" for link, i in @links when link
# This isn't nice and I wouldn't really recommend users use this option but, when `debug` is
# enabled, output all debug information either to the console (e.g. `stdout` in node).
if @options.debug
# List any tags that were ignored during processing.
unhandledTags = (tag for own tag of @unhandled).sort()
console.log if unhandledTags.length
"""
Ignored tags;
#{unhandledTags.join ', '}
"""
else
'No tags were ignored'
# List any exceptions that were caught (and swallowed) during processing.
console.log if @exceptions.length
"""
Exceptions;
#{@exceptions.join '\n'}
"""
else
'No exceptions were thrown'
# End the buffer string cleanly and we're done!
@append ''
@buffer = trim @buffer
# Prepare the parser for a `pre` element.
pre: ->
old = @inPre
@inPre = yes
=> @inPre = old
# Parse the specified element and append the generated Markdown to the buffer string.
process: (ele) ->
# Only *visible* elements are processed. Doing our best to identify those that are hidden.
return unless @isVisible ele
if ele.nodeType is @win.Node.ELEMENT_NODE
# Handle typical node elements (e.g. `<span>foo bar</span>`).
skipChildren = no
# Determine the best way (if any) to handle `ele`.
try
if R_IGNORE_CHILDREN.test ele.tagName
# Don't process the element or any of its children.
skipChildren = yes
else if /^H[1-6]$/.test ele.tagName
# Convert HTML headers (e.g. `h3`) to their Markdown equivalents (e.g. `###`).
level = parseInt ele.tagName.match(/([1-6])$/)[1]
do @p
@output "#{('#' for i in [1..level]).join ''} "
else if R_PARAGRAPH_ONLY.test ele.tagName
# Paragraphs are easy as Pi.
do @p
else
switch ele.tagName
# Ignore the element, but we still want to process their children (obviously).
when 'BODY', 'FORM' then break
# Can be a simple paragraph but, if `ele` doesn't have an `open` attribute specified,
# we don't want to process anything other than the first nested `summary` element.
when 'DETAILS'
do @p
unless @has ele, 'open', no
skipChildren = yes
summary = ele.getElementsByTagName('summary')[0]
@process summary if summary
# Easiest of the bunch... just a Markdown line break.
when 'BR' then do @br
# Insert a horizontal ruler padded on before and after.
when 'HR'
do @p
@output '---'
do @p
# Any element that is commonly displayed in italics as well as `U` (i.e. underline)
# since vanilla Markdown does not support this but the site did try to highlight the
# contents.
when 'CITE', 'DFN', 'EM', 'I', 'U', 'VAR'
@output '_'
@atNoWS = yes
after = @outputLater '_'
# Any element that is commonly display in bold.
when 'DT', 'B', 'STRONG'
do @p if ele.tagName is 'DT'
@output '**'
@atNoWS = yes
after = @outputLater '**'
# Uncommon element but just wrap its contens in quotation marks. Job done!
when 'Q'
@output '"'
@atNoWS = yes
after = @outputLater '"'
# Lists need their items to be displayed correctly depending on their type while also
# ensuring nested lists are indented properly.
when 'OL', 'UL'
after = if ele.tagName is 'OL' then do @ol else do @ul
# List items are displayed differently depending on what kind of list they're parent
# is (i.e. ordered or unordered).
when 'LI'
@replaceLeft '\n'
do @li
# A pre-formatted element just needs to have its contents properly indented.
when 'PRE'
after1 = @pushLeft ' '
after2 = do @pre
after = ->
do after1
do after2
# Inline code elements translate pretty easily but we need to make sure we don't do
# anything dumb inside a `pre` element.
when 'CODE', 'KBD', 'SAMP'
break if @inPre
@output '`'
after1 = do @code
after2 = @outputLater '`'
after = ->
do after1
do after2
# Block quotes (and similar elements) are relatively straight forward.
when 'BLOCKQUOTE', 'DD' then after = @pushLeft '> '
# Links on the other hand are probably the trickiest.
when 'A'
# Extract the link URL from `ele`.
# Links with no URLs are treated just like text-containing elements (e.g. `span`).
# `a.href` always returns an absolute URL while `a.getAttribute('href')` always
# returns the exact value of the `href` attribute. For this reason we need to be sure
# that we extract the URL correctly based on the state of the `absolute` option.
href = @attr ele, 'href', @options.absolute
break unless href
# Be sure to include the title after each link reference that will be displayed at
# the end of the Markdown output, where possible.
title = @attr ele, 'title'
href += " \"#{title}\"" if title
# Determine what style the link should be generated in (i.e. *inline* or
# *reference*) depending on the state of the `inline` option.
suffix = if @options.inline
# *Inline* style means all links have their URLs (and possible titles) included
# immediately after their contents (e.g.
# `[my link](/path/to/page.html "My title")`).
"(#{href})"
else
# *Reference* style means all links have an index included immediately after their
# contents that directly maps to their URL (and possible title) which are displayed
# at the end of the buffer string (e.g. `[my link][0]` and then later
# `[0]: /path/to/page.html "My title"`).
# Duplicate link/title combination references are avoided for a cleaner result.
"[#{@linkMap[href] ?= @links.push(href) - 1}]"
@output '['
@atNoWS = yes
after = @outputLater "]#{suffix}"
# Images are very similar to links, just without the added complexity of references.
when 'IMG'
# Extract the image URL from `ele`.
# Unlike links, any image without a URL is just ignored. Obviously, any contents of
# an `img` element are always ignored since they can never contain anything valid.
# `img.src` always returns an absolute URL while `img.getAttribute('src')` always
# returns the exact value of the `src` attribute. For this reason we need to be sure
# that we extract the URL correctly based on the state of the `absolute` option.
skipChildren = yes
src = @attr ele, 'src', @options.absolute
break unless src
@output ""
# Frames are **HELL** (fact!), but we'll do our best to support their contents.
when 'FRAME', 'IFRAME'
skipChildren = yes
try
if ele.contentDocument?.documentElement
@process ele.contentDocument.documentElement
catch err
@thrown err, 'contentDocument'
# Table rows should just be separated, that's all.
when 'TR' then after = @p
# Couldn't find a suitable match for `ele` so let's ignore it, but we'll still process
# any children it has.
else
@unhandled[ele.tagName] = null if @options.debug
catch err
@thrown err, ele.tagName
# Process all child elements of `ele` if it has any and we've not been told to ignore them.
@process childNode for childNode in ele.childNodes unless skipChildren
# Ensure any callback are invoked being proceeding **if** they are specified.
after?.call this
else if ele.nodeType is @win.Node.TEXT_NODE
# Handle simple text nodes (e.g. `"foo bar"`) according to the current context.
@output if @inPre
ele.nodeValue
else if @inCode
@inCodeProcess ele.nodeValue
else
@nonPreProcess ele.nodeValue
# Attach `str` to the start of the current line.
pushLeft: (str) ->
old = @left
@left += str
if @atP then @append str else do @p
=>
@left = old
@atLeft = @atP = no
do @p
# Replace the left indent with `str`.
replaceLeft: (str) ->
unless @atLeft
@append @left.replace /[ ]{2,4}$/, str
@atLeft = @atNoWS = @atP = yes
else if @last
@last = @last.replace /[ ]{2,4}$/, str
# Ensure that the `exception` and the corresponding `message` is logged if the `debug` option is
# enabled.
thrown: (exception, message) ->
@exceptions.push "#{message}: #{exception}" if @options.debug
# Prepare the parser for a `ul` element.
ul: ->
do @p if @listDepth is 0
inOrderedList = @inOrderedList
order = @order
@inOrderedList = no
@order = 1
@listDepth++
=>
@inOrderedList = inOrderedList
@order = order
@listDepth--
# html.md setup
# -------------
# Build the publicly exposed API.
@md = md = (html, options) ->
new HtmlParser(html, options).parse()
# Export `md` for NodeJS and CommonJS.
if module?.exports
module.exports = md
else if typeof define is 'function' and define.amd
define 'md', -> md
# Public constants
# ----------------
# Current version of html.md.
md.version = md.VERSION = '3.0.2'
# Public functions
# ----------------
# Run html.md in *noConflict* mode, returning the `md` variable to its previous owner.
# Returns a reference to our `md`.
md.noConflict = =>
@md = PREVIOUS_MD
md
| 135771 | # [html.md](http://neocotic.com/html.md)
# (c) 2013 <NAME>
# Freely distributable under the MIT license.
# Based on [Make.text](http://homepage.mac.com/tjim/) 1.5
# (c) 2007 <NAME>
# For all details and documentation:
# <http://neocotic.com/html.md>
# Private constants
# -----------------
# Default option values.
DEFAULT_OPTIONS =
absolute: no
base: if window? then window.document.baseURI else "file://#{process.cwd()}"
debug: no
inline: no
# Save the previous value of the global `md` variable for *noConflict* mode.
PREVIOUS_MD = @md
# Map of replacement strings for *special* Markdown characters.
REPLACEMENTS =
'\\\\': '\\\\'
'\\[': '\\['
'\\]': '\\]'
'>': '\\>'
'_': '\\_'
'\\*': '\\*'
'`': '\\`'
'#': '\\#'
'([0-9])\\.(\\s|$)': '$1\\.$2'
'\u00a9': '(c)'
'\u00ae': '(r)'
'\u2122': '(tm)'
'\u00a0': ' '
'\u00b7': '\\*'
'\u2002': ' '
'\u2003': ' '
'\u2009': ' '
'\u2018': '\''
'\u2019': '\''
'\u201c': '"'
'\u201d': '"'
'\u2026': '...'
'\u2013': '--'
'\u2014': '---'
# Regular expression to extract all `display` and `visibility` CSS properties from an inline style
# attribute.
R_HIDDEN_STYLES = /(display|visibility)\s*:\s*[a-z]+/gi
# Regular expression to check for *hidden* values of CSS properties.
R_HIDDEN_VALUE = /(none|hidden)\s*$/i
# Regular expression to identify elements to be generally ignored, along with their children.
R_IGNORE_CHILDREN = /// ^ (
APPLET
| AREA
| AUDIO
| BUTTON
| CANVAS
| DATALIST
| EMBED
| HEAD
| INPUT
| MAP
| MENU
| METER
| NOFRAMES
| NOSCRIPT
| OBJECT
| OPTGROUP
| OPTION
| PARAM
| PROGRESS
| RP
| RT
| RUBY
| SCRIPT
| SELECT
| STYLE
| TEXTAREA
| TITLE
| VIDEO
) $ ///
# Regular expression to identify elements to be parsed as simple paragraphs.
R_PARAGRAPH_ONLY = /// ^ (
ADDRESS
| ARTICLE
| ASIDE
| DIV
| FIELDSET
| FOOTER
| HEADER
| NAV
| P
| SECTION
) $ ///
# Create a map of regular expressions for all of the *special* Markdown characters to simplify
# access.
REGEX = (
result = {}
result[key] = new RegExp key, 'g' for own key of REPLACEMENTS
result
)
# Helper functions
# ----------------
# Left pad `str` with the given padding string for the specified number of `times`.
padLeft = (str = '', times = 0, padStr = ' ') ->
return str unless padStr
str = padStr + str for i in [0...times]
str
# Remove whitespace from both ends of `str`.
# This tries to use the native `String.prototype.trim` function where possible.
trim = (str = '') ->
if str.trim then str.trim() else str.replace /^\s+|\s+$/g, ''
# HTML Parser
# -----------
# Parses HTML code and/or elements into valid Markdown.
# Elements are parsed recursively, meaning their children are also parsed.
class HtmlParser
# Creates a new `HtmlParser` for the arguments provided.
constructor: (@html = '', @options = {}) ->
@atLeft = @atNoWS = @atP = yes
@buffer = ''
@exceptions = []
@order = 1
@listDepth = 0
@inCode = @inPre = @inOrderedList = no
@last = null
@left = '\n'
@links = []
@linkMap = {}
@unhandled = {}
@options = {} if typeof @options isnt 'object'
# Copy all default option values across to `options` only where they were not specified.
for own key, defaultValue of DEFAULT_OPTIONS
@options[key] = defaultValue if typeof @options[key] is 'undefined'
# Create a DOM if `window` doesn't exist (i.e. when running in node).
@win = window ? null
unless @win?
doc = require('jsdom').jsdom
features: FetchExternalResources: no
url: @options.base
@win = doc.defaultView
# Create the Node constants if Node doesn't exist (i.e. when running in IE < 9).
unless @win.Node?
@win.Node =
ELEMENT_NODE: 1
TEXT_NODE: 3
# Append `str` to the buffer string.
append: (str) ->
@buffer += @last if @last?
@last = str
# Access the value of `attribute` either directly or using `getAttribute` if possible.
attr: (ele, attribute, direct = yes) ->
value = if direct or typeof ele.getAttribute isnt 'function'
ele[attribute]
else
ele.getAttribute attribute
value ? ''
# Append a Markdown line break to the buffer string.
br: ->
@append " #{@left}"
@atLeft = @atNoWS = yes
# Prepare the parser for a `code` element.
code: ->
old = @inCode
@inCode = yes
=> @inCode = old
# Determine whether the specified element has the `attribute` provided either directory or using
# `hasAttribute` if possible.
has: (ele, attribute, direct = yes) ->
if direct or typeof ele.hasAttribute isnt 'function'
ele.hasOwnProperty attribute
else
ele.hasAttribute attribute
# Replace any special characters that can cause problems within code sections.
inCodeProcess: (str) ->
str.replace /`/g, '\\`'
# Determine whether or not the specified element is visible based on its CSS style.
isVisible: (ele) ->
style = @attr ele, 'style', no
properties = style?.match? R_HIDDEN_STYLES
visible = yes
# Test all relevant CSS properties for possible hiding behaviours.
if properties?
visible = not R_HIDDEN_VALUE.test property for property in properties
# Attempt to derive elements visibility based on its computed CSS style where appropriate.
if visible and typeof @win.getComputedStyle is 'function'
try
style = @win.getComputedStyle ele, null
if typeof style?.getPropertyValue is 'function'
display = style.getPropertyValue 'display'
visibility = style.getPropertyValue 'visibility'
visible = display isnt 'none' and visibility isnt 'hidden'
catch err
@thrown err, 'getComputedStyle'
visible
# Append a Markdown list item based on the context of the current list.
li: ->
str = if @inOrderedList then "#{@order++}. " else '* '
str = padLeft str, (@listDepth - 1) * 2
@append str
# Replace any special characters that can cause problems in normal Markdown blocks.
nonPreProcess: (str) ->
str = str.replace /\n([ \t]*\n)+/g, '\n'
str = str.replace /\n[ \t]+/g, '\n'
str = str.replace /[ \t]+/g, ' '
str = str.replace REGEX[key], value for own key, value of REPLACEMENTS
str
# Prepare the parser for an `ol` element.
ol: ->
do @p if @listDepth is 0
inOrderedList = @inOrderedList
order = @order
@inOrderedList = yes
@order = 1
@listDepth++
=>
@inOrderedList = inOrderedList
@order = order
@listDepth--
# Append `str` to the buffer string.
output: (str) ->
return unless str
# Strip leading whitespace when code blocks accordingly.
unless @inPre
str = if @atNoWS
str.replace /^[ \t\n]+/, ''
else if /^[ \t]*\n/.test str
str.replace /^[ \t\n]+/, '\n'
else
str.replace /^[ \t]+/, ' '
return if str is ''
# Ensure this parser is in the correct context.
@atP = /\n\n$/.test str
@atLeft = /\n$/.test str
@atNoWS = /[ \t\n]$/.test str
@append str.replace /\n/g, @left
# Create a function that can be called later to append `str` to the buffer string while keeping
# the parser in context.
# This function is just a lazy shorthand.
outputLater: (str) ->
=> @output str
# Append a Markdown paragraph section to the buffer string.
p: ->
return if @atP
unless @atLeft
@append @left
@atLeft = yes
@append @left
@atNoWS = @atP = yes
# Parse the configured HTML into valid Markdown.
parse: ->
@buffer = ''
return @buffer unless @html
# Create a wrapper element to insert the configured HTML into.
container = @win.document.createElement 'div'
if typeof @html is 'string'
container.innerHTML = @html
else
container.appendChild @html
# Process the contents (i.e. the preconfigured HTML) of the wrapper element.
@process container
# Ensure all link references are correctly appended to be end of the buffer string.
if @links.length
@append '\n\n'
@append "[#{i}]: #{link}\n" for link, i in @links when link
# This isn't nice and I wouldn't really recommend users use this option but, when `debug` is
# enabled, output all debug information either to the console (e.g. `stdout` in node).
if @options.debug
# List any tags that were ignored during processing.
unhandledTags = (tag for own tag of @unhandled).sort()
console.log if unhandledTags.length
"""
Ignored tags;
#{unhandledTags.join ', '}
"""
else
'No tags were ignored'
# List any exceptions that were caught (and swallowed) during processing.
console.log if @exceptions.length
"""
Exceptions;
#{@exceptions.join '\n'}
"""
else
'No exceptions were thrown'
# End the buffer string cleanly and we're done!
@append ''
@buffer = trim @buffer
# Prepare the parser for a `pre` element.
pre: ->
old = @inPre
@inPre = yes
=> @inPre = old
# Parse the specified element and append the generated Markdown to the buffer string.
process: (ele) ->
# Only *visible* elements are processed. Doing our best to identify those that are hidden.
return unless @isVisible ele
if ele.nodeType is @win.Node.ELEMENT_NODE
# Handle typical node elements (e.g. `<span>foo bar</span>`).
skipChildren = no
# Determine the best way (if any) to handle `ele`.
try
if R_IGNORE_CHILDREN.test ele.tagName
# Don't process the element or any of its children.
skipChildren = yes
else if /^H[1-6]$/.test ele.tagName
# Convert HTML headers (e.g. `h3`) to their Markdown equivalents (e.g. `###`).
level = parseInt ele.tagName.match(/([1-6])$/)[1]
do @p
@output "#{('#' for i in [1..level]).join ''} "
else if R_PARAGRAPH_ONLY.test ele.tagName
# Paragraphs are easy as Pi.
do @p
else
switch ele.tagName
# Ignore the element, but we still want to process their children (obviously).
when 'BODY', 'FORM' then break
# Can be a simple paragraph but, if `ele` doesn't have an `open` attribute specified,
# we don't want to process anything other than the first nested `summary` element.
when 'DETAILS'
do @p
unless @has ele, 'open', no
skipChildren = yes
summary = ele.getElementsByTagName('summary')[0]
@process summary if summary
# Easiest of the bunch... just a Markdown line break.
when 'BR' then do @br
# Insert a horizontal ruler padded on before and after.
when 'HR'
do @p
@output '---'
do @p
# Any element that is commonly displayed in italics as well as `U` (i.e. underline)
# since vanilla Markdown does not support this but the site did try to highlight the
# contents.
when 'CITE', 'DFN', 'EM', 'I', 'U', 'VAR'
@output '_'
@atNoWS = yes
after = @outputLater '_'
# Any element that is commonly display in bold.
when 'DT', 'B', 'STRONG'
do @p if ele.tagName is 'DT'
@output '**'
@atNoWS = yes
after = @outputLater '**'
# Uncommon element but just wrap its contens in quotation marks. Job done!
when 'Q'
@output '"'
@atNoWS = yes
after = @outputLater '"'
# Lists need their items to be displayed correctly depending on their type while also
# ensuring nested lists are indented properly.
when 'OL', 'UL'
after = if ele.tagName is 'OL' then do @ol else do @ul
# List items are displayed differently depending on what kind of list they're parent
# is (i.e. ordered or unordered).
when 'LI'
@replaceLeft '\n'
do @li
# A pre-formatted element just needs to have its contents properly indented.
when 'PRE'
after1 = @pushLeft ' '
after2 = do @pre
after = ->
do after1
do after2
# Inline code elements translate pretty easily but we need to make sure we don't do
# anything dumb inside a `pre` element.
when 'CODE', 'KBD', 'SAMP'
break if @inPre
@output '`'
after1 = do @code
after2 = @outputLater '`'
after = ->
do after1
do after2
# Block quotes (and similar elements) are relatively straight forward.
when 'BLOCKQUOTE', 'DD' then after = @pushLeft '> '
# Links on the other hand are probably the trickiest.
when 'A'
# Extract the link URL from `ele`.
# Links with no URLs are treated just like text-containing elements (e.g. `span`).
# `a.href` always returns an absolute URL while `a.getAttribute('href')` always
# returns the exact value of the `href` attribute. For this reason we need to be sure
# that we extract the URL correctly based on the state of the `absolute` option.
href = @attr ele, 'href', @options.absolute
break unless href
# Be sure to include the title after each link reference that will be displayed at
# the end of the Markdown output, where possible.
title = @attr ele, 'title'
href += " \"#{title}\"" if title
# Determine what style the link should be generated in (i.e. *inline* or
# *reference*) depending on the state of the `inline` option.
suffix = if @options.inline
# *Inline* style means all links have their URLs (and possible titles) included
# immediately after their contents (e.g.
# `[my link](/path/to/page.html "My title")`).
"(#{href})"
else
# *Reference* style means all links have an index included immediately after their
# contents that directly maps to their URL (and possible title) which are displayed
# at the end of the buffer string (e.g. `[my link][0]` and then later
# `[0]: /path/to/page.html "My title"`).
# Duplicate link/title combination references are avoided for a cleaner result.
"[#{@linkMap[href] ?= @links.push(href) - 1}]"
@output '['
@atNoWS = yes
after = @outputLater "]#{suffix}"
# Images are very similar to links, just without the added complexity of references.
when 'IMG'
# Extract the image URL from `ele`.
# Unlike links, any image without a URL is just ignored. Obviously, any contents of
# an `img` element are always ignored since they can never contain anything valid.
# `img.src` always returns an absolute URL while `img.getAttribute('src')` always
# returns the exact value of the `src` attribute. For this reason we need to be sure
# that we extract the URL correctly based on the state of the `absolute` option.
skipChildren = yes
src = @attr ele, 'src', @options.absolute
break unless src
@output ""
# Frames are **HELL** (fact!), but we'll do our best to support their contents.
when 'FRAME', 'IFRAME'
skipChildren = yes
try
if ele.contentDocument?.documentElement
@process ele.contentDocument.documentElement
catch err
@thrown err, 'contentDocument'
# Table rows should just be separated, that's all.
when 'TR' then after = @p
# Couldn't find a suitable match for `ele` so let's ignore it, but we'll still process
# any children it has.
else
@unhandled[ele.tagName] = null if @options.debug
catch err
@thrown err, ele.tagName
# Process all child elements of `ele` if it has any and we've not been told to ignore them.
@process childNode for childNode in ele.childNodes unless skipChildren
# Ensure any callback are invoked being proceeding **if** they are specified.
after?.call this
else if ele.nodeType is @win.Node.TEXT_NODE
# Handle simple text nodes (e.g. `"foo bar"`) according to the current context.
@output if @inPre
ele.nodeValue
else if @inCode
@inCodeProcess ele.nodeValue
else
@nonPreProcess ele.nodeValue
# Attach `str` to the start of the current line.
pushLeft: (str) ->
old = @left
@left += str
if @atP then @append str else do @p
=>
@left = old
@atLeft = @atP = no
do @p
# Replace the left indent with `str`.
replaceLeft: (str) ->
unless @atLeft
@append @left.replace /[ ]{2,4}$/, str
@atLeft = @atNoWS = @atP = yes
else if @last
@last = @last.replace /[ ]{2,4}$/, str
# Ensure that the `exception` and the corresponding `message` is logged if the `debug` option is
# enabled.
thrown: (exception, message) ->
@exceptions.push "#{message}: #{exception}" if @options.debug
# Prepare the parser for a `ul` element.
ul: ->
do @p if @listDepth is 0
inOrderedList = @inOrderedList
order = @order
@inOrderedList = no
@order = 1
@listDepth++
=>
@inOrderedList = inOrderedList
@order = order
@listDepth--
# html.md setup
# -------------
# Build the publicly exposed API.
@md = md = (html, options) ->
new HtmlParser(html, options).parse()
# Export `md` for NodeJS and CommonJS.
if module?.exports
module.exports = md
else if typeof define is 'function' and define.amd
define 'md', -> md
# Public constants
# ----------------
# Current version of html.md.
md.version = md.VERSION = '3.0.2'
# Public functions
# ----------------
# Run html.md in *noConflict* mode, returning the `md` variable to its previous owner.
# Returns a reference to our `md`.
md.noConflict = =>
@md = PREVIOUS_MD
md
| true | # [html.md](http://neocotic.com/html.md)
# (c) 2013 PI:NAME:<NAME>END_PI
# Freely distributable under the MIT license.
# Based on [Make.text](http://homepage.mac.com/tjim/) 1.5
# (c) 2007 PI:NAME:<NAME>END_PI
# For all details and documentation:
# <http://neocotic.com/html.md>
# Private constants
# -----------------
# Default option values.
DEFAULT_OPTIONS =
absolute: no
base: if window? then window.document.baseURI else "file://#{process.cwd()}"
debug: no
inline: no
# Save the previous value of the global `md` variable for *noConflict* mode.
PREVIOUS_MD = @md
# Map of replacement strings for *special* Markdown characters.
REPLACEMENTS =
'\\\\': '\\\\'
'\\[': '\\['
'\\]': '\\]'
'>': '\\>'
'_': '\\_'
'\\*': '\\*'
'`': '\\`'
'#': '\\#'
'([0-9])\\.(\\s|$)': '$1\\.$2'
'\u00a9': '(c)'
'\u00ae': '(r)'
'\u2122': '(tm)'
'\u00a0': ' '
'\u00b7': '\\*'
'\u2002': ' '
'\u2003': ' '
'\u2009': ' '
'\u2018': '\''
'\u2019': '\''
'\u201c': '"'
'\u201d': '"'
'\u2026': '...'
'\u2013': '--'
'\u2014': '---'
# Regular expression to extract all `display` and `visibility` CSS properties from an inline style
# attribute.
R_HIDDEN_STYLES = /(display|visibility)\s*:\s*[a-z]+/gi
# Regular expression to check for *hidden* values of CSS properties.
R_HIDDEN_VALUE = /(none|hidden)\s*$/i
# Regular expression to identify elements to be generally ignored, along with their children.
R_IGNORE_CHILDREN = /// ^ (
APPLET
| AREA
| AUDIO
| BUTTON
| CANVAS
| DATALIST
| EMBED
| HEAD
| INPUT
| MAP
| MENU
| METER
| NOFRAMES
| NOSCRIPT
| OBJECT
| OPTGROUP
| OPTION
| PARAM
| PROGRESS
| RP
| RT
| RUBY
| SCRIPT
| SELECT
| STYLE
| TEXTAREA
| TITLE
| VIDEO
) $ ///
# Regular expression to identify elements to be parsed as simple paragraphs.
R_PARAGRAPH_ONLY = /// ^ (
ADDRESS
| ARTICLE
| ASIDE
| DIV
| FIELDSET
| FOOTER
| HEADER
| NAV
| P
| SECTION
) $ ///
# Create a map of regular expressions for all of the *special* Markdown characters to simplify
# access.
REGEX = (
result = {}
result[key] = new RegExp key, 'g' for own key of REPLACEMENTS
result
)
# Helper functions
# ----------------
# Left pad `str` with the given padding string for the specified number of `times`.
padLeft = (str = '', times = 0, padStr = ' ') ->
return str unless padStr
str = padStr + str for i in [0...times]
str
# Remove whitespace from both ends of `str`.
# This tries to use the native `String.prototype.trim` function where possible.
trim = (str = '') ->
if str.trim then str.trim() else str.replace /^\s+|\s+$/g, ''
# HTML Parser
# -----------
# Parses HTML code and/or elements into valid Markdown.
# Elements are parsed recursively, meaning their children are also parsed.
class HtmlParser
# Creates a new `HtmlParser` for the arguments provided.
constructor: (@html = '', @options = {}) ->
@atLeft = @atNoWS = @atP = yes
@buffer = ''
@exceptions = []
@order = 1
@listDepth = 0
@inCode = @inPre = @inOrderedList = no
@last = null
@left = '\n'
@links = []
@linkMap = {}
@unhandled = {}
@options = {} if typeof @options isnt 'object'
# Copy all default option values across to `options` only where they were not specified.
for own key, defaultValue of DEFAULT_OPTIONS
@options[key] = defaultValue if typeof @options[key] is 'undefined'
# Create a DOM if `window` doesn't exist (i.e. when running in node).
@win = window ? null
unless @win?
doc = require('jsdom').jsdom
features: FetchExternalResources: no
url: @options.base
@win = doc.defaultView
# Create the Node constants if Node doesn't exist (i.e. when running in IE < 9).
unless @win.Node?
@win.Node =
ELEMENT_NODE: 1
TEXT_NODE: 3
# Append `str` to the buffer string.
append: (str) ->
@buffer += @last if @last?
@last = str
# Access the value of `attribute` either directly or using `getAttribute` if possible.
attr: (ele, attribute, direct = yes) ->
value = if direct or typeof ele.getAttribute isnt 'function'
ele[attribute]
else
ele.getAttribute attribute
value ? ''
# Append a Markdown line break to the buffer string.
br: ->
@append " #{@left}"
@atLeft = @atNoWS = yes
# Prepare the parser for a `code` element.
code: ->
old = @inCode
@inCode = yes
=> @inCode = old
# Determine whether the specified element has the `attribute` provided either directory or using
# `hasAttribute` if possible.
has: (ele, attribute, direct = yes) ->
if direct or typeof ele.hasAttribute isnt 'function'
ele.hasOwnProperty attribute
else
ele.hasAttribute attribute
# Replace any special characters that can cause problems within code sections.
inCodeProcess: (str) ->
str.replace /`/g, '\\`'
# Determine whether or not the specified element is visible based on its CSS style.
isVisible: (ele) ->
style = @attr ele, 'style', no
properties = style?.match? R_HIDDEN_STYLES
visible = yes
# Test all relevant CSS properties for possible hiding behaviours.
if properties?
visible = not R_HIDDEN_VALUE.test property for property in properties
# Attempt to derive elements visibility based on its computed CSS style where appropriate.
if visible and typeof @win.getComputedStyle is 'function'
try
style = @win.getComputedStyle ele, null
if typeof style?.getPropertyValue is 'function'
display = style.getPropertyValue 'display'
visibility = style.getPropertyValue 'visibility'
visible = display isnt 'none' and visibility isnt 'hidden'
catch err
@thrown err, 'getComputedStyle'
visible
# Append a Markdown list item based on the context of the current list.
li: ->
str = if @inOrderedList then "#{@order++}. " else '* '
str = padLeft str, (@listDepth - 1) * 2
@append str
# Replace any special characters that can cause problems in normal Markdown blocks.
nonPreProcess: (str) ->
str = str.replace /\n([ \t]*\n)+/g, '\n'
str = str.replace /\n[ \t]+/g, '\n'
str = str.replace /[ \t]+/g, ' '
str = str.replace REGEX[key], value for own key, value of REPLACEMENTS
str
# Prepare the parser for an `ol` element.
ol: ->
do @p if @listDepth is 0
inOrderedList = @inOrderedList
order = @order
@inOrderedList = yes
@order = 1
@listDepth++
=>
@inOrderedList = inOrderedList
@order = order
@listDepth--
# Append `str` to the buffer string.
output: (str) ->
return unless str
# Strip leading whitespace when code blocks accordingly.
unless @inPre
str = if @atNoWS
str.replace /^[ \t\n]+/, ''
else if /^[ \t]*\n/.test str
str.replace /^[ \t\n]+/, '\n'
else
str.replace /^[ \t]+/, ' '
return if str is ''
# Ensure this parser is in the correct context.
@atP = /\n\n$/.test str
@atLeft = /\n$/.test str
@atNoWS = /[ \t\n]$/.test str
@append str.replace /\n/g, @left
# Create a function that can be called later to append `str` to the buffer string while keeping
# the parser in context.
# This function is just a lazy shorthand.
outputLater: (str) ->
=> @output str
# Append a Markdown paragraph section to the buffer string.
p: ->
return if @atP
unless @atLeft
@append @left
@atLeft = yes
@append @left
@atNoWS = @atP = yes
# Parse the configured HTML into valid Markdown.
parse: ->
@buffer = ''
return @buffer unless @html
# Create a wrapper element to insert the configured HTML into.
container = @win.document.createElement 'div'
if typeof @html is 'string'
container.innerHTML = @html
else
container.appendChild @html
# Process the contents (i.e. the preconfigured HTML) of the wrapper element.
@process container
# Ensure all link references are correctly appended to be end of the buffer string.
if @links.length
@append '\n\n'
@append "[#{i}]: #{link}\n" for link, i in @links when link
# This isn't nice and I wouldn't really recommend users use this option but, when `debug` is
# enabled, output all debug information either to the console (e.g. `stdout` in node).
if @options.debug
# List any tags that were ignored during processing.
unhandledTags = (tag for own tag of @unhandled).sort()
console.log if unhandledTags.length
"""
Ignored tags;
#{unhandledTags.join ', '}
"""
else
'No tags were ignored'
# List any exceptions that were caught (and swallowed) during processing.
console.log if @exceptions.length
"""
Exceptions;
#{@exceptions.join '\n'}
"""
else
'No exceptions were thrown'
# End the buffer string cleanly and we're done!
@append ''
@buffer = trim @buffer
# Prepare the parser for a `pre` element.
pre: ->
old = @inPre
@inPre = yes
=> @inPre = old
# Parse the specified element and append the generated Markdown to the buffer string.
process: (ele) ->
# Only *visible* elements are processed. Doing our best to identify those that are hidden.
return unless @isVisible ele
if ele.nodeType is @win.Node.ELEMENT_NODE
# Handle typical node elements (e.g. `<span>foo bar</span>`).
skipChildren = no
# Determine the best way (if any) to handle `ele`.
try
if R_IGNORE_CHILDREN.test ele.tagName
# Don't process the element or any of its children.
skipChildren = yes
else if /^H[1-6]$/.test ele.tagName
# Convert HTML headers (e.g. `h3`) to their Markdown equivalents (e.g. `###`).
level = parseInt ele.tagName.match(/([1-6])$/)[1]
do @p
@output "#{('#' for i in [1..level]).join ''} "
else if R_PARAGRAPH_ONLY.test ele.tagName
# Paragraphs are easy as Pi.
do @p
else
switch ele.tagName
# Ignore the element, but we still want to process their children (obviously).
when 'BODY', 'FORM' then break
# Can be a simple paragraph but, if `ele` doesn't have an `open` attribute specified,
# we don't want to process anything other than the first nested `summary` element.
when 'DETAILS'
do @p
unless @has ele, 'open', no
skipChildren = yes
summary = ele.getElementsByTagName('summary')[0]
@process summary if summary
# Easiest of the bunch... just a Markdown line break.
when 'BR' then do @br
# Insert a horizontal ruler padded on before and after.
when 'HR'
do @p
@output '---'
do @p
# Any element that is commonly displayed in italics as well as `U` (i.e. underline)
# since vanilla Markdown does not support this but the site did try to highlight the
# contents.
when 'CITE', 'DFN', 'EM', 'I', 'U', 'VAR'
@output '_'
@atNoWS = yes
after = @outputLater '_'
# Any element that is commonly display in bold.
when 'DT', 'B', 'STRONG'
do @p if ele.tagName is 'DT'
@output '**'
@atNoWS = yes
after = @outputLater '**'
# Uncommon element but just wrap its contens in quotation marks. Job done!
when 'Q'
@output '"'
@atNoWS = yes
after = @outputLater '"'
# Lists need their items to be displayed correctly depending on their type while also
# ensuring nested lists are indented properly.
when 'OL', 'UL'
after = if ele.tagName is 'OL' then do @ol else do @ul
# List items are displayed differently depending on what kind of list they're parent
# is (i.e. ordered or unordered).
when 'LI'
@replaceLeft '\n'
do @li
# A pre-formatted element just needs to have its contents properly indented.
when 'PRE'
after1 = @pushLeft ' '
after2 = do @pre
after = ->
do after1
do after2
# Inline code elements translate pretty easily but we need to make sure we don't do
# anything dumb inside a `pre` element.
when 'CODE', 'KBD', 'SAMP'
break if @inPre
@output '`'
after1 = do @code
after2 = @outputLater '`'
after = ->
do after1
do after2
# Block quotes (and similar elements) are relatively straight forward.
when 'BLOCKQUOTE', 'DD' then after = @pushLeft '> '
# Links on the other hand are probably the trickiest.
when 'A'
# Extract the link URL from `ele`.
# Links with no URLs are treated just like text-containing elements (e.g. `span`).
# `a.href` always returns an absolute URL while `a.getAttribute('href')` always
# returns the exact value of the `href` attribute. For this reason we need to be sure
# that we extract the URL correctly based on the state of the `absolute` option.
href = @attr ele, 'href', @options.absolute
break unless href
# Be sure to include the title after each link reference that will be displayed at
# the end of the Markdown output, where possible.
title = @attr ele, 'title'
href += " \"#{title}\"" if title
# Determine what style the link should be generated in (i.e. *inline* or
# *reference*) depending on the state of the `inline` option.
suffix = if @options.inline
# *Inline* style means all links have their URLs (and possible titles) included
# immediately after their contents (e.g.
# `[my link](/path/to/page.html "My title")`).
"(#{href})"
else
# *Reference* style means all links have an index included immediately after their
# contents that directly maps to their URL (and possible title) which are displayed
# at the end of the buffer string (e.g. `[my link][0]` and then later
# `[0]: /path/to/page.html "My title"`).
# Duplicate link/title combination references are avoided for a cleaner result.
"[#{@linkMap[href] ?= @links.push(href) - 1}]"
@output '['
@atNoWS = yes
after = @outputLater "]#{suffix}"
# Images are very similar to links, just without the added complexity of references.
when 'IMG'
# Extract the image URL from `ele`.
# Unlike links, any image without a URL is just ignored. Obviously, any contents of
# an `img` element are always ignored since they can never contain anything valid.
# `img.src` always returns an absolute URL while `img.getAttribute('src')` always
# returns the exact value of the `src` attribute. For this reason we need to be sure
# that we extract the URL correctly based on the state of the `absolute` option.
skipChildren = yes
src = @attr ele, 'src', @options.absolute
break unless src
@output ""
# Frames are **HELL** (fact!), but we'll do our best to support their contents.
when 'FRAME', 'IFRAME'
skipChildren = yes
try
if ele.contentDocument?.documentElement
@process ele.contentDocument.documentElement
catch err
@thrown err, 'contentDocument'
# Table rows should just be separated, that's all.
when 'TR' then after = @p
# Couldn't find a suitable match for `ele` so let's ignore it, but we'll still process
# any children it has.
else
@unhandled[ele.tagName] = null if @options.debug
catch err
@thrown err, ele.tagName
# Process all child elements of `ele` if it has any and we've not been told to ignore them.
@process childNode for childNode in ele.childNodes unless skipChildren
# Ensure any callback are invoked being proceeding **if** they are specified.
after?.call this
else if ele.nodeType is @win.Node.TEXT_NODE
# Handle simple text nodes (e.g. `"foo bar"`) according to the current context.
@output if @inPre
ele.nodeValue
else if @inCode
@inCodeProcess ele.nodeValue
else
@nonPreProcess ele.nodeValue
# Attach `str` to the start of the current line.
pushLeft: (str) ->
old = @left
@left += str
if @atP then @append str else do @p
=>
@left = old
@atLeft = @atP = no
do @p
# Replace the left indent with `str`.
replaceLeft: (str) ->
unless @atLeft
@append @left.replace /[ ]{2,4}$/, str
@atLeft = @atNoWS = @atP = yes
else if @last
@last = @last.replace /[ ]{2,4}$/, str
# Ensure that the `exception` and the corresponding `message` is logged if the `debug` option is
# enabled.
thrown: (exception, message) ->
@exceptions.push "#{message}: #{exception}" if @options.debug
# Prepare the parser for a `ul` element.
ul: ->
do @p if @listDepth is 0
inOrderedList = @inOrderedList
order = @order
@inOrderedList = no
@order = 1
@listDepth++
=>
@inOrderedList = inOrderedList
@order = order
@listDepth--
# html.md setup
# -------------
# Build the publicly exposed API.
@md = md = (html, options) ->
new HtmlParser(html, options).parse()
# Export `md` for NodeJS and CommonJS.
if module?.exports
module.exports = md
else if typeof define is 'function' and define.amd
define 'md', -> md
# Public constants
# ----------------
# Current version of html.md.
md.version = md.VERSION = '3.0.2'
# Public functions
# ----------------
# Run html.md in *noConflict* mode, returning the `md` variable to its previous owner.
# Returns a reference to our `md`.
md.noConflict = =>
@md = PREVIOUS_MD
md
|
[
{
"context": " extensions unit tests\n#\n# Copyright (C) 2011-2013 Nikolay Nemshilov\n#\nLovely = require('lovely')\n{Test, assert} = Lov",
"end": 82,
"score": 0.9998891353607178,
"start": 65,
"tag": "NAME",
"value": "Nikolay Nemshilov"
}
] | stl/lang/test/string_test.coffee | lovely-io/lovely.io-stl | 2 | #
# The string extensions unit tests
#
# Copyright (C) 2011-2013 Nikolay Nemshilov
#
Lovely = require('lovely')
{Test, assert} = Lovely
eval(Test.build)
describe "String extensions", ->
describe "#empty()", ->
it "should return 'true' for an empty string", ->
assert.isTrue "".empty()
it "should return 'false' for non-empty string", ->
assert.isFalse "boo".empty()
it "should return 'false' for a string with blanks only", ->
assert.isFalse " ".empty()
describe "#blank()", ->
it "should return 'true' for an empty string", ->
assert.isTrue "".blank()
it "should return 'true' for a string with blanks only", ->
assert.isTrue " \n\t".blank()
it "should return 'false' for a non-blank string", ->
assert.isFalse " boo ".blank()
describe "#trim()", ->
it "should remove staring an ending spaces", ->
assert.equal " boo ".trim(), "boo"
it "should leave a string as is if there are no trailing spaces", ->
assert.equal "boo".trim(), "boo"
describe "#stripTags()", ->
it "should remove all the tags out of the string", ->
assert.equal "<b>boo</b> hoo<hr/>".stripTags(), "boo hoo"
describe "#camelize()", ->
it "should convert an underscored string into a camelcased one", ->
assert.equal "_boo_hoo".camelize(), "BooHoo"
it "should convert a dashed string into a camelized one", ->
assert.equal "-boo-hoo".camelize(), "BooHoo"
describe "#underscored()", ->
it "should convert a camelcazed string into an underscored one", ->
assert.equal "BooHoo".underscored(), "_boo_hoo"
it "should convert a dashed string into an underscored one", ->
assert.equal "-boo-hoo".underscored(), "_boo_hoo"
describe "#dasherize()", ->
it "should convert a camelized string into a dashed one", ->
assert.equal "BooHoo".dasherize(), "-boo-hoo"
it "should convert underscores into dashes", ->
assert.equal "_boo_hoo".dasherize(), "-boo-hoo"
describe "#includes(substring)", ->
it "should return 'true' if a string includes a substring", ->
assert.isTrue "super-duper".includes('super')
assert.isTrue "super-duper".includes('duper')
assert.isTrue "super-duper".includes('er-du')
it "should return 'false' if a string doesn't include given substring", ->
assert.isFalse "super-duper".includes("uber")
describe "#endsWith(substring)", ->
it "should return 'true' when the string ends with a substring", ->
assert.isTrue "super-duper".endsWith("duper")
it "should return 'false' when the string doesn't end with a substring", ->
assert.isFalse "super-duper".endsWith("super")
describe "#startsWith(substring)", ->
it "should return 'true' when the string starts with a substring", ->
assert.isTrue "super-duper".startsWith("super")
it "should return 'false' when the string doesn't starts with a substring", ->
assert.isFalse "super-duper".startsWith("duper")
describe "#toInt()", ->
it "should convert a string into a number", ->
assert.strictEqual "123".toInt(), 123
it "should convert a string into an integer with a custom base", ->
assert.strictEqual "ff".toInt(16), 255
it "should return NaN for an inconvertible strings", ->
assert.ok isNaN("asdf".toInt())
describe "#toFloat()", ->
it "should convert a string into a float number", ->
assert.strictEqual "12.3".toFloat(), 12.3
it "should return NaN for an inconvertible strings", ->
assert.ok isNaN("asdf".toFloat())
| 44812 | #
# The string extensions unit tests
#
# Copyright (C) 2011-2013 <NAME>
#
Lovely = require('lovely')
{Test, assert} = Lovely
eval(Test.build)
describe "String extensions", ->
describe "#empty()", ->
it "should return 'true' for an empty string", ->
assert.isTrue "".empty()
it "should return 'false' for non-empty string", ->
assert.isFalse "boo".empty()
it "should return 'false' for a string with blanks only", ->
assert.isFalse " ".empty()
describe "#blank()", ->
it "should return 'true' for an empty string", ->
assert.isTrue "".blank()
it "should return 'true' for a string with blanks only", ->
assert.isTrue " \n\t".blank()
it "should return 'false' for a non-blank string", ->
assert.isFalse " boo ".blank()
describe "#trim()", ->
it "should remove staring an ending spaces", ->
assert.equal " boo ".trim(), "boo"
it "should leave a string as is if there are no trailing spaces", ->
assert.equal "boo".trim(), "boo"
describe "#stripTags()", ->
it "should remove all the tags out of the string", ->
assert.equal "<b>boo</b> hoo<hr/>".stripTags(), "boo hoo"
describe "#camelize()", ->
it "should convert an underscored string into a camelcased one", ->
assert.equal "_boo_hoo".camelize(), "BooHoo"
it "should convert a dashed string into a camelized one", ->
assert.equal "-boo-hoo".camelize(), "BooHoo"
describe "#underscored()", ->
it "should convert a camelcazed string into an underscored one", ->
assert.equal "BooHoo".underscored(), "_boo_hoo"
it "should convert a dashed string into an underscored one", ->
assert.equal "-boo-hoo".underscored(), "_boo_hoo"
describe "#dasherize()", ->
it "should convert a camelized string into a dashed one", ->
assert.equal "BooHoo".dasherize(), "-boo-hoo"
it "should convert underscores into dashes", ->
assert.equal "_boo_hoo".dasherize(), "-boo-hoo"
describe "#includes(substring)", ->
it "should return 'true' if a string includes a substring", ->
assert.isTrue "super-duper".includes('super')
assert.isTrue "super-duper".includes('duper')
assert.isTrue "super-duper".includes('er-du')
it "should return 'false' if a string doesn't include given substring", ->
assert.isFalse "super-duper".includes("uber")
describe "#endsWith(substring)", ->
it "should return 'true' when the string ends with a substring", ->
assert.isTrue "super-duper".endsWith("duper")
it "should return 'false' when the string doesn't end with a substring", ->
assert.isFalse "super-duper".endsWith("super")
describe "#startsWith(substring)", ->
it "should return 'true' when the string starts with a substring", ->
assert.isTrue "super-duper".startsWith("super")
it "should return 'false' when the string doesn't starts with a substring", ->
assert.isFalse "super-duper".startsWith("duper")
describe "#toInt()", ->
it "should convert a string into a number", ->
assert.strictEqual "123".toInt(), 123
it "should convert a string into an integer with a custom base", ->
assert.strictEqual "ff".toInt(16), 255
it "should return NaN for an inconvertible strings", ->
assert.ok isNaN("asdf".toInt())
describe "#toFloat()", ->
it "should convert a string into a float number", ->
assert.strictEqual "12.3".toFloat(), 12.3
it "should return NaN for an inconvertible strings", ->
assert.ok isNaN("asdf".toFloat())
| true | #
# The string extensions unit tests
#
# Copyright (C) 2011-2013 PI:NAME:<NAME>END_PI
#
Lovely = require('lovely')
{Test, assert} = Lovely
eval(Test.build)
describe "String extensions", ->
describe "#empty()", ->
it "should return 'true' for an empty string", ->
assert.isTrue "".empty()
it "should return 'false' for non-empty string", ->
assert.isFalse "boo".empty()
it "should return 'false' for a string with blanks only", ->
assert.isFalse " ".empty()
describe "#blank()", ->
it "should return 'true' for an empty string", ->
assert.isTrue "".blank()
it "should return 'true' for a string with blanks only", ->
assert.isTrue " \n\t".blank()
it "should return 'false' for a non-blank string", ->
assert.isFalse " boo ".blank()
describe "#trim()", ->
it "should remove staring an ending spaces", ->
assert.equal " boo ".trim(), "boo"
it "should leave a string as is if there are no trailing spaces", ->
assert.equal "boo".trim(), "boo"
describe "#stripTags()", ->
it "should remove all the tags out of the string", ->
assert.equal "<b>boo</b> hoo<hr/>".stripTags(), "boo hoo"
describe "#camelize()", ->
it "should convert an underscored string into a camelcased one", ->
assert.equal "_boo_hoo".camelize(), "BooHoo"
it "should convert a dashed string into a camelized one", ->
assert.equal "-boo-hoo".camelize(), "BooHoo"
describe "#underscored()", ->
it "should convert a camelcazed string into an underscored one", ->
assert.equal "BooHoo".underscored(), "_boo_hoo"
it "should convert a dashed string into an underscored one", ->
assert.equal "-boo-hoo".underscored(), "_boo_hoo"
describe "#dasherize()", ->
it "should convert a camelized string into a dashed one", ->
assert.equal "BooHoo".dasherize(), "-boo-hoo"
it "should convert underscores into dashes", ->
assert.equal "_boo_hoo".dasherize(), "-boo-hoo"
describe "#includes(substring)", ->
it "should return 'true' if a string includes a substring", ->
assert.isTrue "super-duper".includes('super')
assert.isTrue "super-duper".includes('duper')
assert.isTrue "super-duper".includes('er-du')
it "should return 'false' if a string doesn't include given substring", ->
assert.isFalse "super-duper".includes("uber")
describe "#endsWith(substring)", ->
it "should return 'true' when the string ends with a substring", ->
assert.isTrue "super-duper".endsWith("duper")
it "should return 'false' when the string doesn't end with a substring", ->
assert.isFalse "super-duper".endsWith("super")
describe "#startsWith(substring)", ->
it "should return 'true' when the string starts with a substring", ->
assert.isTrue "super-duper".startsWith("super")
it "should return 'false' when the string doesn't starts with a substring", ->
assert.isFalse "super-duper".startsWith("duper")
describe "#toInt()", ->
it "should convert a string into a number", ->
assert.strictEqual "123".toInt(), 123
it "should convert a string into an integer with a custom base", ->
assert.strictEqual "ff".toInt(16), 255
it "should return NaN for an inconvertible strings", ->
assert.ok isNaN("asdf".toInt())
describe "#toFloat()", ->
it "should convert a string into a float number", ->
assert.strictEqual "12.3".toFloat(), 12.3
it "should return NaN for an inconvertible strings", ->
assert.ok isNaN("asdf".toFloat())
|
[
{
"context": "#### Copyrights\n# (c) 2013 Eikichi Yamaguchi\n# kazitori.js may be freely distributed under the",
"end": 44,
"score": 0.9998761415481567,
"start": 27,
"tag": "NAME",
"value": "Eikichi Yamaguchi"
},
{
"context": ".hageee.net\n\n# inspired from::\n# (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.\n# Backbone may be freely ",
"end": 186,
"score": 0.9998934864997864,
"start": 171,
"tag": "NAME",
"value": "Jeremy Ashkenas"
}
] | src/coffee/kazitori.coffee | glassesfactory/kazitori.js | 17 | #### Copyrights
# (c) 2013 Eikichi Yamaguchi
# kazitori.js may be freely distributed under the MIT license.
# http://dev.hageee.net
# inspired from::
# (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
# Backbone may be freely distributed under the MIT license.
# For all details and documentation:
# http://backbonejs.org
#
#----------------------------------------------
#delegate
delegater = (target, func)->
return ()->
func.apply(target, arguments)
#regexps
trailingSlash = /\/$/
routeStripper = /^[#\/]|\s+$/g
escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g
namedParam = /<(\w+|[A-Za-z_-]+:\w+)>/g
genericParam = /([A-Za-z_-]+):(\w+)/
filePattern = /\w+\.[a-zA-Z0-9]{3,64}/
optionalParam = /\((.*?)\)/g
splatParam = /\*\w+/g
#--------------------------------------------
###URL 変数に対して指定できる型###
# **Default:**
#
# * int : Number としてキャストされます
# * string : String としてキャストされます
#
VARIABLE_TYPES = [
{
name:"int"
cast:Number
},
{
name:"string"
cast:String
}
]
#--------------------------------------------
###*
* Kazitori.js は pushState をいい感じにさばいてくれるルーターライブラリです。<br>
* シンプルかつ見通しよく pushState コンテンツのルーティングを定義することができます。
*
* 使い方はとても簡単。
* <ul><li>Kazitori を継承したクラスを作る</li><li>routes に扱いたい URL と、それに対応したメソッドを指定。</li><li>インスタンス化</li></ul>
*
* <h4>example</h4>
* class Router extends Kazitori
* routes:
* "/": "index"
* "/<int:id>": "show"
*
* index:()->
* console.log "index!"
* show:(id)->
* console.log id
*
* $(()->
* app = new Router()
* )
*
* Kazitori では pushState で非同期コンテンツを作っていく上で必要となるであろう機能を他にも沢山用意しています。<br>
* 詳細は API 一覧から確認して下さい。
* @module Kazitori.js
* @main Kazitori
###
## Kazitori クラス
###*
* Kazitori のメインクラス
*
* @class Kazitori
* @constructor
###
class Kazitori
VERSION: "1.0.2"
history: null
location: null
###*
* マッチするURLのルールと、それに対応する処理を定義します。
* <h4>example</h4>
* routes:
* '/':'index'
* '/<int:id>':'show'
*
* @property routes
* @type Object
* @default {}
###
routes: {}
handlers: []
###*
* マッチした URL に対する処理を行う前に実行したい処理を定義します。
* @property befores
* @type Object
* @default {}
###
befores: {}
beforeHandlers: []
###*
* URL が変わる際、事前に実行したい処理を定義します。<br>
* このプロパティに登録された処理は、与えられた URL にマッチするかどうかにかかわらず、常に実行されます。
* @property beforeAnytimeHandler
* @type Array
* @default []
###
beforeAnytimeHandler: null
afterhandlers: []
###*
* 特定のファイル名が URL に含まれていた時、ルートとして処理するリストです。
* @property rootFiles
* @type Array
###
rootFiles: ['index.html', 'index.htm', 'index.php', 'unko.html']
###*
* ルートを指定します。<br>
* ここで指定された値が URL の prefix として必ずつきます。<br>
* 物理的に URL のルートより 1ディレクトリ下がった箇所で pushState を行いたい場合<br>
* この値を / 以外に指定します。
* <h4>example</h4>
* コンテンツを配置する実ディレクトリが example だった場合
*
* app = new Router({root:'/example/'})
* @property root
* @type String
* @default /
###
root: null
###*
* 現在の URL にマッチするルールがなかった場合に変更する URL
* @property notFound
* @type String
* @default null
###
notFound: null
direct: null
isIE: false
###*
* URL を実際には変更しないようにするかどうかを決定します。<br>
* true にした場合、URL は変更されず、内部で保持している状態管理オブジェクトを基準に展開します。
* @property silent
* @type Boolean
* @default false
###
silent: false
###*
* pushState への監視が開始されているかどうか
* @property started
* @type Boolean
* @default false
###
started: false
#URL パラメーター
_params:
params:[]
'fragment':''
###*
* before 処理が失敗した時に実行されます。<br>
* デフォルトでは空の function になっています。
*
* @method beforeFailedHandler
###
beforeFailedHandler:()->
return
###isBeforeForce###
isBeforeForce: false
#befores の処理を URL 変更前にするかどうか
isTemae: false
_changeOptions: null
isNotFoundForce: false
_notFound: null
breaker: {}
_dispatcher: null
_beforeDeffer: null
###*
* 現在の URL を返します。
* @property fragment
* @type String
* @default null
###
fragment: null
###*
* 現在の URL から 1つ前の URL を返します。
* @property lastFragment
* @type String
* @default null
###
lastFragment: null
isUserAction: false
_isFirstRequest: true
#pushState が使えない IE で初回時にリダイレクトするかどうか
isInitReplace : true
#末尾のスラッシュ
isLastSlash : false
###*
* 一時停止しているかどうかを返します。
*
* @property isSuspend
* @type Boolean
* @default false
###
isSuspend: false
_processStep:
'status': 'null'
'args': []
constructor:(options)->
@._processStep.status = 'constructor'
@._processStep.args = [options]
@.options = options || (options = {})
if options.routes
@.routes = options.routes
@.root = if options.hasOwnProperty "root" then options.root else if @.root is null then '/' else @.root
@.isTemae = if options.isTemae then options.isTemae else false
@.silent = if options.silent then options.silent else false
@.isInitReplace = if options.hasOwnProperty "isInitReplace" then options.isInitReplace else true
@.isLastSlash = if options.hasOwnProperty "isLastSlash" then options.isLastSlash else false
@._params = {
params:[]
queries:{}
fragment:null
}
#見つからなかった時強制的に root を表示する
# @.notFound = if options.notFound then options.notFound else @.root
if @.notFound is null
@.notFound = if options.notFound then options.notFound else @.root
win = window
if typeof win != 'undefined'
@.location = win.location
@.history = win.history
docMode = document.documentMode
@isIE = win.navigator.userAgent.toLowerCase().indexOf('msie') != -1
@isOldIE = @isIE and (!docMode||docMode < 9)
@_dispatcher = new EventDispatcher()
@.handlers = []
@.beforeHandlers = []
@_bindBefores()
@_bindRules()
@_bindNotFound()
try
Object.defineProperty(@, 'params', {
enumerable : true
get:()->
return @._params.params
})
Object.defineProperty(@, 'queries', {
enumerable : true
get:()->
return @._params.queries
})
catch e
if @isOldIE
@.params = @._params.params
@.queries = @._params.queries
#throw new Error(e)
#IEだと defineProperty がアレらしいので
#@.__defineGetter__ したほうがいいかなー
if not @.options.isAutoStart? or @.options.isAutoStart != false
@start()
###*
* Kazitori.js を開始します。<br>
* START イベントがディスパッチされます。
* @method start
* @param {Object} options オプション
###
start:(options)->
@._processStep.status = 'start'
@._processStep.args = [options]
if @.started
throw new Error('mou hazim matteru')
@.started = true
win = window
@.options = @_extend({}, {root:'/'}, @.options, options)
@._hasPushState = !!(@.history and @.history.pushState)
@._wantChangeHash = @.options.hashChange isnt false
fragment = @.fragment = @getFragment()
atRoot = @.location.pathname.replace(/[^\/]$/, '$&/') is @.root
if @isIE and not atRoot and not @._hasPushState and @isInitReplace
ieFrag = @.location.pathname.replace(@.root, '')
@_updateHashIE(ieFrag)
if @isOldIE and @._wantChangeHash
frame = document.createElement("iframe")
frame.setAttribute("src","javascript:0")
frame.setAttribute("tabindex", "-1")
frame.style.display = "none"
document.body.appendChild(frame)
@.iframe = frame.contentWindow
@change(fragment)
@._addPopStateHandler()
if @._hasPushState and atRoot and @.location.hash
@.fragment = @.lastFragment = @.getHash().replace(routeStripper, '')
@.history.replaceState({}, document.title, @.root + @.fragment + @.location.search)
#スタートイベントをディスパッチ
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.START, @.fragment ))
override = @.root
if !@.silent
if not @._hasPushState and atRoot
# override = @.root + @.fragment.replace(routeStripper, '')
override = @.fragment
else if not atRoot
override = @.fragment
return @loadURL(override)
###*
* Kazitori.js を停止します。<br>
* STOP イベントがディスパッチされます。
* @method stop
###
stop:()->
win = window
win.removeEventListener 'popstate', @observeURLHandler
win.removeEventListener 'hashchange', @observeURLHandler
@.started = false
#ストップイベントをディスパッチ
@._dispatcher.dispatchEvent(new KazitoriEvent(KazitoriEvent.STOP, @.fragment))
return
###*
* ブラウザのヒストリー機能を利用して「進む」を実行します。<br>
* 成功した場合 NEXT イベントがディスパッチされます。
* @method torikazi
* @param {Object} options
###
torikazi:(options)->
return @direction(options, "next")
###*
* ブラウザヒストリー機能を利用して「戻る」を実行します。<br>
* 成功した場合 PREV イベントがディスパッチされます。
* @method omokazi
* @param {Object} options
###
omokazi:(options)->
return @direction(options, "prev")
direction:(option, direction)->
if not @.started
return false
tmpFrag = @.lastFragment
@.lastFragment = @getFragment()
@.direct = direction
@.isUserAction = true
@._removePopStateHandler()
if direction is "prev"
@.history.back()
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.PREV, tmpFrag, @.lastFragment ))
else if direction is "next"
@.history.forward()
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.NEXT, tmpFrag, @.lastFragment ))
else
return
@._addPopStateHandler()
return @loadURL(tmpFrag)
###*
* url を変更します。<br>
* 無事 URL が切り替わった場合、CHANGE イベントがディスパッチされます。
* <h4>example</h4>
* app.change('/someurl');
* @method change
* @param {String} fragment 変更したい URL
* @param {Object} options オプション
###
change:(fragment, options)->
if not @.started
return false
@._processStep.status = 'change'
@._processStep.args = [fragment, options]
if not options
options = {'trigger':options}
@._changeOptions = options
#TODO : @ に突っ込んじゃうとこのあと全部 BeforeForce されてまう
@.isBeforeForce = options.isBeforeForce isnt false
frag = @getFragment(fragment || '')
if @.fragment is frag
return
@.lastFragment = @.fragment
@.fragment = frag
next = @.fragment
#memo : jasmine だけなんかおかしい
#frag が undefined になってしまう
# console.debug frag
url = @.root + @_replace.apply(frag,[routeStripper, ''])
matched = @_matchCheck(@.fragment, @.handlers)
if matched is false and @.isNotFoundForce is false
if @.notFound isnt null
@._notFound.callback(@.fragment)
url = @.root + @._notFound.rule.replace(routeStripper, '')
@.history[ if options.replace then 'replaceState' else 'pushState' ]({}, document.title, url)
@._dispatcher.dispatchEvent(new KazitoriEvent(KazitoriEvent.NOT_FOUND))
return
if @.isTemae and (@.beforeAnytimeHandler or @.beforeHandlers.length > 0)
@_executeBefores(frag)
else
@_urlChange(frag, options)
return
###*
* pushState ではなく replaceState で処理します。<br>
* replaceState は現在の URL を置き換えるため、履歴には追加されません。
* <h4>example</h4>
* app.replace('/someurl');
* @method replace
* @param {String} fragment 変更したい URL
* @param {Object} options オプション
###
replace:(fragment, options)->
@._processStep.status = 'replace'
@._processStep.args = [fragment, options]
if not options
options = {replace:true}
else if not options.replace or options.replace is false
options.replace = true
@change(fragment, options)
return
_urlChange:(fragment, options)->
@._processStep.status = '_urlChange'
@._processStep.args = [fragment, options]
if @.isSuspend
return
if not options
options = @._changeOptions
url = @.root + @.fragment.replace(routeStripper, '')
#末尾に slash を付ける必要がある場合つける
isFile = url.match(filePattern)
isLastSlash = url.match(trailingSlash)
if @.isLastSlash and not isFile and not isLastSlash
url += "/"
if not @.silent
if @._hasPushState
@.history[ if options.replace then 'replaceState' else 'pushState' ]({}, document.title, url)
else if @._wantChangeHash
@_updateHash(@.location, fragment, options.replace)
if @.iframe and (fragment isnt @getFragment(@getHash(@.iframe)))
if !options.replace
@.iframe.document.open().close()
@_updateHash(@.iframe.location, fragment, options.replace)
else
return @.location.assign(url)
#イベントディスパッチ
@dispatchEvent(new KazitoriEvent(KazitoriEvent.CHANGE, @.fragment, @.lastFragment))
if options.internal and options.internal is true
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.INTERNAL_CHANGE, @.fragment, @.lastFragment))
@loadURL(@.fragment, options)
return
###*
* 中止します。
* @method reject
###
reject:()->
@dispatchEvent(new KazitoriEvent(KazitoriEvent.REJECT, @.fragment ))
if @._beforeDeffer
@._beforeDeffer.removeEventListener KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete
@._beforeDeffer.removeEventListener KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed
@._beforeDeffer = null
return
###*
* 処理を一時停止します。<br>
* SUSPEND イベントがディスパッチされます。
* @method suspend
###
suspend:()->
if @._beforeDeffer?
@._beforeDeffer.suspend()
@.started = false
@.isSuspend = true
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.SUSPEND, @.fragment, @.lastFragment ))
return
###*
* 処理を再開します。<br>
* RESUME イベントがディスパッチされます。
* @method resume
###
resume:()->
if @._beforeDeffer?
@._beforeDeffer.resume()
@.started = true
@.isSuspend = false
@[@._processStep.status](@._processStep.args)
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.RESUME, @.fragment, @.lastFragment ))
return
registerHandler:(rule, name, isBefore, callback )->
if not callback
if isBefore
callback = @_bindFunctions(name)
else if name instanceof Kazitori
@_bindChild(rule, name)
return @
else if typeof name is "function"
#これ再帰的にチェックするメソッドに落としこもう
#__super__ って coffee のクラスだけなきガス
#むーん
if name.hasOwnProperty('__super__')
try
child = new name({'isAutoStart':false})
@_bindChild(rule, child)
return @
catch e
callback = name
else
callback = name
else
callback = @[name]
target = if isBefore then @.beforeHandlers else @.handlers
target.unshift new Rule(rule, (fragment)->
args = @.router.extractParams(@, fragment)
callback && callback.apply(@.router, args)
,@)
return @
_bindChild:(rule, child)->
child.reject()
child.stop()
childHandlers = child.handlers.concat()
for childRule in childHandlers
childRule.update(rule)
@.handlers = childHandlers.concat @.handlers
childBefores = child.beforeHandlers.concat()
for childBefore in childBefores
childBefore.update(rule)
@.beforeHandlers = childBefores.concat @.beforeHandlers
if child.beforeAnytimeHandler
@.lastAnytime = @.beforeAnytime.concat()
@_bindBeforeAnytime(@.beforeAnytime, [child.beforeAnytimeHandler.callback])
return
###*
* ルーターを動的に追加します。<br>
* ルーターの追加に成功した場合、ADDED イベントがディスパッチされます。
* <h4>example</h4>
* fooRouter = new FooRouter();
* app.appendRouter(foo);
* @method appendRouter
* @param {Object} child
* @param {String} childRoot
###
appendRouter:(child, childRoot)->
if not child instanceof Kazitori and typeof child isnt "function"
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
return
if child instanceof Kazitori
rule = @_getChildRule(child, childRoot)
@_bindChild(rule, child)
return @
else
if child.hasOwnProperty('__super__')
try
_instance = new child({'isAutoStart':false})
rule = @_getChildRule(_instance, childRoot)
@_bindChild(rule, _instance)
return @
catch e
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.ADDED, @.fragment, @.lastFragment ))
return @
_getChildRule:(child, childRoot)->
rule = child.root
if childRoot
rule = childRoot
if rule.match(trailingSlash)
rule = rule.replace(trailingSlash, '')
if rule is @.root
throw new Error("かぶってる")
return rule
###*
* 動的に追加したルーターを削除します。
* ルーターの削除に成功した場合、REMOVED イベントがディスパッチされます。
* <h4>example</h4>
* foo = new FooRouter();
* app.appendRouter(foo);
* app.removeRouter(foo);
* @method removeRouter
* @param {Object} child
* @param {String} childRoot
###
removeRouter:(child, childRoot)->
if not child instanceof Kazitori and typeof child isnt "function"
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
return
if child instanceof Kazitori
@_unbindChild(child, childRoot)
else
if child.hasOwnProperty('__super__')
try
_instance = new child({'isAutoStart':false})
@_unbindChild(_instance, childRoot)
return @
catch e
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.REMOVED, @.fragment, @.lastFragment))
return @
_unbindChild:(child, childRoot)->
rule = @_getChildRule(child, childRoot)
i = 0
len = @.handlers.length
newHandlers = []
while i < len
ruleObj = @.handlers.shift()
if (ruleObj.rule.match rule) is null
newHandlers.unshift(ruleObj)
i++
@.handlers = newHandlers
i = 0
len = @.beforeHandlers.length
newBefores = []
while i < len
beforeRule = @.beforeHandlers.shift()
if (beforeRule.rule.match rule) is null
newBefores.unshift(beforeRule)
i++
@.beforeHandlers = newBefores
return
###*
* ブラウザから現在の URL を読み込みます。
* @method loadURL
* @param {String} fragmentOverride
* @param {Object} options
###
loadURL:(fragmentOverride, options)->
@._processStep.status = 'loadURL'
@._processStep.args = [fragmentOverride, options]
if @.isSuspend
return
fragment = @.fragment = @getFragment(fragmentOverride)
if @.isTemae is false and (@.beforeAnytimeHandler or @.beforeHandlers.length > 0)
@_executeBefores(fragment)
else
@executeHandlers()
return
###*
* 指定した 文字列に対応した URL ルールが設定されているかどうか<br>
* Boolean で返します。
* <h4>example</h4>
* app.match('/hoge');
* @method match
* @param {String} fragment
* @return {Boolean}
###
match:(fragment)->
matched = @._matchCheck(fragment, @.handlers, true)
return matched.length > 0
#before で登録した処理が無難に終わった
beforeComplete:(event)=>
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete)
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed)
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.BEFORE_EXECUTED, @.fragment, @.lastFragment))
#ここではんだんするしかないかなー
if @.isTemae
@_urlChange(@.fragment, @._changeOptions)
else
@executeHandlers()
return
#登録されたbefores を実行
_executeBefores:(fragment)=>
@._processStep.status = '_executeBefores'
@._processStep.args = [fragment]
@._beforeDeffer = new Deffered()
if @.beforeAnytimeHandler?
@._beforeDeffer.deffered((d)=>
@.beforeAnytimeHandler.callback(fragment)
d.execute(d)
return
)
matched = @._matchCheck(fragment, @.beforeHandlers)
for handler in matched
@._beforeDeffer.deffered((d)->
handler.callback(fragment)
d.execute(d)
return
)
@._beforeDeffer.addEventListener(KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete)
@._beforeDeffer.addEventListener(KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed)
@._beforeDeffer.execute(@._beforeDeffer)
return
#routes で登録されたメソッドを実行
executeHandlers:()=>
@._processStep.status = 'executeHandlers'
@._processStep.args = []
if @.isSuspend
return
#毎回 match チェックしてるので使いまわしたいのでリファクタ
matched = @._matchCheck(@.fragment, @.handlers)
isMatched = true
if matched is false or matched.length < 1
if @.notFound isnt null
@._notFound.callback(@.fragment)
isMatched = false
@._dispatcher.dispatchEvent(new KazitoriEvent(KazitoriEvent.NOT_FOUND))
else if matched.length > 1
for match in matched
if @.fragment.indexOf(match.rule) > -1
match.callback(@.fragment)
# if @.fragment.indexOf match.rule
else
for handler in matched
handler.callback(@.fragment)
if @._isFirstRequest
#間に合わないので遅延させて発行
setTimeout ()=>
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.FIRST_REQUEST, @.fragment, null))
if isMatched
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.EXECUTED, @.fragment, null))
,0
@._isFirstRequest = false
else
if isMatched
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.EXECUTED, @.fragment, @.lastFragment))
return matched
beforeFailed:(event)=>
@.beforeFailedHandler.apply(@, arguments)
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed)
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete)
if @isBeforeForce
@beforeComplete()
@._beforeDeffer = null
return
#URL の変更を監視
observeURLHandler:(event)=>
current = @getFragment()
if current is @.fragment and @.iframe
current = @getFragment(@getHash(@.iframe))
if current is @.fragment
return false
if @.iframe
@change(current)
if @.lastFragment is current and @.isUserAction is false
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.PREV, current, @.fragment ))
else if @.lastFragment is @.fragment and @.isUserAction is false
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.NEXT, current, @.lastFragment ))
@.isUserAction = false
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.CHANGE, current, @.lastFragment ))
return @loadURL(current)
# routes から指定されたルーティングをバインド
_bindRules:()->
if not @.routes?
return
routes = @_keys(@.routes)
for rule in routes
@registerHandler(rule, @.routes[rule], false)
return
# befores から指定された事前に処理したいメソッドをバインド
_bindBefores:()->
if @.beforeAnytime
@_bindBeforeAnytime(@.beforeAnytime)
if not @.befores?
return
befores = @_keys(@.befores)
for key in befores
@registerHandler(key, @.befores[key], true)
return
_bindBeforeAnytime:(funcs, bindedFuncs)->
callback = @_bindFunctions(funcs, bindedFuncs)
@.beforeAnytimeHandler = {
callback:@_binder (fragment)->
args = [fragment]
callback && callback.apply(@, args)
,@
}
return
# notFound で指定されたメソッドをバインド
_bindNotFound:()->
if not @.notFound?
return
if typeof @.notFound is "string"
for rule in @.handlers
if rule.rule is '/' + @.notFound.replace(@.root, '')
@._notFound = rule
return
else
notFoundFragment = @_keys(@.notFound)[0]
notFoundFuncName = @.notFound[notFoundFragment]
if typeof notFoundFuncName is "function"
callback = notFoundFuncName
else
callback = @[notFoundFuncName]
@._notFound = new Rule(notFoundFragment, (fragment)->
args = @.router.extractParams(@, fragment)
callback && callback.apply(@.router, args)
,@)
return
_updateHash:(location, fragment, replace)->
atRoot = @.location.pathname.replace(/[^\/]$/, '$&/') is @.root
unless atRoot
location.replace @.root + '#' + fragment
return
if replace
href = location.href.replace /(javascript:|#).*$/, ''
location.replace href + '#' + fragment
# location.replace @.root + '#' + fragment
else
location.hash = "#" + fragment
return
#zantei
_updateHashIE:(fragment, replace)->
location.replace @.root + '#/' + fragment
return
#マッチする URL があるかどうか
# memo : 20130130
# ここでここまでのチェックを実際に行うなら
# loadURL, executeHandler 内で同じチェックは行う必要がないはずなので
# それぞれのメソッドが簡潔になるようにリファクタする必要がある
_matchCheck:(fragment, handlers, test=false)->
matched = []
tmpFrag = fragment
if tmpFrag isnt undefined and tmpFrag isnt 'undefined'
hasQuery = @_match.apply(tmpFrag, [/(\?[\w\d=|]+)/g])
if hasQuery
fragment = fragment.split('?')[0]
for handler in handlers
if handler.rule is fragment
matched.push handler
else if handler.test(fragment)
if handler.isVariable and handler.types.length > 0
#型チェック用
# args = handler._extractParams(fragment)
args = @.extractParams(handler, fragment, test)
argsMatch = []
len = args.length
i = 0
while i < len
a = args[i]
t = handler.types[i]
if typeof a isnt "object"
if t is null
argsMatch.push true
else
argsMatch.push @_typeCheck(a,t)
i++
argsMatched = true
for match in argsMatch
if not match
argsMatched = false
if argsMatched
matched.push handler
else
matched.push handler
return if matched.length > 0 then matched else false
#===============================================
#
# URL Queries
#
#==============================================
###*
* URL ルート以下を取得
* @method getFragment
* @param {String} fragment
###
getFragment:(fragment)->
if not fragment? or fragment == undefined
if @._hasPushState or !@._wantChangeHash
fragment = @.location.pathname
matched = false
frag = fragment
if frag.match(/^\//)
frag = frag.substr(1)
root = @.root
if root.match(/^\//)
root = root.substr(1)
for index in @.rootFiles
if index is frag or root + index is frag
matched = true
if matched
fragment = @.root
fragment = fragment + @.location.search
root = @.root.replace(trailingSlash, '')
if fragment.indexOf(root) > -1
fragment = fragment.substr(root.length)
else
fragment = @getHash()
else
root = @.root.replace(trailingSlash, '')
if fragment.indexOf(@.root) > -1 and fragment.indexOf(root) > -1
fragment = fragment.substr(root.length)
if typeof fragment is "string"
fragment = fragment.replace(trailingSlash, '')
fragment = "/" if fragment is ""
# console.log "kazitori current fragment::", fragment.replace(trailingSlash, '')
return fragment
###*
* URL の # 以降を取得
* @method getHash
* @return {String} URL の # 以降の文字列
###
getHash:()->
match = (window || @).location.href.match(/#(.*)$/)
if match?
return match[1]
else
return ''
return
###*
* URL パラメータを分解
* @method extractParams
* @param {Rule} rule
* @param {String} fragment
* @param {Boolean} test
###
extractParams:(rule, fragment, test=false)->
if @._params.params.length > 0 and @._params.fragment is fragment
return @._params.params
param = rule._regexp.exec(fragment)
if param is null and fragment.indexOf('?') > -1
param = [0,'?' + fragment.split('?')[1]]
@._params.fragment = fragment
if param?
newParam = param.slice(1)
last = param[param.length - 1]
if last.indexOf('?') > -1
newQueries = {}
queries = last.split('?')[1]
queryParams = queries.split('&')
for query in queryParams
kv = query.split('=')
k = kv[0]
v = if kv[1] then kv[1] else ""
if v.indexOf('|') > -1
v = v.split("|")
newQueries[k] = v
newParam.pop()
newParam.push last.split('?')[0]
q = {"queries":newQueries}
newParam.push q
if not test
@._params.params = @_getCastedParams(rule, newParam.slice(0))
@._params.queries = newQueries
if @isOldIE
@.params = @._params.params
@.queries = @._params.queries
else
if not test
@._params.params = @_getCastedParams(rule, newParam)
if @isOldIE
@.params = @._params.params
return newParam
else
@._params.params = []
if @isOldIE
@.param = []
return null
return
#パラメーターを指定された型でキャスト
_getCastedParams:(rule, params)->
i = 0
if not params
return params
if rule.types.length < 1
return params
len = params.length
castedParams = []
while i < len
if rule.types[i] is null
castedParams.push params[i]
else if typeof params[i] is "object"
castedParams.push params[i]
else
for type in VARIABLE_TYPES
if rule.types[i] is type.name
castedParams.push type.cast(params[i])
i++
return castedParams
#===============================================
#
# Event
#
#==============================================
addEventListener:(type, listener)->
@_dispatcher.addEventListener(type, listener)
return
removeEventListener:(type, listener)->
@_dispatcher.removeEventListener(type, listener)
return
dispatchEvent:(event)->
@_dispatcher.dispatchEvent(event)
return
_addPopStateHandler:()->
win = window
if @._hasPushState is true
win.addEventListener 'popstate', @observeURLHandler
if @._wantChangeHash is true and not @.isOldIE
win.addEventListener 'hashchange', @observeURLHandler
else if @._wantChangeHash is true
win.attachEvent 'onhashchange', @observeURLHandler
return
_removePopStateHandler:()->
win = window
win.removeEventListener 'popstate', @observeURLHandler
win.removeEventListener 'hashchange', @observeURLHandler
if @.isOldIE
win.detachEvent 'onhashchange', @observeURLHandler
return
#==============================================
#
# utils
#
#==============================================
_slice: Array.prototype.slice
_replace:String.prototype.replace
_match:String.prototype.match
_keys: Object.keys || (obj)->
if obj is not Object(obj)
throw new TypeError('object ja nai')
keys = []
for key of obj
if Object.hasOwnProperty.call(obj, key)
keys[keys.length] = key
return keys
_binder:(func, obj)->
slice = @_slice
args = slice.call(arguments, 2)
return ()->
return func.apply(obj||{},args.concat(slice.call(arguments)))
_extend:(obj)->
@_each( @_slice.call(arguments,1), (source)->
if source
for prop of source
obj[prop] = source[prop]
)
return obj
_each:(obj, iter, ctx)->
if not obj?
return
each = Array.prototype.forEach
if each && obj.forEach is each
obj.forEach(iter, ctx)
else if obj.length is +obj.length
i = 0
l = obj.length
while i < l
if iter.call(ctx, obj[i], i, obj ) is @breaker
return
i++
else
for k of obj
if k in obj
if iter.call(ctx, obj[k], k, obj) is @breaker
return
return
_bindFunctions:(funcs, insert)->
if typeof funcs is 'string'
funcs = funcs.split(',')
bindedFuncs = []
for funcName in funcs
func = @[funcName]
if not func?
names = funcName.split('.')
if names.length > 1
f = window[names[0]]
i = 1
len = names.length
while i < len
newF = f[names[i]]
if newF?
f = newF
i++
else
break
func = f
else
func = window[funcName]
if func?
bindedFuncs.push(func)
if insert
bindedFuncs = insert.concat bindedFuncs
callback =(args...)->
for func in bindedFuncs
func.apply(@, [args...])
return
return callback
_typeCheck:(a,t)->
matched = false
for type in VARIABLE_TYPES
if t.toLowerCase() is type.name
if type.cast(a)
matched = true
return matched
## Rule
# URL を定義する Rule クラス
# ちょっと大げさな気もするけど外部的には変わらんし
# 今後を見据えてクラス化しておく
###*
* pushState で処理したいルールを定義するクラス
*
* @class Rule
* @constructor
* @param {String} rule
* @param {Function} callback
* @param {Kazitori} router
###
class Rule
###*
* ルール文字列
* @property rule
* @type String
* @default ""
###
rule: ""
_regexp: null
###*
* コールバック関数
* ルールとマッチする場合実行されます。
* @property callback
* @type: Function
* @default null
###
callback:null
name:""
router:null
isVariable:false
types:[]
constructor:(rule, callback, router)->
if typeof rule isnt "string" and typeof rule isnt "Number"
return
@callback = callback
@router = router
@update(rule)
#マッチするかどうかテスト
# **args**
# fragment : テスト対象となる URL
# **return**
# Boolean : テスト結果の真偽値
###*
* Rule として定義したパターンと fragment として与えられた文字列がマッチするかどうかテストする
* @method test
* @param {String} fragment
* @return {Boolean} マッチする場合 true を返す
###
test:(fragment)->
return @_regexp.test(fragment)
_ruleToRegExp:(rule)->
newRule = rule.replace(escapeRegExp, '\\$&').replace(optionalParam, '(?:$1)?').replace(namedParam, '([^\/]+)').replace(splatParam, '(.*?)')
return new RegExp('^' + newRule + '$')
###*
* 与えられた path で現在の Rule をアップデートします。
* @method update
* @param {String} path
###
update:(path)=>
@.rule = path + @.rule
#trailing last slash
if @.rule isnt '/'
@.rule = @.rule.replace(trailingSlash, '')
@._regexp = @_ruleToRegExp(@.rule)
re = new RegExp(namedParam)
matched = path.match(re)
if matched isnt null
@isVariable = true
for m in matched
t = m.match(genericParam)||null
@types.push if t isnt null then t[1] else null
return
###*
* イベントディスパッチャ
* @class EventDispatcher
* @constructor
###
class EventDispatcher
listeners:{}
addEventListener:(type, listener)->
if @listeners[ type ] is undefined
@listeners[ type ] =[]
if @_inArray(listener, @listeners[type]) < 0
@listeners[type].push listener
return
removeEventListener:(type, listener)->
len = 0
for prop of @listeners
len++
if len < 1
return
arr = @listeners[type]
if not arr
return
i = 0
len = arr.length
while i < len
if arr[i] is listener
if len is 1
delete @listeners[type]
else arr.splice(i,1)
break
i++
return
dispatchEvent:(event)->
ary = @listeners[ event.type ]
if ary isnt undefined
event.target = @
for handler in ary
handler.call(@, event)
return
_inArray: ( elem, array )->
i = 0
len = array.length
while i < len
if array[ i ] is elem
return i
i++
return -1
## Deffered
# **internal**
# before を確実に処理するための簡易的な Deffered クラス
class Deffered extends EventDispatcher
queue : []
isSuspend : false
constructor:()->
@queue = []
@isSuspend = false
deffered:(func)->
@queue.push func
return @
execute:()->
if @isSuspend
return
try
task = @queue.shift()
if task
task.apply(@, arguments)
if @queue.length < 1
@queue = []
@.dispatchEvent(new KazitoriEvent(KazitoriEvent.TASK_QUEUE_COMPLETE))
catch error
@reject(error)
#defferd を中断する
reject:(error)->
message = if not error then "user reject" else error
@dispatchEvent({type:KazitoriEvent.TASK_QUEUE_FAILED, index:@index, message:message })
@isSuspend = false
return
#deffered を一時停止する
suspend:()->
@isSuspend = true
return
#deffered を再開する
resume:()->
@isSuspend = false
@execute()
return
## KazitoriEvent
# Kazitori がディスパッチするイベント
###*
* pushState 処理や Kazitori にまつわるイベント
* @class KazitoriEvent
* @constructor
* @param {String} type
* @param {String} next
* @param {String} prev
###
class KazitoriEvent
next:null
prev:null
type:null
constructor:(type, next, prev)->
@type = type
@next = next
@prev = prev
clone:()->
return new KazitoriEvent(@type, @next, @prev)
toString:()->
return "KazitoriEvent :: " + "type:" + @type + " next:" + String(@next) + " prev:" + String(@prev)
###*
* タスクキューが空になった
* @property TASK_QUEUE_COMPLETE
* @type String
* @default task_queue_complete
###
KazitoriEvent.TASK_QUEUE_COMPLETE = 'task_queue_complete'
###*
* タスクキューが中断された
* @property TASK_QUEUE_FAILED
* @type String
* @default task_queue_failed
###
KazitoriEvent.TASK_QUEUE_FAILED = 'task_queue_failed'
###*
* URL が変更された
* @property CHANGE
* @type String
* @default change
###
KazitoriEvent.CHANGE = 'change'
###*
* URL に登録されたメソッドがちゃんと実行された
* @property EXECUTED
* @type String
* @default executed
###
KazitoriEvent.EXECUTED = 'executed'
###*
* 事前処理が完了した
* @property BEFORE_EXECUTED
* @type String
* @default before_executed
###
KazitoriEvent.BEFORE_EXECUTED = 'before_executed'
###*
* ユーザーアクション以外で URL の変更があった
* @property INTERNAL_CHANGE
* @type String
* @default internal_change
###
KazitoriEvent.INTERNAL_CHANGE = 'internal_change'
KazitoriEvent.USER_CHANGE = 'user_change'
###*
* ヒストリーバックした
* @property PREV
* @type String
* @default prev
###
KazitoriEvent.PREV = 'prev'
###*
* ヒストリーネクストした時
* @property NEXT
* @type String
* @default next
###
KazitoriEvent.NEXT = 'next'
###*
* Kazitori が中断した
* @property REJECT
* @type String
* @default reject
###
KazitoriEvent.REJECT = 'reject'
###*
* URL にマッチする処理が見つからなかった
* @property NOT_FOUND
* @type String
* @default not_found
###
KazitoriEvent.NOT_FOUND = 'not_found'
###*
* Kazitori が開始した
* @property START
* @type String
* @default start
###
KazitoriEvent.START = 'start'
###*
* Kazitori が停止した
* @property STOP
* @type String
* @default stop
###
KazitoriEvent.STOP = 'stop'
###*
* Kazitori が一時停止した
* @property SUSPEND
* @type String
* @default SUSPEND
###
KazitoriEvent.SUSPEND = 'SUSPEND'
###*
* Kazitori が再開した
* @property RESUME
* @type String
* @default resume
###
KazitoriEvent.RESUME = 'resume'
###*
* Kazitori が開始してから、一番最初のアクセスがあった
* @property FIRST_REQUEST
* @type String
* @default first_request
###
KazitoriEvent.FIRST_REQUEST = 'first_request'
###*
* ルーターが追加された
* @property ADDED
* @type String
* @default added
###
KazitoriEvent.ADDED = 'added'
###*
* ルーターが削除された
* @property REMOVED
* @type String
* @default removed
###
KazitoriEvent.REMOVED = 'removed'
| 162286 | #### Copyrights
# (c) 2013 <NAME>
# kazitori.js may be freely distributed under the MIT license.
# http://dev.hageee.net
# inspired from::
# (c) 2010-2012 <NAME>, DocumentCloud Inc.
# Backbone may be freely distributed under the MIT license.
# For all details and documentation:
# http://backbonejs.org
#
#----------------------------------------------
#delegate
delegater = (target, func)->
return ()->
func.apply(target, arguments)
#regexps
trailingSlash = /\/$/
routeStripper = /^[#\/]|\s+$/g
escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g
namedParam = /<(\w+|[A-Za-z_-]+:\w+)>/g
genericParam = /([A-Za-z_-]+):(\w+)/
filePattern = /\w+\.[a-zA-Z0-9]{3,64}/
optionalParam = /\((.*?)\)/g
splatParam = /\*\w+/g
#--------------------------------------------
###URL 変数に対して指定できる型###
# **Default:**
#
# * int : Number としてキャストされます
# * string : String としてキャストされます
#
VARIABLE_TYPES = [
{
name:"int"
cast:Number
},
{
name:"string"
cast:String
}
]
#--------------------------------------------
###*
* Kazitori.js は pushState をいい感じにさばいてくれるルーターライブラリです。<br>
* シンプルかつ見通しよく pushState コンテンツのルーティングを定義することができます。
*
* 使い方はとても簡単。
* <ul><li>Kazitori を継承したクラスを作る</li><li>routes に扱いたい URL と、それに対応したメソッドを指定。</li><li>インスタンス化</li></ul>
*
* <h4>example</h4>
* class Router extends Kazitori
* routes:
* "/": "index"
* "/<int:id>": "show"
*
* index:()->
* console.log "index!"
* show:(id)->
* console.log id
*
* $(()->
* app = new Router()
* )
*
* Kazitori では pushState で非同期コンテンツを作っていく上で必要となるであろう機能を他にも沢山用意しています。<br>
* 詳細は API 一覧から確認して下さい。
* @module Kazitori.js
* @main Kazitori
###
## Kazitori クラス
###*
* Kazitori のメインクラス
*
* @class Kazitori
* @constructor
###
class Kazitori
VERSION: "1.0.2"
history: null
location: null
###*
* マッチするURLのルールと、それに対応する処理を定義します。
* <h4>example</h4>
* routes:
* '/':'index'
* '/<int:id>':'show'
*
* @property routes
* @type Object
* @default {}
###
routes: {}
handlers: []
###*
* マッチした URL に対する処理を行う前に実行したい処理を定義します。
* @property befores
* @type Object
* @default {}
###
befores: {}
beforeHandlers: []
###*
* URL が変わる際、事前に実行したい処理を定義します。<br>
* このプロパティに登録された処理は、与えられた URL にマッチするかどうかにかかわらず、常に実行されます。
* @property beforeAnytimeHandler
* @type Array
* @default []
###
beforeAnytimeHandler: null
afterhandlers: []
###*
* 特定のファイル名が URL に含まれていた時、ルートとして処理するリストです。
* @property rootFiles
* @type Array
###
rootFiles: ['index.html', 'index.htm', 'index.php', 'unko.html']
###*
* ルートを指定します。<br>
* ここで指定された値が URL の prefix として必ずつきます。<br>
* 物理的に URL のルートより 1ディレクトリ下がった箇所で pushState を行いたい場合<br>
* この値を / 以外に指定します。
* <h4>example</h4>
* コンテンツを配置する実ディレクトリが example だった場合
*
* app = new Router({root:'/example/'})
* @property root
* @type String
* @default /
###
root: null
###*
* 現在の URL にマッチするルールがなかった場合に変更する URL
* @property notFound
* @type String
* @default null
###
notFound: null
direct: null
isIE: false
###*
* URL を実際には変更しないようにするかどうかを決定します。<br>
* true にした場合、URL は変更されず、内部で保持している状態管理オブジェクトを基準に展開します。
* @property silent
* @type Boolean
* @default false
###
silent: false
###*
* pushState への監視が開始されているかどうか
* @property started
* @type Boolean
* @default false
###
started: false
#URL パラメーター
_params:
params:[]
'fragment':''
###*
* before 処理が失敗した時に実行されます。<br>
* デフォルトでは空の function になっています。
*
* @method beforeFailedHandler
###
beforeFailedHandler:()->
return
###isBeforeForce###
isBeforeForce: false
#befores の処理を URL 変更前にするかどうか
isTemae: false
_changeOptions: null
isNotFoundForce: false
_notFound: null
breaker: {}
_dispatcher: null
_beforeDeffer: null
###*
* 現在の URL を返します。
* @property fragment
* @type String
* @default null
###
fragment: null
###*
* 現在の URL から 1つ前の URL を返します。
* @property lastFragment
* @type String
* @default null
###
lastFragment: null
isUserAction: false
_isFirstRequest: true
#pushState が使えない IE で初回時にリダイレクトするかどうか
isInitReplace : true
#末尾のスラッシュ
isLastSlash : false
###*
* 一時停止しているかどうかを返します。
*
* @property isSuspend
* @type Boolean
* @default false
###
isSuspend: false
_processStep:
'status': 'null'
'args': []
constructor:(options)->
@._processStep.status = 'constructor'
@._processStep.args = [options]
@.options = options || (options = {})
if options.routes
@.routes = options.routes
@.root = if options.hasOwnProperty "root" then options.root else if @.root is null then '/' else @.root
@.isTemae = if options.isTemae then options.isTemae else false
@.silent = if options.silent then options.silent else false
@.isInitReplace = if options.hasOwnProperty "isInitReplace" then options.isInitReplace else true
@.isLastSlash = if options.hasOwnProperty "isLastSlash" then options.isLastSlash else false
@._params = {
params:[]
queries:{}
fragment:null
}
#見つからなかった時強制的に root を表示する
# @.notFound = if options.notFound then options.notFound else @.root
if @.notFound is null
@.notFound = if options.notFound then options.notFound else @.root
win = window
if typeof win != 'undefined'
@.location = win.location
@.history = win.history
docMode = document.documentMode
@isIE = win.navigator.userAgent.toLowerCase().indexOf('msie') != -1
@isOldIE = @isIE and (!docMode||docMode < 9)
@_dispatcher = new EventDispatcher()
@.handlers = []
@.beforeHandlers = []
@_bindBefores()
@_bindRules()
@_bindNotFound()
try
Object.defineProperty(@, 'params', {
enumerable : true
get:()->
return @._params.params
})
Object.defineProperty(@, 'queries', {
enumerable : true
get:()->
return @._params.queries
})
catch e
if @isOldIE
@.params = @._params.params
@.queries = @._params.queries
#throw new Error(e)
#IEだと defineProperty がアレらしいので
#@.__defineGetter__ したほうがいいかなー
if not @.options.isAutoStart? or @.options.isAutoStart != false
@start()
###*
* Kazitori.js を開始します。<br>
* START イベントがディスパッチされます。
* @method start
* @param {Object} options オプション
###
start:(options)->
@._processStep.status = 'start'
@._processStep.args = [options]
if @.started
throw new Error('mou hazim matteru')
@.started = true
win = window
@.options = @_extend({}, {root:'/'}, @.options, options)
@._hasPushState = !!(@.history and @.history.pushState)
@._wantChangeHash = @.options.hashChange isnt false
fragment = @.fragment = @getFragment()
atRoot = @.location.pathname.replace(/[^\/]$/, '$&/') is @.root
if @isIE and not atRoot and not @._hasPushState and @isInitReplace
ieFrag = @.location.pathname.replace(@.root, '')
@_updateHashIE(ieFrag)
if @isOldIE and @._wantChangeHash
frame = document.createElement("iframe")
frame.setAttribute("src","javascript:0")
frame.setAttribute("tabindex", "-1")
frame.style.display = "none"
document.body.appendChild(frame)
@.iframe = frame.contentWindow
@change(fragment)
@._addPopStateHandler()
if @._hasPushState and atRoot and @.location.hash
@.fragment = @.lastFragment = @.getHash().replace(routeStripper, '')
@.history.replaceState({}, document.title, @.root + @.fragment + @.location.search)
#スタートイベントをディスパッチ
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.START, @.fragment ))
override = @.root
if !@.silent
if not @._hasPushState and atRoot
# override = @.root + @.fragment.replace(routeStripper, '')
override = @.fragment
else if not atRoot
override = @.fragment
return @loadURL(override)
###*
* Kazitori.js を停止します。<br>
* STOP イベントがディスパッチされます。
* @method stop
###
stop:()->
win = window
win.removeEventListener 'popstate', @observeURLHandler
win.removeEventListener 'hashchange', @observeURLHandler
@.started = false
#ストップイベントをディスパッチ
@._dispatcher.dispatchEvent(new KazitoriEvent(KazitoriEvent.STOP, @.fragment))
return
###*
* ブラウザのヒストリー機能を利用して「進む」を実行します。<br>
* 成功した場合 NEXT イベントがディスパッチされます。
* @method torikazi
* @param {Object} options
###
torikazi:(options)->
return @direction(options, "next")
###*
* ブラウザヒストリー機能を利用して「戻る」を実行します。<br>
* 成功した場合 PREV イベントがディスパッチされます。
* @method omokazi
* @param {Object} options
###
omokazi:(options)->
return @direction(options, "prev")
direction:(option, direction)->
if not @.started
return false
tmpFrag = @.lastFragment
@.lastFragment = @getFragment()
@.direct = direction
@.isUserAction = true
@._removePopStateHandler()
if direction is "prev"
@.history.back()
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.PREV, tmpFrag, @.lastFragment ))
else if direction is "next"
@.history.forward()
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.NEXT, tmpFrag, @.lastFragment ))
else
return
@._addPopStateHandler()
return @loadURL(tmpFrag)
###*
* url を変更します。<br>
* 無事 URL が切り替わった場合、CHANGE イベントがディスパッチされます。
* <h4>example</h4>
* app.change('/someurl');
* @method change
* @param {String} fragment 変更したい URL
* @param {Object} options オプション
###
change:(fragment, options)->
if not @.started
return false
@._processStep.status = 'change'
@._processStep.args = [fragment, options]
if not options
options = {'trigger':options}
@._changeOptions = options
#TODO : @ に突っ込んじゃうとこのあと全部 BeforeForce されてまう
@.isBeforeForce = options.isBeforeForce isnt false
frag = @getFragment(fragment || '')
if @.fragment is frag
return
@.lastFragment = @.fragment
@.fragment = frag
next = @.fragment
#memo : jasmine だけなんかおかしい
#frag が undefined になってしまう
# console.debug frag
url = @.root + @_replace.apply(frag,[routeStripper, ''])
matched = @_matchCheck(@.fragment, @.handlers)
if matched is false and @.isNotFoundForce is false
if @.notFound isnt null
@._notFound.callback(@.fragment)
url = @.root + @._notFound.rule.replace(routeStripper, '')
@.history[ if options.replace then 'replaceState' else 'pushState' ]({}, document.title, url)
@._dispatcher.dispatchEvent(new KazitoriEvent(KazitoriEvent.NOT_FOUND))
return
if @.isTemae and (@.beforeAnytimeHandler or @.beforeHandlers.length > 0)
@_executeBefores(frag)
else
@_urlChange(frag, options)
return
###*
* pushState ではなく replaceState で処理します。<br>
* replaceState は現在の URL を置き換えるため、履歴には追加されません。
* <h4>example</h4>
* app.replace('/someurl');
* @method replace
* @param {String} fragment 変更したい URL
* @param {Object} options オプション
###
replace:(fragment, options)->
@._processStep.status = 'replace'
@._processStep.args = [fragment, options]
if not options
options = {replace:true}
else if not options.replace or options.replace is false
options.replace = true
@change(fragment, options)
return
_urlChange:(fragment, options)->
@._processStep.status = '_urlChange'
@._processStep.args = [fragment, options]
if @.isSuspend
return
if not options
options = @._changeOptions
url = @.root + @.fragment.replace(routeStripper, '')
#末尾に slash を付ける必要がある場合つける
isFile = url.match(filePattern)
isLastSlash = url.match(trailingSlash)
if @.isLastSlash and not isFile and not isLastSlash
url += "/"
if not @.silent
if @._hasPushState
@.history[ if options.replace then 'replaceState' else 'pushState' ]({}, document.title, url)
else if @._wantChangeHash
@_updateHash(@.location, fragment, options.replace)
if @.iframe and (fragment isnt @getFragment(@getHash(@.iframe)))
if !options.replace
@.iframe.document.open().close()
@_updateHash(@.iframe.location, fragment, options.replace)
else
return @.location.assign(url)
#イベントディスパッチ
@dispatchEvent(new KazitoriEvent(KazitoriEvent.CHANGE, @.fragment, @.lastFragment))
if options.internal and options.internal is true
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.INTERNAL_CHANGE, @.fragment, @.lastFragment))
@loadURL(@.fragment, options)
return
###*
* 中止します。
* @method reject
###
reject:()->
@dispatchEvent(new KazitoriEvent(KazitoriEvent.REJECT, @.fragment ))
if @._beforeDeffer
@._beforeDeffer.removeEventListener KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete
@._beforeDeffer.removeEventListener KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed
@._beforeDeffer = null
return
###*
* 処理を一時停止します。<br>
* SUSPEND イベントがディスパッチされます。
* @method suspend
###
suspend:()->
if @._beforeDeffer?
@._beforeDeffer.suspend()
@.started = false
@.isSuspend = true
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.SUSPEND, @.fragment, @.lastFragment ))
return
###*
* 処理を再開します。<br>
* RESUME イベントがディスパッチされます。
* @method resume
###
resume:()->
if @._beforeDeffer?
@._beforeDeffer.resume()
@.started = true
@.isSuspend = false
@[@._processStep.status](@._processStep.args)
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.RESUME, @.fragment, @.lastFragment ))
return
registerHandler:(rule, name, isBefore, callback )->
if not callback
if isBefore
callback = @_bindFunctions(name)
else if name instanceof Kazitori
@_bindChild(rule, name)
return @
else if typeof name is "function"
#これ再帰的にチェックするメソッドに落としこもう
#__super__ って coffee のクラスだけなきガス
#むーん
if name.hasOwnProperty('__super__')
try
child = new name({'isAutoStart':false})
@_bindChild(rule, child)
return @
catch e
callback = name
else
callback = name
else
callback = @[name]
target = if isBefore then @.beforeHandlers else @.handlers
target.unshift new Rule(rule, (fragment)->
args = @.router.extractParams(@, fragment)
callback && callback.apply(@.router, args)
,@)
return @
_bindChild:(rule, child)->
child.reject()
child.stop()
childHandlers = child.handlers.concat()
for childRule in childHandlers
childRule.update(rule)
@.handlers = childHandlers.concat @.handlers
childBefores = child.beforeHandlers.concat()
for childBefore in childBefores
childBefore.update(rule)
@.beforeHandlers = childBefores.concat @.beforeHandlers
if child.beforeAnytimeHandler
@.lastAnytime = @.beforeAnytime.concat()
@_bindBeforeAnytime(@.beforeAnytime, [child.beforeAnytimeHandler.callback])
return
###*
* ルーターを動的に追加します。<br>
* ルーターの追加に成功した場合、ADDED イベントがディスパッチされます。
* <h4>example</h4>
* fooRouter = new FooRouter();
* app.appendRouter(foo);
* @method appendRouter
* @param {Object} child
* @param {String} childRoot
###
appendRouter:(child, childRoot)->
if not child instanceof Kazitori and typeof child isnt "function"
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
return
if child instanceof Kazitori
rule = @_getChildRule(child, childRoot)
@_bindChild(rule, child)
return @
else
if child.hasOwnProperty('__super__')
try
_instance = new child({'isAutoStart':false})
rule = @_getChildRule(_instance, childRoot)
@_bindChild(rule, _instance)
return @
catch e
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.ADDED, @.fragment, @.lastFragment ))
return @
_getChildRule:(child, childRoot)->
rule = child.root
if childRoot
rule = childRoot
if rule.match(trailingSlash)
rule = rule.replace(trailingSlash, '')
if rule is @.root
throw new Error("かぶってる")
return rule
###*
* 動的に追加したルーターを削除します。
* ルーターの削除に成功した場合、REMOVED イベントがディスパッチされます。
* <h4>example</h4>
* foo = new FooRouter();
* app.appendRouter(foo);
* app.removeRouter(foo);
* @method removeRouter
* @param {Object} child
* @param {String} childRoot
###
removeRouter:(child, childRoot)->
if not child instanceof Kazitori and typeof child isnt "function"
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
return
if child instanceof Kazitori
@_unbindChild(child, childRoot)
else
if child.hasOwnProperty('__super__')
try
_instance = new child({'isAutoStart':false})
@_unbindChild(_instance, childRoot)
return @
catch e
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.REMOVED, @.fragment, @.lastFragment))
return @
_unbindChild:(child, childRoot)->
rule = @_getChildRule(child, childRoot)
i = 0
len = @.handlers.length
newHandlers = []
while i < len
ruleObj = @.handlers.shift()
if (ruleObj.rule.match rule) is null
newHandlers.unshift(ruleObj)
i++
@.handlers = newHandlers
i = 0
len = @.beforeHandlers.length
newBefores = []
while i < len
beforeRule = @.beforeHandlers.shift()
if (beforeRule.rule.match rule) is null
newBefores.unshift(beforeRule)
i++
@.beforeHandlers = newBefores
return
###*
* ブラウザから現在の URL を読み込みます。
* @method loadURL
* @param {String} fragmentOverride
* @param {Object} options
###
loadURL:(fragmentOverride, options)->
@._processStep.status = 'loadURL'
@._processStep.args = [fragmentOverride, options]
if @.isSuspend
return
fragment = @.fragment = @getFragment(fragmentOverride)
if @.isTemae is false and (@.beforeAnytimeHandler or @.beforeHandlers.length > 0)
@_executeBefores(fragment)
else
@executeHandlers()
return
###*
* 指定した 文字列に対応した URL ルールが設定されているかどうか<br>
* Boolean で返します。
* <h4>example</h4>
* app.match('/hoge');
* @method match
* @param {String} fragment
* @return {Boolean}
###
match:(fragment)->
matched = @._matchCheck(fragment, @.handlers, true)
return matched.length > 0
#before で登録した処理が無難に終わった
beforeComplete:(event)=>
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete)
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed)
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.BEFORE_EXECUTED, @.fragment, @.lastFragment))
#ここではんだんするしかないかなー
if @.isTemae
@_urlChange(@.fragment, @._changeOptions)
else
@executeHandlers()
return
#登録されたbefores を実行
_executeBefores:(fragment)=>
@._processStep.status = '_executeBefores'
@._processStep.args = [fragment]
@._beforeDeffer = new Deffered()
if @.beforeAnytimeHandler?
@._beforeDeffer.deffered((d)=>
@.beforeAnytimeHandler.callback(fragment)
d.execute(d)
return
)
matched = @._matchCheck(fragment, @.beforeHandlers)
for handler in matched
@._beforeDeffer.deffered((d)->
handler.callback(fragment)
d.execute(d)
return
)
@._beforeDeffer.addEventListener(KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete)
@._beforeDeffer.addEventListener(KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed)
@._beforeDeffer.execute(@._beforeDeffer)
return
#routes で登録されたメソッドを実行
executeHandlers:()=>
@._processStep.status = 'executeHandlers'
@._processStep.args = []
if @.isSuspend
return
#毎回 match チェックしてるので使いまわしたいのでリファクタ
matched = @._matchCheck(@.fragment, @.handlers)
isMatched = true
if matched is false or matched.length < 1
if @.notFound isnt null
@._notFound.callback(@.fragment)
isMatched = false
@._dispatcher.dispatchEvent(new KazitoriEvent(KazitoriEvent.NOT_FOUND))
else if matched.length > 1
for match in matched
if @.fragment.indexOf(match.rule) > -1
match.callback(@.fragment)
# if @.fragment.indexOf match.rule
else
for handler in matched
handler.callback(@.fragment)
if @._isFirstRequest
#間に合わないので遅延させて発行
setTimeout ()=>
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.FIRST_REQUEST, @.fragment, null))
if isMatched
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.EXECUTED, @.fragment, null))
,0
@._isFirstRequest = false
else
if isMatched
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.EXECUTED, @.fragment, @.lastFragment))
return matched
beforeFailed:(event)=>
@.beforeFailedHandler.apply(@, arguments)
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed)
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete)
if @isBeforeForce
@beforeComplete()
@._beforeDeffer = null
return
#URL の変更を監視
observeURLHandler:(event)=>
current = @getFragment()
if current is @.fragment and @.iframe
current = @getFragment(@getHash(@.iframe))
if current is @.fragment
return false
if @.iframe
@change(current)
if @.lastFragment is current and @.isUserAction is false
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.PREV, current, @.fragment ))
else if @.lastFragment is @.fragment and @.isUserAction is false
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.NEXT, current, @.lastFragment ))
@.isUserAction = false
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.CHANGE, current, @.lastFragment ))
return @loadURL(current)
# routes から指定されたルーティングをバインド
_bindRules:()->
if not @.routes?
return
routes = @_keys(@.routes)
for rule in routes
@registerHandler(rule, @.routes[rule], false)
return
# befores から指定された事前に処理したいメソッドをバインド
_bindBefores:()->
if @.beforeAnytime
@_bindBeforeAnytime(@.beforeAnytime)
if not @.befores?
return
befores = @_keys(@.befores)
for key in befores
@registerHandler(key, @.befores[key], true)
return
_bindBeforeAnytime:(funcs, bindedFuncs)->
callback = @_bindFunctions(funcs, bindedFuncs)
@.beforeAnytimeHandler = {
callback:@_binder (fragment)->
args = [fragment]
callback && callback.apply(@, args)
,@
}
return
# notFound で指定されたメソッドをバインド
_bindNotFound:()->
if not @.notFound?
return
if typeof @.notFound is "string"
for rule in @.handlers
if rule.rule is '/' + @.notFound.replace(@.root, '')
@._notFound = rule
return
else
notFoundFragment = @_keys(@.notFound)[0]
notFoundFuncName = @.notFound[notFoundFragment]
if typeof notFoundFuncName is "function"
callback = notFoundFuncName
else
callback = @[notFoundFuncName]
@._notFound = new Rule(notFoundFragment, (fragment)->
args = @.router.extractParams(@, fragment)
callback && callback.apply(@.router, args)
,@)
return
_updateHash:(location, fragment, replace)->
atRoot = @.location.pathname.replace(/[^\/]$/, '$&/') is @.root
unless atRoot
location.replace @.root + '#' + fragment
return
if replace
href = location.href.replace /(javascript:|#).*$/, ''
location.replace href + '#' + fragment
# location.replace @.root + '#' + fragment
else
location.hash = "#" + fragment
return
#zantei
_updateHashIE:(fragment, replace)->
location.replace @.root + '#/' + fragment
return
#マッチする URL があるかどうか
# memo : 20130130
# ここでここまでのチェックを実際に行うなら
# loadURL, executeHandler 内で同じチェックは行う必要がないはずなので
# それぞれのメソッドが簡潔になるようにリファクタする必要がある
_matchCheck:(fragment, handlers, test=false)->
matched = []
tmpFrag = fragment
if tmpFrag isnt undefined and tmpFrag isnt 'undefined'
hasQuery = @_match.apply(tmpFrag, [/(\?[\w\d=|]+)/g])
if hasQuery
fragment = fragment.split('?')[0]
for handler in handlers
if handler.rule is fragment
matched.push handler
else if handler.test(fragment)
if handler.isVariable and handler.types.length > 0
#型チェック用
# args = handler._extractParams(fragment)
args = @.extractParams(handler, fragment, test)
argsMatch = []
len = args.length
i = 0
while i < len
a = args[i]
t = handler.types[i]
if typeof a isnt "object"
if t is null
argsMatch.push true
else
argsMatch.push @_typeCheck(a,t)
i++
argsMatched = true
for match in argsMatch
if not match
argsMatched = false
if argsMatched
matched.push handler
else
matched.push handler
return if matched.length > 0 then matched else false
#===============================================
#
# URL Queries
#
#==============================================
###*
* URL ルート以下を取得
* @method getFragment
* @param {String} fragment
###
getFragment:(fragment)->
if not fragment? or fragment == undefined
if @._hasPushState or !@._wantChangeHash
fragment = @.location.pathname
matched = false
frag = fragment
if frag.match(/^\//)
frag = frag.substr(1)
root = @.root
if root.match(/^\//)
root = root.substr(1)
for index in @.rootFiles
if index is frag or root + index is frag
matched = true
if matched
fragment = @.root
fragment = fragment + @.location.search
root = @.root.replace(trailingSlash, '')
if fragment.indexOf(root) > -1
fragment = fragment.substr(root.length)
else
fragment = @getHash()
else
root = @.root.replace(trailingSlash, '')
if fragment.indexOf(@.root) > -1 and fragment.indexOf(root) > -1
fragment = fragment.substr(root.length)
if typeof fragment is "string"
fragment = fragment.replace(trailingSlash, '')
fragment = "/" if fragment is ""
# console.log "kazitori current fragment::", fragment.replace(trailingSlash, '')
return fragment
###*
* URL の # 以降を取得
* @method getHash
* @return {String} URL の # 以降の文字列
###
getHash:()->
match = (window || @).location.href.match(/#(.*)$/)
if match?
return match[1]
else
return ''
return
###*
* URL パラメータを分解
* @method extractParams
* @param {Rule} rule
* @param {String} fragment
* @param {Boolean} test
###
extractParams:(rule, fragment, test=false)->
if @._params.params.length > 0 and @._params.fragment is fragment
return @._params.params
param = rule._regexp.exec(fragment)
if param is null and fragment.indexOf('?') > -1
param = [0,'?' + fragment.split('?')[1]]
@._params.fragment = fragment
if param?
newParam = param.slice(1)
last = param[param.length - 1]
if last.indexOf('?') > -1
newQueries = {}
queries = last.split('?')[1]
queryParams = queries.split('&')
for query in queryParams
kv = query.split('=')
k = kv[0]
v = if kv[1] then kv[1] else ""
if v.indexOf('|') > -1
v = v.split("|")
newQueries[k] = v
newParam.pop()
newParam.push last.split('?')[0]
q = {"queries":newQueries}
newParam.push q
if not test
@._params.params = @_getCastedParams(rule, newParam.slice(0))
@._params.queries = newQueries
if @isOldIE
@.params = @._params.params
@.queries = @._params.queries
else
if not test
@._params.params = @_getCastedParams(rule, newParam)
if @isOldIE
@.params = @._params.params
return newParam
else
@._params.params = []
if @isOldIE
@.param = []
return null
return
#パラメーターを指定された型でキャスト
_getCastedParams:(rule, params)->
i = 0
if not params
return params
if rule.types.length < 1
return params
len = params.length
castedParams = []
while i < len
if rule.types[i] is null
castedParams.push params[i]
else if typeof params[i] is "object"
castedParams.push params[i]
else
for type in VARIABLE_TYPES
if rule.types[i] is type.name
castedParams.push type.cast(params[i])
i++
return castedParams
#===============================================
#
# Event
#
#==============================================
addEventListener:(type, listener)->
@_dispatcher.addEventListener(type, listener)
return
removeEventListener:(type, listener)->
@_dispatcher.removeEventListener(type, listener)
return
dispatchEvent:(event)->
@_dispatcher.dispatchEvent(event)
return
_addPopStateHandler:()->
win = window
if @._hasPushState is true
win.addEventListener 'popstate', @observeURLHandler
if @._wantChangeHash is true and not @.isOldIE
win.addEventListener 'hashchange', @observeURLHandler
else if @._wantChangeHash is true
win.attachEvent 'onhashchange', @observeURLHandler
return
_removePopStateHandler:()->
win = window
win.removeEventListener 'popstate', @observeURLHandler
win.removeEventListener 'hashchange', @observeURLHandler
if @.isOldIE
win.detachEvent 'onhashchange', @observeURLHandler
return
#==============================================
#
# utils
#
#==============================================
_slice: Array.prototype.slice
_replace:String.prototype.replace
_match:String.prototype.match
_keys: Object.keys || (obj)->
if obj is not Object(obj)
throw new TypeError('object ja nai')
keys = []
for key of obj
if Object.hasOwnProperty.call(obj, key)
keys[keys.length] = key
return keys
_binder:(func, obj)->
slice = @_slice
args = slice.call(arguments, 2)
return ()->
return func.apply(obj||{},args.concat(slice.call(arguments)))
_extend:(obj)->
@_each( @_slice.call(arguments,1), (source)->
if source
for prop of source
obj[prop] = source[prop]
)
return obj
_each:(obj, iter, ctx)->
if not obj?
return
each = Array.prototype.forEach
if each && obj.forEach is each
obj.forEach(iter, ctx)
else if obj.length is +obj.length
i = 0
l = obj.length
while i < l
if iter.call(ctx, obj[i], i, obj ) is @breaker
return
i++
else
for k of obj
if k in obj
if iter.call(ctx, obj[k], k, obj) is @breaker
return
return
_bindFunctions:(funcs, insert)->
if typeof funcs is 'string'
funcs = funcs.split(',')
bindedFuncs = []
for funcName in funcs
func = @[funcName]
if not func?
names = funcName.split('.')
if names.length > 1
f = window[names[0]]
i = 1
len = names.length
while i < len
newF = f[names[i]]
if newF?
f = newF
i++
else
break
func = f
else
func = window[funcName]
if func?
bindedFuncs.push(func)
if insert
bindedFuncs = insert.concat bindedFuncs
callback =(args...)->
for func in bindedFuncs
func.apply(@, [args...])
return
return callback
_typeCheck:(a,t)->
matched = false
for type in VARIABLE_TYPES
if t.toLowerCase() is type.name
if type.cast(a)
matched = true
return matched
## Rule
# URL を定義する Rule クラス
# ちょっと大げさな気もするけど外部的には変わらんし
# 今後を見据えてクラス化しておく
###*
* pushState で処理したいルールを定義するクラス
*
* @class Rule
* @constructor
* @param {String} rule
* @param {Function} callback
* @param {Kazitori} router
###
class Rule
###*
* ルール文字列
* @property rule
* @type String
* @default ""
###
rule: ""
_regexp: null
###*
* コールバック関数
* ルールとマッチする場合実行されます。
* @property callback
* @type: Function
* @default null
###
callback:null
name:""
router:null
isVariable:false
types:[]
constructor:(rule, callback, router)->
if typeof rule isnt "string" and typeof rule isnt "Number"
return
@callback = callback
@router = router
@update(rule)
#マッチするかどうかテスト
# **args**
# fragment : テスト対象となる URL
# **return**
# Boolean : テスト結果の真偽値
###*
* Rule として定義したパターンと fragment として与えられた文字列がマッチするかどうかテストする
* @method test
* @param {String} fragment
* @return {Boolean} マッチする場合 true を返す
###
test:(fragment)->
return @_regexp.test(fragment)
_ruleToRegExp:(rule)->
newRule = rule.replace(escapeRegExp, '\\$&').replace(optionalParam, '(?:$1)?').replace(namedParam, '([^\/]+)').replace(splatParam, '(.*?)')
return new RegExp('^' + newRule + '$')
###*
* 与えられた path で現在の Rule をアップデートします。
* @method update
* @param {String} path
###
update:(path)=>
@.rule = path + @.rule
#trailing last slash
if @.rule isnt '/'
@.rule = @.rule.replace(trailingSlash, '')
@._regexp = @_ruleToRegExp(@.rule)
re = new RegExp(namedParam)
matched = path.match(re)
if matched isnt null
@isVariable = true
for m in matched
t = m.match(genericParam)||null
@types.push if t isnt null then t[1] else null
return
###*
* イベントディスパッチャ
* @class EventDispatcher
* @constructor
###
class EventDispatcher
listeners:{}
addEventListener:(type, listener)->
if @listeners[ type ] is undefined
@listeners[ type ] =[]
if @_inArray(listener, @listeners[type]) < 0
@listeners[type].push listener
return
removeEventListener:(type, listener)->
len = 0
for prop of @listeners
len++
if len < 1
return
arr = @listeners[type]
if not arr
return
i = 0
len = arr.length
while i < len
if arr[i] is listener
if len is 1
delete @listeners[type]
else arr.splice(i,1)
break
i++
return
dispatchEvent:(event)->
ary = @listeners[ event.type ]
if ary isnt undefined
event.target = @
for handler in ary
handler.call(@, event)
return
_inArray: ( elem, array )->
i = 0
len = array.length
while i < len
if array[ i ] is elem
return i
i++
return -1
## Deffered
# **internal**
# before を確実に処理するための簡易的な Deffered クラス
class Deffered extends EventDispatcher
queue : []
isSuspend : false
constructor:()->
@queue = []
@isSuspend = false
deffered:(func)->
@queue.push func
return @
execute:()->
if @isSuspend
return
try
task = @queue.shift()
if task
task.apply(@, arguments)
if @queue.length < 1
@queue = []
@.dispatchEvent(new KazitoriEvent(KazitoriEvent.TASK_QUEUE_COMPLETE))
catch error
@reject(error)
#defferd を中断する
reject:(error)->
message = if not error then "user reject" else error
@dispatchEvent({type:KazitoriEvent.TASK_QUEUE_FAILED, index:@index, message:message })
@isSuspend = false
return
#deffered を一時停止する
suspend:()->
@isSuspend = true
return
#deffered を再開する
resume:()->
@isSuspend = false
@execute()
return
## KazitoriEvent
# Kazitori がディスパッチするイベント
###*
* pushState 処理や Kazitori にまつわるイベント
* @class KazitoriEvent
* @constructor
* @param {String} type
* @param {String} next
* @param {String} prev
###
class KazitoriEvent
next:null
prev:null
type:null
constructor:(type, next, prev)->
@type = type
@next = next
@prev = prev
clone:()->
return new KazitoriEvent(@type, @next, @prev)
toString:()->
return "KazitoriEvent :: " + "type:" + @type + " next:" + String(@next) + " prev:" + String(@prev)
###*
* タスクキューが空になった
* @property TASK_QUEUE_COMPLETE
* @type String
* @default task_queue_complete
###
KazitoriEvent.TASK_QUEUE_COMPLETE = 'task_queue_complete'
###*
* タスクキューが中断された
* @property TASK_QUEUE_FAILED
* @type String
* @default task_queue_failed
###
KazitoriEvent.TASK_QUEUE_FAILED = 'task_queue_failed'
###*
* URL が変更された
* @property CHANGE
* @type String
* @default change
###
KazitoriEvent.CHANGE = 'change'
###*
* URL に登録されたメソッドがちゃんと実行された
* @property EXECUTED
* @type String
* @default executed
###
KazitoriEvent.EXECUTED = 'executed'
###*
* 事前処理が完了した
* @property BEFORE_EXECUTED
* @type String
* @default before_executed
###
KazitoriEvent.BEFORE_EXECUTED = 'before_executed'
###*
* ユーザーアクション以外で URL の変更があった
* @property INTERNAL_CHANGE
* @type String
* @default internal_change
###
KazitoriEvent.INTERNAL_CHANGE = 'internal_change'
KazitoriEvent.USER_CHANGE = 'user_change'
###*
* ヒストリーバックした
* @property PREV
* @type String
* @default prev
###
KazitoriEvent.PREV = 'prev'
###*
* ヒストリーネクストした時
* @property NEXT
* @type String
* @default next
###
KazitoriEvent.NEXT = 'next'
###*
* Kazitori が中断した
* @property REJECT
* @type String
* @default reject
###
KazitoriEvent.REJECT = 'reject'
###*
* URL にマッチする処理が見つからなかった
* @property NOT_FOUND
* @type String
* @default not_found
###
KazitoriEvent.NOT_FOUND = 'not_found'
###*
* Kazitori が開始した
* @property START
* @type String
* @default start
###
KazitoriEvent.START = 'start'
###*
* Kazitori が停止した
* @property STOP
* @type String
* @default stop
###
KazitoriEvent.STOP = 'stop'
###*
* Kazitori が一時停止した
* @property SUSPEND
* @type String
* @default SUSPEND
###
KazitoriEvent.SUSPEND = 'SUSPEND'
###*
* Kazitori が再開した
* @property RESUME
* @type String
* @default resume
###
KazitoriEvent.RESUME = 'resume'
###*
* Kazitori が開始してから、一番最初のアクセスがあった
* @property FIRST_REQUEST
* @type String
* @default first_request
###
KazitoriEvent.FIRST_REQUEST = 'first_request'
###*
* ルーターが追加された
* @property ADDED
* @type String
* @default added
###
KazitoriEvent.ADDED = 'added'
###*
* ルーターが削除された
* @property REMOVED
* @type String
* @default removed
###
KazitoriEvent.REMOVED = 'removed'
| true | #### Copyrights
# (c) 2013 PI:NAME:<NAME>END_PI
# kazitori.js may be freely distributed under the MIT license.
# http://dev.hageee.net
# inspired from::
# (c) 2010-2012 PI:NAME:<NAME>END_PI, DocumentCloud Inc.
# Backbone may be freely distributed under the MIT license.
# For all details and documentation:
# http://backbonejs.org
#
#----------------------------------------------
#delegate
delegater = (target, func)->
return ()->
func.apply(target, arguments)
#regexps
trailingSlash = /\/$/
routeStripper = /^[#\/]|\s+$/g
escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g
namedParam = /<(\w+|[A-Za-z_-]+:\w+)>/g
genericParam = /([A-Za-z_-]+):(\w+)/
filePattern = /\w+\.[a-zA-Z0-9]{3,64}/
optionalParam = /\((.*?)\)/g
splatParam = /\*\w+/g
#--------------------------------------------
###URL 変数に対して指定できる型###
# **Default:**
#
# * int : Number としてキャストされます
# * string : String としてキャストされます
#
VARIABLE_TYPES = [
{
name:"int"
cast:Number
},
{
name:"string"
cast:String
}
]
#--------------------------------------------
###*
* Kazitori.js は pushState をいい感じにさばいてくれるルーターライブラリです。<br>
* シンプルかつ見通しよく pushState コンテンツのルーティングを定義することができます。
*
* 使い方はとても簡単。
* <ul><li>Kazitori を継承したクラスを作る</li><li>routes に扱いたい URL と、それに対応したメソッドを指定。</li><li>インスタンス化</li></ul>
*
* <h4>example</h4>
* class Router extends Kazitori
* routes:
* "/": "index"
* "/<int:id>": "show"
*
* index:()->
* console.log "index!"
* show:(id)->
* console.log id
*
* $(()->
* app = new Router()
* )
*
* Kazitori では pushState で非同期コンテンツを作っていく上で必要となるであろう機能を他にも沢山用意しています。<br>
* 詳細は API 一覧から確認して下さい。
* @module Kazitori.js
* @main Kazitori
###
## Kazitori クラス
###*
* Kazitori のメインクラス
*
* @class Kazitori
* @constructor
###
class Kazitori
VERSION: "1.0.2"
history: null
location: null
###*
* マッチするURLのルールと、それに対応する処理を定義します。
* <h4>example</h4>
* routes:
* '/':'index'
* '/<int:id>':'show'
*
* @property routes
* @type Object
* @default {}
###
routes: {}
handlers: []
###*
* マッチした URL に対する処理を行う前に実行したい処理を定義します。
* @property befores
* @type Object
* @default {}
###
befores: {}
beforeHandlers: []
###*
* URL が変わる際、事前に実行したい処理を定義します。<br>
* このプロパティに登録された処理は、与えられた URL にマッチするかどうかにかかわらず、常に実行されます。
* @property beforeAnytimeHandler
* @type Array
* @default []
###
beforeAnytimeHandler: null
afterhandlers: []
###*
* 特定のファイル名が URL に含まれていた時、ルートとして処理するリストです。
* @property rootFiles
* @type Array
###
rootFiles: ['index.html', 'index.htm', 'index.php', 'unko.html']
###*
* ルートを指定します。<br>
* ここで指定された値が URL の prefix として必ずつきます。<br>
* 物理的に URL のルートより 1ディレクトリ下がった箇所で pushState を行いたい場合<br>
* この値を / 以外に指定します。
* <h4>example</h4>
* コンテンツを配置する実ディレクトリが example だった場合
*
* app = new Router({root:'/example/'})
* @property root
* @type String
* @default /
###
root: null
###*
* 現在の URL にマッチするルールがなかった場合に変更する URL
* @property notFound
* @type String
* @default null
###
notFound: null
direct: null
isIE: false
###*
* URL を実際には変更しないようにするかどうかを決定します。<br>
* true にした場合、URL は変更されず、内部で保持している状態管理オブジェクトを基準に展開します。
* @property silent
* @type Boolean
* @default false
###
silent: false
###*
* pushState への監視が開始されているかどうか
* @property started
* @type Boolean
* @default false
###
started: false
#URL パラメーター
_params:
params:[]
'fragment':''
###*
* before 処理が失敗した時に実行されます。<br>
* デフォルトでは空の function になっています。
*
* @method beforeFailedHandler
###
beforeFailedHandler:()->
return
###isBeforeForce###
isBeforeForce: false
#befores の処理を URL 変更前にするかどうか
isTemae: false
_changeOptions: null
isNotFoundForce: false
_notFound: null
breaker: {}
_dispatcher: null
_beforeDeffer: null
###*
* 現在の URL を返します。
* @property fragment
* @type String
* @default null
###
fragment: null
###*
* 現在の URL から 1つ前の URL を返します。
* @property lastFragment
* @type String
* @default null
###
lastFragment: null
isUserAction: false
_isFirstRequest: true
#pushState が使えない IE で初回時にリダイレクトするかどうか
isInitReplace : true
#末尾のスラッシュ
isLastSlash : false
###*
* 一時停止しているかどうかを返します。
*
* @property isSuspend
* @type Boolean
* @default false
###
isSuspend: false
_processStep:
'status': 'null'
'args': []
constructor:(options)->
@._processStep.status = 'constructor'
@._processStep.args = [options]
@.options = options || (options = {})
if options.routes
@.routes = options.routes
@.root = if options.hasOwnProperty "root" then options.root else if @.root is null then '/' else @.root
@.isTemae = if options.isTemae then options.isTemae else false
@.silent = if options.silent then options.silent else false
@.isInitReplace = if options.hasOwnProperty "isInitReplace" then options.isInitReplace else true
@.isLastSlash = if options.hasOwnProperty "isLastSlash" then options.isLastSlash else false
@._params = {
params:[]
queries:{}
fragment:null
}
#見つからなかった時強制的に root を表示する
# @.notFound = if options.notFound then options.notFound else @.root
if @.notFound is null
@.notFound = if options.notFound then options.notFound else @.root
win = window
if typeof win != 'undefined'
@.location = win.location
@.history = win.history
docMode = document.documentMode
@isIE = win.navigator.userAgent.toLowerCase().indexOf('msie') != -1
@isOldIE = @isIE and (!docMode||docMode < 9)
@_dispatcher = new EventDispatcher()
@.handlers = []
@.beforeHandlers = []
@_bindBefores()
@_bindRules()
@_bindNotFound()
try
Object.defineProperty(@, 'params', {
enumerable : true
get:()->
return @._params.params
})
Object.defineProperty(@, 'queries', {
enumerable : true
get:()->
return @._params.queries
})
catch e
if @isOldIE
@.params = @._params.params
@.queries = @._params.queries
#throw new Error(e)
#IEだと defineProperty がアレらしいので
#@.__defineGetter__ したほうがいいかなー
if not @.options.isAutoStart? or @.options.isAutoStart != false
@start()
###*
* Kazitori.js を開始します。<br>
* START イベントがディスパッチされます。
* @method start
* @param {Object} options オプション
###
start:(options)->
@._processStep.status = 'start'
@._processStep.args = [options]
if @.started
throw new Error('mou hazim matteru')
@.started = true
win = window
@.options = @_extend({}, {root:'/'}, @.options, options)
@._hasPushState = !!(@.history and @.history.pushState)
@._wantChangeHash = @.options.hashChange isnt false
fragment = @.fragment = @getFragment()
atRoot = @.location.pathname.replace(/[^\/]$/, '$&/') is @.root
if @isIE and not atRoot and not @._hasPushState and @isInitReplace
ieFrag = @.location.pathname.replace(@.root, '')
@_updateHashIE(ieFrag)
if @isOldIE and @._wantChangeHash
frame = document.createElement("iframe")
frame.setAttribute("src","javascript:0")
frame.setAttribute("tabindex", "-1")
frame.style.display = "none"
document.body.appendChild(frame)
@.iframe = frame.contentWindow
@change(fragment)
@._addPopStateHandler()
if @._hasPushState and atRoot and @.location.hash
@.fragment = @.lastFragment = @.getHash().replace(routeStripper, '')
@.history.replaceState({}, document.title, @.root + @.fragment + @.location.search)
#スタートイベントをディスパッチ
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.START, @.fragment ))
override = @.root
if !@.silent
if not @._hasPushState and atRoot
# override = @.root + @.fragment.replace(routeStripper, '')
override = @.fragment
else if not atRoot
override = @.fragment
return @loadURL(override)
###*
* Kazitori.js を停止します。<br>
* STOP イベントがディスパッチされます。
* @method stop
###
stop:()->
win = window
win.removeEventListener 'popstate', @observeURLHandler
win.removeEventListener 'hashchange', @observeURLHandler
@.started = false
#ストップイベントをディスパッチ
@._dispatcher.dispatchEvent(new KazitoriEvent(KazitoriEvent.STOP, @.fragment))
return
###*
* ブラウザのヒストリー機能を利用して「進む」を実行します。<br>
* 成功した場合 NEXT イベントがディスパッチされます。
* @method torikazi
* @param {Object} options
###
torikazi:(options)->
return @direction(options, "next")
###*
* ブラウザヒストリー機能を利用して「戻る」を実行します。<br>
* 成功した場合 PREV イベントがディスパッチされます。
* @method omokazi
* @param {Object} options
###
omokazi:(options)->
return @direction(options, "prev")
direction:(option, direction)->
if not @.started
return false
tmpFrag = @.lastFragment
@.lastFragment = @getFragment()
@.direct = direction
@.isUserAction = true
@._removePopStateHandler()
if direction is "prev"
@.history.back()
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.PREV, tmpFrag, @.lastFragment ))
else if direction is "next"
@.history.forward()
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.NEXT, tmpFrag, @.lastFragment ))
else
return
@._addPopStateHandler()
return @loadURL(tmpFrag)
###*
* url を変更します。<br>
* 無事 URL が切り替わった場合、CHANGE イベントがディスパッチされます。
* <h4>example</h4>
* app.change('/someurl');
* @method change
* @param {String} fragment 変更したい URL
* @param {Object} options オプション
###
change:(fragment, options)->
if not @.started
return false
@._processStep.status = 'change'
@._processStep.args = [fragment, options]
if not options
options = {'trigger':options}
@._changeOptions = options
#TODO : @ に突っ込んじゃうとこのあと全部 BeforeForce されてまう
@.isBeforeForce = options.isBeforeForce isnt false
frag = @getFragment(fragment || '')
if @.fragment is frag
return
@.lastFragment = @.fragment
@.fragment = frag
next = @.fragment
#memo : jasmine だけなんかおかしい
#frag が undefined になってしまう
# console.debug frag
url = @.root + @_replace.apply(frag,[routeStripper, ''])
matched = @_matchCheck(@.fragment, @.handlers)
if matched is false and @.isNotFoundForce is false
if @.notFound isnt null
@._notFound.callback(@.fragment)
url = @.root + @._notFound.rule.replace(routeStripper, '')
@.history[ if options.replace then 'replaceState' else 'pushState' ]({}, document.title, url)
@._dispatcher.dispatchEvent(new KazitoriEvent(KazitoriEvent.NOT_FOUND))
return
if @.isTemae and (@.beforeAnytimeHandler or @.beforeHandlers.length > 0)
@_executeBefores(frag)
else
@_urlChange(frag, options)
return
###*
* pushState ではなく replaceState で処理します。<br>
* replaceState は現在の URL を置き換えるため、履歴には追加されません。
* <h4>example</h4>
* app.replace('/someurl');
* @method replace
* @param {String} fragment 変更したい URL
* @param {Object} options オプション
###
replace:(fragment, options)->
@._processStep.status = 'replace'
@._processStep.args = [fragment, options]
if not options
options = {replace:true}
else if not options.replace or options.replace is false
options.replace = true
@change(fragment, options)
return
_urlChange:(fragment, options)->
@._processStep.status = '_urlChange'
@._processStep.args = [fragment, options]
if @.isSuspend
return
if not options
options = @._changeOptions
url = @.root + @.fragment.replace(routeStripper, '')
#末尾に slash を付ける必要がある場合つける
isFile = url.match(filePattern)
isLastSlash = url.match(trailingSlash)
if @.isLastSlash and not isFile and not isLastSlash
url += "/"
if not @.silent
if @._hasPushState
@.history[ if options.replace then 'replaceState' else 'pushState' ]({}, document.title, url)
else if @._wantChangeHash
@_updateHash(@.location, fragment, options.replace)
if @.iframe and (fragment isnt @getFragment(@getHash(@.iframe)))
if !options.replace
@.iframe.document.open().close()
@_updateHash(@.iframe.location, fragment, options.replace)
else
return @.location.assign(url)
#イベントディスパッチ
@dispatchEvent(new KazitoriEvent(KazitoriEvent.CHANGE, @.fragment, @.lastFragment))
if options.internal and options.internal is true
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.INTERNAL_CHANGE, @.fragment, @.lastFragment))
@loadURL(@.fragment, options)
return
###*
* 中止します。
* @method reject
###
reject:()->
@dispatchEvent(new KazitoriEvent(KazitoriEvent.REJECT, @.fragment ))
if @._beforeDeffer
@._beforeDeffer.removeEventListener KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete
@._beforeDeffer.removeEventListener KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed
@._beforeDeffer = null
return
###*
* 処理を一時停止します。<br>
* SUSPEND イベントがディスパッチされます。
* @method suspend
###
suspend:()->
if @._beforeDeffer?
@._beforeDeffer.suspend()
@.started = false
@.isSuspend = true
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.SUSPEND, @.fragment, @.lastFragment ))
return
###*
* 処理を再開します。<br>
* RESUME イベントがディスパッチされます。
* @method resume
###
resume:()->
if @._beforeDeffer?
@._beforeDeffer.resume()
@.started = true
@.isSuspend = false
@[@._processStep.status](@._processStep.args)
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.RESUME, @.fragment, @.lastFragment ))
return
registerHandler:(rule, name, isBefore, callback )->
if not callback
if isBefore
callback = @_bindFunctions(name)
else if name instanceof Kazitori
@_bindChild(rule, name)
return @
else if typeof name is "function"
#これ再帰的にチェックするメソッドに落としこもう
#__super__ って coffee のクラスだけなきガス
#むーん
if name.hasOwnProperty('__super__')
try
child = new name({'isAutoStart':false})
@_bindChild(rule, child)
return @
catch e
callback = name
else
callback = name
else
callback = @[name]
target = if isBefore then @.beforeHandlers else @.handlers
target.unshift new Rule(rule, (fragment)->
args = @.router.extractParams(@, fragment)
callback && callback.apply(@.router, args)
,@)
return @
_bindChild:(rule, child)->
child.reject()
child.stop()
childHandlers = child.handlers.concat()
for childRule in childHandlers
childRule.update(rule)
@.handlers = childHandlers.concat @.handlers
childBefores = child.beforeHandlers.concat()
for childBefore in childBefores
childBefore.update(rule)
@.beforeHandlers = childBefores.concat @.beforeHandlers
if child.beforeAnytimeHandler
@.lastAnytime = @.beforeAnytime.concat()
@_bindBeforeAnytime(@.beforeAnytime, [child.beforeAnytimeHandler.callback])
return
###*
* ルーターを動的に追加します。<br>
* ルーターの追加に成功した場合、ADDED イベントがディスパッチされます。
* <h4>example</h4>
* fooRouter = new FooRouter();
* app.appendRouter(foo);
* @method appendRouter
* @param {Object} child
* @param {String} childRoot
###
appendRouter:(child, childRoot)->
if not child instanceof Kazitori and typeof child isnt "function"
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
return
if child instanceof Kazitori
rule = @_getChildRule(child, childRoot)
@_bindChild(rule, child)
return @
else
if child.hasOwnProperty('__super__')
try
_instance = new child({'isAutoStart':false})
rule = @_getChildRule(_instance, childRoot)
@_bindChild(rule, _instance)
return @
catch e
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.ADDED, @.fragment, @.lastFragment ))
return @
_getChildRule:(child, childRoot)->
rule = child.root
if childRoot
rule = childRoot
if rule.match(trailingSlash)
rule = rule.replace(trailingSlash, '')
if rule is @.root
throw new Error("かぶってる")
return rule
###*
* 動的に追加したルーターを削除します。
* ルーターの削除に成功した場合、REMOVED イベントがディスパッチされます。
* <h4>example</h4>
* foo = new FooRouter();
* app.appendRouter(foo);
* app.removeRouter(foo);
* @method removeRouter
* @param {Object} child
* @param {String} childRoot
###
removeRouter:(child, childRoot)->
if not child instanceof Kazitori and typeof child isnt "function"
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
return
if child instanceof Kazitori
@_unbindChild(child, childRoot)
else
if child.hasOwnProperty('__super__')
try
_instance = new child({'isAutoStart':false})
@_unbindChild(_instance, childRoot)
return @
catch e
throw new Error("引数の値が不正です。 引数として与えられるオブジェクトは Kazitori を継承している必要があります。")
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.REMOVED, @.fragment, @.lastFragment))
return @
_unbindChild:(child, childRoot)->
rule = @_getChildRule(child, childRoot)
i = 0
len = @.handlers.length
newHandlers = []
while i < len
ruleObj = @.handlers.shift()
if (ruleObj.rule.match rule) is null
newHandlers.unshift(ruleObj)
i++
@.handlers = newHandlers
i = 0
len = @.beforeHandlers.length
newBefores = []
while i < len
beforeRule = @.beforeHandlers.shift()
if (beforeRule.rule.match rule) is null
newBefores.unshift(beforeRule)
i++
@.beforeHandlers = newBefores
return
###*
* ブラウザから現在の URL を読み込みます。
* @method loadURL
* @param {String} fragmentOverride
* @param {Object} options
###
loadURL:(fragmentOverride, options)->
@._processStep.status = 'loadURL'
@._processStep.args = [fragmentOverride, options]
if @.isSuspend
return
fragment = @.fragment = @getFragment(fragmentOverride)
if @.isTemae is false and (@.beforeAnytimeHandler or @.beforeHandlers.length > 0)
@_executeBefores(fragment)
else
@executeHandlers()
return
###*
* 指定した 文字列に対応した URL ルールが設定されているかどうか<br>
* Boolean で返します。
* <h4>example</h4>
* app.match('/hoge');
* @method match
* @param {String} fragment
* @return {Boolean}
###
match:(fragment)->
matched = @._matchCheck(fragment, @.handlers, true)
return matched.length > 0
#before で登録した処理が無難に終わった
beforeComplete:(event)=>
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete)
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed)
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.BEFORE_EXECUTED, @.fragment, @.lastFragment))
#ここではんだんするしかないかなー
if @.isTemae
@_urlChange(@.fragment, @._changeOptions)
else
@executeHandlers()
return
#登録されたbefores を実行
_executeBefores:(fragment)=>
@._processStep.status = '_executeBefores'
@._processStep.args = [fragment]
@._beforeDeffer = new Deffered()
if @.beforeAnytimeHandler?
@._beforeDeffer.deffered((d)=>
@.beforeAnytimeHandler.callback(fragment)
d.execute(d)
return
)
matched = @._matchCheck(fragment, @.beforeHandlers)
for handler in matched
@._beforeDeffer.deffered((d)->
handler.callback(fragment)
d.execute(d)
return
)
@._beforeDeffer.addEventListener(KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete)
@._beforeDeffer.addEventListener(KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed)
@._beforeDeffer.execute(@._beforeDeffer)
return
#routes で登録されたメソッドを実行
executeHandlers:()=>
@._processStep.status = 'executeHandlers'
@._processStep.args = []
if @.isSuspend
return
#毎回 match チェックしてるので使いまわしたいのでリファクタ
matched = @._matchCheck(@.fragment, @.handlers)
isMatched = true
if matched is false or matched.length < 1
if @.notFound isnt null
@._notFound.callback(@.fragment)
isMatched = false
@._dispatcher.dispatchEvent(new KazitoriEvent(KazitoriEvent.NOT_FOUND))
else if matched.length > 1
for match in matched
if @.fragment.indexOf(match.rule) > -1
match.callback(@.fragment)
# if @.fragment.indexOf match.rule
else
for handler in matched
handler.callback(@.fragment)
if @._isFirstRequest
#間に合わないので遅延させて発行
setTimeout ()=>
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.FIRST_REQUEST, @.fragment, null))
if isMatched
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.EXECUTED, @.fragment, null))
,0
@._isFirstRequest = false
else
if isMatched
@._dispatcher.dispatchEvent( new KazitoriEvent(KazitoriEvent.EXECUTED, @.fragment, @.lastFragment))
return matched
beforeFailed:(event)=>
@.beforeFailedHandler.apply(@, arguments)
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_FAILED, @beforeFailed)
@._beforeDeffer.removeEventListener(KazitoriEvent.TASK_QUEUE_COMPLETE, @beforeComplete)
if @isBeforeForce
@beforeComplete()
@._beforeDeffer = null
return
#URL の変更を監視
observeURLHandler:(event)=>
current = @getFragment()
if current is @.fragment and @.iframe
current = @getFragment(@getHash(@.iframe))
if current is @.fragment
return false
if @.iframe
@change(current)
if @.lastFragment is current and @.isUserAction is false
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.PREV, current, @.fragment ))
else if @.lastFragment is @.fragment and @.isUserAction is false
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.NEXT, current, @.lastFragment ))
@.isUserAction = false
@._dispatcher.dispatchEvent( new KazitoriEvent( KazitoriEvent.CHANGE, current, @.lastFragment ))
return @loadURL(current)
# routes から指定されたルーティングをバインド
_bindRules:()->
if not @.routes?
return
routes = @_keys(@.routes)
for rule in routes
@registerHandler(rule, @.routes[rule], false)
return
# befores から指定された事前に処理したいメソッドをバインド
_bindBefores:()->
if @.beforeAnytime
@_bindBeforeAnytime(@.beforeAnytime)
if not @.befores?
return
befores = @_keys(@.befores)
for key in befores
@registerHandler(key, @.befores[key], true)
return
_bindBeforeAnytime:(funcs, bindedFuncs)->
callback = @_bindFunctions(funcs, bindedFuncs)
@.beforeAnytimeHandler = {
callback:@_binder (fragment)->
args = [fragment]
callback && callback.apply(@, args)
,@
}
return
# notFound で指定されたメソッドをバインド
_bindNotFound:()->
if not @.notFound?
return
if typeof @.notFound is "string"
for rule in @.handlers
if rule.rule is '/' + @.notFound.replace(@.root, '')
@._notFound = rule
return
else
notFoundFragment = @_keys(@.notFound)[0]
notFoundFuncName = @.notFound[notFoundFragment]
if typeof notFoundFuncName is "function"
callback = notFoundFuncName
else
callback = @[notFoundFuncName]
@._notFound = new Rule(notFoundFragment, (fragment)->
args = @.router.extractParams(@, fragment)
callback && callback.apply(@.router, args)
,@)
return
_updateHash:(location, fragment, replace)->
atRoot = @.location.pathname.replace(/[^\/]$/, '$&/') is @.root
unless atRoot
location.replace @.root + '#' + fragment
return
if replace
href = location.href.replace /(javascript:|#).*$/, ''
location.replace href + '#' + fragment
# location.replace @.root + '#' + fragment
else
location.hash = "#" + fragment
return
#zantei
_updateHashIE:(fragment, replace)->
location.replace @.root + '#/' + fragment
return
#マッチする URL があるかどうか
# memo : 20130130
# ここでここまでのチェックを実際に行うなら
# loadURL, executeHandler 内で同じチェックは行う必要がないはずなので
# それぞれのメソッドが簡潔になるようにリファクタする必要がある
_matchCheck:(fragment, handlers, test=false)->
matched = []
tmpFrag = fragment
if tmpFrag isnt undefined and tmpFrag isnt 'undefined'
hasQuery = @_match.apply(tmpFrag, [/(\?[\w\d=|]+)/g])
if hasQuery
fragment = fragment.split('?')[0]
for handler in handlers
if handler.rule is fragment
matched.push handler
else if handler.test(fragment)
if handler.isVariable and handler.types.length > 0
#型チェック用
# args = handler._extractParams(fragment)
args = @.extractParams(handler, fragment, test)
argsMatch = []
len = args.length
i = 0
while i < len
a = args[i]
t = handler.types[i]
if typeof a isnt "object"
if t is null
argsMatch.push true
else
argsMatch.push @_typeCheck(a,t)
i++
argsMatched = true
for match in argsMatch
if not match
argsMatched = false
if argsMatched
matched.push handler
else
matched.push handler
return if matched.length > 0 then matched else false
#===============================================
#
# URL Queries
#
#==============================================
###*
* URL ルート以下を取得
* @method getFragment
* @param {String} fragment
###
getFragment:(fragment)->
if not fragment? or fragment == undefined
if @._hasPushState or !@._wantChangeHash
fragment = @.location.pathname
matched = false
frag = fragment
if frag.match(/^\//)
frag = frag.substr(1)
root = @.root
if root.match(/^\//)
root = root.substr(1)
for index in @.rootFiles
if index is frag or root + index is frag
matched = true
if matched
fragment = @.root
fragment = fragment + @.location.search
root = @.root.replace(trailingSlash, '')
if fragment.indexOf(root) > -1
fragment = fragment.substr(root.length)
else
fragment = @getHash()
else
root = @.root.replace(trailingSlash, '')
if fragment.indexOf(@.root) > -1 and fragment.indexOf(root) > -1
fragment = fragment.substr(root.length)
if typeof fragment is "string"
fragment = fragment.replace(trailingSlash, '')
fragment = "/" if fragment is ""
# console.log "kazitori current fragment::", fragment.replace(trailingSlash, '')
return fragment
###*
* URL の # 以降を取得
* @method getHash
* @return {String} URL の # 以降の文字列
###
getHash:()->
match = (window || @).location.href.match(/#(.*)$/)
if match?
return match[1]
else
return ''
return
###*
* URL パラメータを分解
* @method extractParams
* @param {Rule} rule
* @param {String} fragment
* @param {Boolean} test
###
extractParams:(rule, fragment, test=false)->
if @._params.params.length > 0 and @._params.fragment is fragment
return @._params.params
param = rule._regexp.exec(fragment)
if param is null and fragment.indexOf('?') > -1
param = [0,'?' + fragment.split('?')[1]]
@._params.fragment = fragment
if param?
newParam = param.slice(1)
last = param[param.length - 1]
if last.indexOf('?') > -1
newQueries = {}
queries = last.split('?')[1]
queryParams = queries.split('&')
for query in queryParams
kv = query.split('=')
k = kv[0]
v = if kv[1] then kv[1] else ""
if v.indexOf('|') > -1
v = v.split("|")
newQueries[k] = v
newParam.pop()
newParam.push last.split('?')[0]
q = {"queries":newQueries}
newParam.push q
if not test
@._params.params = @_getCastedParams(rule, newParam.slice(0))
@._params.queries = newQueries
if @isOldIE
@.params = @._params.params
@.queries = @._params.queries
else
if not test
@._params.params = @_getCastedParams(rule, newParam)
if @isOldIE
@.params = @._params.params
return newParam
else
@._params.params = []
if @isOldIE
@.param = []
return null
return
#パラメーターを指定された型でキャスト
_getCastedParams:(rule, params)->
i = 0
if not params
return params
if rule.types.length < 1
return params
len = params.length
castedParams = []
while i < len
if rule.types[i] is null
castedParams.push params[i]
else if typeof params[i] is "object"
castedParams.push params[i]
else
for type in VARIABLE_TYPES
if rule.types[i] is type.name
castedParams.push type.cast(params[i])
i++
return castedParams
#===============================================
#
# Event
#
#==============================================
addEventListener:(type, listener)->
@_dispatcher.addEventListener(type, listener)
return
removeEventListener:(type, listener)->
@_dispatcher.removeEventListener(type, listener)
return
dispatchEvent:(event)->
@_dispatcher.dispatchEvent(event)
return
_addPopStateHandler:()->
win = window
if @._hasPushState is true
win.addEventListener 'popstate', @observeURLHandler
if @._wantChangeHash is true and not @.isOldIE
win.addEventListener 'hashchange', @observeURLHandler
else if @._wantChangeHash is true
win.attachEvent 'onhashchange', @observeURLHandler
return
_removePopStateHandler:()->
win = window
win.removeEventListener 'popstate', @observeURLHandler
win.removeEventListener 'hashchange', @observeURLHandler
if @.isOldIE
win.detachEvent 'onhashchange', @observeURLHandler
return
#==============================================
#
# utils
#
#==============================================
_slice: Array.prototype.slice
_replace:String.prototype.replace
_match:String.prototype.match
_keys: Object.keys || (obj)->
if obj is not Object(obj)
throw new TypeError('object ja nai')
keys = []
for key of obj
if Object.hasOwnProperty.call(obj, key)
keys[keys.length] = key
return keys
_binder:(func, obj)->
slice = @_slice
args = slice.call(arguments, 2)
return ()->
return func.apply(obj||{},args.concat(slice.call(arguments)))
_extend:(obj)->
@_each( @_slice.call(arguments,1), (source)->
if source
for prop of source
obj[prop] = source[prop]
)
return obj
_each:(obj, iter, ctx)->
if not obj?
return
each = Array.prototype.forEach
if each && obj.forEach is each
obj.forEach(iter, ctx)
else if obj.length is +obj.length
i = 0
l = obj.length
while i < l
if iter.call(ctx, obj[i], i, obj ) is @breaker
return
i++
else
for k of obj
if k in obj
if iter.call(ctx, obj[k], k, obj) is @breaker
return
return
_bindFunctions:(funcs, insert)->
if typeof funcs is 'string'
funcs = funcs.split(',')
bindedFuncs = []
for funcName in funcs
func = @[funcName]
if not func?
names = funcName.split('.')
if names.length > 1
f = window[names[0]]
i = 1
len = names.length
while i < len
newF = f[names[i]]
if newF?
f = newF
i++
else
break
func = f
else
func = window[funcName]
if func?
bindedFuncs.push(func)
if insert
bindedFuncs = insert.concat bindedFuncs
callback =(args...)->
for func in bindedFuncs
func.apply(@, [args...])
return
return callback
_typeCheck:(a,t)->
matched = false
for type in VARIABLE_TYPES
if t.toLowerCase() is type.name
if type.cast(a)
matched = true
return matched
## Rule
# URL を定義する Rule クラス
# ちょっと大げさな気もするけど外部的には変わらんし
# 今後を見据えてクラス化しておく
###*
* pushState で処理したいルールを定義するクラス
*
* @class Rule
* @constructor
* @param {String} rule
* @param {Function} callback
* @param {Kazitori} router
###
class Rule
###*
* ルール文字列
* @property rule
* @type String
* @default ""
###
rule: ""
_regexp: null
###*
* コールバック関数
* ルールとマッチする場合実行されます。
* @property callback
* @type: Function
* @default null
###
callback:null
name:""
router:null
isVariable:false
types:[]
constructor:(rule, callback, router)->
if typeof rule isnt "string" and typeof rule isnt "Number"
return
@callback = callback
@router = router
@update(rule)
#マッチするかどうかテスト
# **args**
# fragment : テスト対象となる URL
# **return**
# Boolean : テスト結果の真偽値
###*
* Rule として定義したパターンと fragment として与えられた文字列がマッチするかどうかテストする
* @method test
* @param {String} fragment
* @return {Boolean} マッチする場合 true を返す
###
test:(fragment)->
return @_regexp.test(fragment)
_ruleToRegExp:(rule)->
newRule = rule.replace(escapeRegExp, '\\$&').replace(optionalParam, '(?:$1)?').replace(namedParam, '([^\/]+)').replace(splatParam, '(.*?)')
return new RegExp('^' + newRule + '$')
###*
* 与えられた path で現在の Rule をアップデートします。
* @method update
* @param {String} path
###
update:(path)=>
@.rule = path + @.rule
#trailing last slash
if @.rule isnt '/'
@.rule = @.rule.replace(trailingSlash, '')
@._regexp = @_ruleToRegExp(@.rule)
re = new RegExp(namedParam)
matched = path.match(re)
if matched isnt null
@isVariable = true
for m in matched
t = m.match(genericParam)||null
@types.push if t isnt null then t[1] else null
return
###*
* イベントディスパッチャ
* @class EventDispatcher
* @constructor
###
class EventDispatcher
listeners:{}
addEventListener:(type, listener)->
if @listeners[ type ] is undefined
@listeners[ type ] =[]
if @_inArray(listener, @listeners[type]) < 0
@listeners[type].push listener
return
removeEventListener:(type, listener)->
len = 0
for prop of @listeners
len++
if len < 1
return
arr = @listeners[type]
if not arr
return
i = 0
len = arr.length
while i < len
if arr[i] is listener
if len is 1
delete @listeners[type]
else arr.splice(i,1)
break
i++
return
dispatchEvent:(event)->
ary = @listeners[ event.type ]
if ary isnt undefined
event.target = @
for handler in ary
handler.call(@, event)
return
_inArray: ( elem, array )->
i = 0
len = array.length
while i < len
if array[ i ] is elem
return i
i++
return -1
## Deffered
# **internal**
# before を確実に処理するための簡易的な Deffered クラス
class Deffered extends EventDispatcher
queue : []
isSuspend : false
constructor:()->
@queue = []
@isSuspend = false
deffered:(func)->
@queue.push func
return @
execute:()->
if @isSuspend
return
try
task = @queue.shift()
if task
task.apply(@, arguments)
if @queue.length < 1
@queue = []
@.dispatchEvent(new KazitoriEvent(KazitoriEvent.TASK_QUEUE_COMPLETE))
catch error
@reject(error)
#defferd を中断する
reject:(error)->
message = if not error then "user reject" else error
@dispatchEvent({type:KazitoriEvent.TASK_QUEUE_FAILED, index:@index, message:message })
@isSuspend = false
return
#deffered を一時停止する
suspend:()->
@isSuspend = true
return
#deffered を再開する
resume:()->
@isSuspend = false
@execute()
return
## KazitoriEvent
# Kazitori がディスパッチするイベント
###*
* pushState 処理や Kazitori にまつわるイベント
* @class KazitoriEvent
* @constructor
* @param {String} type
* @param {String} next
* @param {String} prev
###
class KazitoriEvent
next:null
prev:null
type:null
constructor:(type, next, prev)->
@type = type
@next = next
@prev = prev
clone:()->
return new KazitoriEvent(@type, @next, @prev)
toString:()->
return "KazitoriEvent :: " + "type:" + @type + " next:" + String(@next) + " prev:" + String(@prev)
###*
* タスクキューが空になった
* @property TASK_QUEUE_COMPLETE
* @type String
* @default task_queue_complete
###
KazitoriEvent.TASK_QUEUE_COMPLETE = 'task_queue_complete'
###*
* タスクキューが中断された
* @property TASK_QUEUE_FAILED
* @type String
* @default task_queue_failed
###
KazitoriEvent.TASK_QUEUE_FAILED = 'task_queue_failed'
###*
* URL が変更された
* @property CHANGE
* @type String
* @default change
###
KazitoriEvent.CHANGE = 'change'
###*
* URL に登録されたメソッドがちゃんと実行された
* @property EXECUTED
* @type String
* @default executed
###
KazitoriEvent.EXECUTED = 'executed'
###*
* 事前処理が完了した
* @property BEFORE_EXECUTED
* @type String
* @default before_executed
###
KazitoriEvent.BEFORE_EXECUTED = 'before_executed'
###*
* ユーザーアクション以外で URL の変更があった
* @property INTERNAL_CHANGE
* @type String
* @default internal_change
###
KazitoriEvent.INTERNAL_CHANGE = 'internal_change'
KazitoriEvent.USER_CHANGE = 'user_change'
###*
* ヒストリーバックした
* @property PREV
* @type String
* @default prev
###
KazitoriEvent.PREV = 'prev'
###*
* ヒストリーネクストした時
* @property NEXT
* @type String
* @default next
###
KazitoriEvent.NEXT = 'next'
###*
* Kazitori が中断した
* @property REJECT
* @type String
* @default reject
###
KazitoriEvent.REJECT = 'reject'
###*
* URL にマッチする処理が見つからなかった
* @property NOT_FOUND
* @type String
* @default not_found
###
KazitoriEvent.NOT_FOUND = 'not_found'
###*
* Kazitori が開始した
* @property START
* @type String
* @default start
###
KazitoriEvent.START = 'start'
###*
* Kazitori が停止した
* @property STOP
* @type String
* @default stop
###
KazitoriEvent.STOP = 'stop'
###*
* Kazitori が一時停止した
* @property SUSPEND
* @type String
* @default SUSPEND
###
KazitoriEvent.SUSPEND = 'SUSPEND'
###*
* Kazitori が再開した
* @property RESUME
* @type String
* @default resume
###
KazitoriEvent.RESUME = 'resume'
###*
* Kazitori が開始してから、一番最初のアクセスがあった
* @property FIRST_REQUEST
* @type String
* @default first_request
###
KazitoriEvent.FIRST_REQUEST = 'first_request'
###*
* ルーターが追加された
* @property ADDED
* @type String
* @default added
###
KazitoriEvent.ADDED = 'added'
###*
* ルーターが削除された
* @property REMOVED
* @type String
* @default removed
###
KazitoriEvent.REMOVED = 'removed'
|
[
{
"context": " long format', ->\n assert.equal geo.ip2long('87.229.134.24'), 1474659864\n assert.equal geo.ip2long('217",
"end": 292,
"score": 0.9997460246086121,
"start": 279,
"tag": "IP_ADDRESS",
"value": "87.229.134.24"
},
{
"context": ".24'), 1474659864\n assert.equal geo.ip2long('217.212.248.160'), 3654613152\n assert.equal geo.ip2long('188",
"end": 354,
"score": 0.9997521042823792,
"start": 339,
"tag": "IP_ADDRESS",
"value": "217.212.248.160"
},
{
"context": "160'), 3654613152\n assert.equal geo.ip2long('188.65.186.96'), 3158424160\n\n\n describe 'lookup()', ->\n\n be",
"end": 414,
"score": 0.9997378587722778,
"start": 401,
"tag": "IP_ADDRESS",
"value": "188.65.186.96"
},
{
"context": " find country', ->\n assert.equal geo.lookup('87.229.134.24').country, 'RU'\n assert.equal geo.lookup('2.",
"end": 561,
"score": 0.9997438192367554,
"start": 548,
"tag": "IP_ADDRESS",
"value": "87.229.134.24"
},
{
"context": "24').country, 'RU'\n assert.equal geo.lookup('2.20.4.1').country, 'IT'\n assert.equal geo.lookup('50",
"end": 617,
"score": 0.9996439218521118,
"start": 609,
"tag": "IP_ADDRESS",
"value": "2.20.4.1"
},
{
"context": ".1').country, 'IT'\n assert.equal geo.lookup('50.0.0.1').country, 'US'\n assert.equal geo.lookup('5.",
"end": 673,
"score": 0.9997237920761108,
"start": 665,
"tag": "IP_ADDRESS",
"value": "50.0.0.1"
},
{
"context": ".1').country, 'US'\n assert.equal geo.lookup('5.135.39.188').country, 'FR'\n assert.equal geo.lookup('19",
"end": 733,
"score": 0.9997072815895081,
"start": 721,
"tag": "IP_ADDRESS",
"value": "5.135.39.188"
},
{
"context": "88').country, 'FR'\n assert.equal geo.lookup('194.45.128.48').country, 'DE'\n assert.equal geo.lookup('91",
"end": 794,
"score": 0.9997411370277405,
"start": 781,
"tag": "IP_ADDRESS",
"value": "194.45.128.48"
},
{
"context": "48').country, 'DE'\n assert.equal geo.lookup('91.238.130.1').country, 'GB'\n\n it 'should return null for u",
"end": 854,
"score": 0.9997403621673584,
"start": 842,
"tag": "IP_ADDRESS",
"value": "91.238.130.1"
}
] | 01-geo-lookup/test/index.coffee | jatin-d/node-puzzle | 4 | assert = require 'assert'
geo = require '../lib'
octet = -> ~~(Math.random() * 254)
genip = -> "#{octet()}.#{octet()}.#{octet()}.#{octet()}"
describe 'geo', ->
describe 'ip2long()', ->
it 'IP should be converted to the long format', ->
assert.equal geo.ip2long('87.229.134.24'), 1474659864
assert.equal geo.ip2long('217.212.248.160'), 3654613152
assert.equal geo.ip2long('188.65.186.96'), 3158424160
describe 'lookup()', ->
before -> geo.load()
it 'should find country', ->
assert.equal geo.lookup('87.229.134.24').country, 'RU'
assert.equal geo.lookup('2.20.4.1').country, 'IT'
assert.equal geo.lookup('50.0.0.1').country, 'US'
assert.equal geo.lookup('5.135.39.188').country, 'FR'
assert.equal geo.lookup('194.45.128.48').country, 'DE'
assert.equal geo.lookup('91.238.130.1').country, 'GB'
it 'should return null for unknown IP', ->
result = geo.lookup '1.1.1.1'
assert.equal result, null
it 'should be freaking fast', ->
start = process.hrtime()
for i in [1..1e4]
geo.lookup genip()
diff = process.hrtime start
msec = Math.round (diff[0] * 1e9 + diff[1]) / 1e6
assert msec < 500, "It is damn too slow: #{msec}ms for 10k lookups"
| 90135 | assert = require 'assert'
geo = require '../lib'
octet = -> ~~(Math.random() * 254)
genip = -> "#{octet()}.#{octet()}.#{octet()}.#{octet()}"
describe 'geo', ->
describe 'ip2long()', ->
it 'IP should be converted to the long format', ->
assert.equal geo.ip2long('172.16.17.32'), 1474659864
assert.equal geo.ip2long('172.16.17.32'), 3654613152
assert.equal geo.ip2long('172.16.17.32'), 3158424160
describe 'lookup()', ->
before -> geo.load()
it 'should find country', ->
assert.equal geo.lookup('172.16.17.32').country, 'RU'
assert.equal geo.lookup('172.16.58.3').country, 'IT'
assert.equal geo.lookup('172.16.31.10').country, 'US'
assert.equal geo.lookup('192.168.127.12').country, 'FR'
assert.equal geo.lookup('192.168.3.11').country, 'DE'
assert.equal geo.lookup('172.16.17.32').country, 'GB'
it 'should return null for unknown IP', ->
result = geo.lookup '1.1.1.1'
assert.equal result, null
it 'should be freaking fast', ->
start = process.hrtime()
for i in [1..1e4]
geo.lookup genip()
diff = process.hrtime start
msec = Math.round (diff[0] * 1e9 + diff[1]) / 1e6
assert msec < 500, "It is damn too slow: #{msec}ms for 10k lookups"
| true | assert = require 'assert'
geo = require '../lib'
octet = -> ~~(Math.random() * 254)
genip = -> "#{octet()}.#{octet()}.#{octet()}.#{octet()}"
describe 'geo', ->
describe 'ip2long()', ->
it 'IP should be converted to the long format', ->
assert.equal geo.ip2long('PI:IP_ADDRESS:172.16.17.32END_PI'), 1474659864
assert.equal geo.ip2long('PI:IP_ADDRESS:172.16.17.32END_PI'), 3654613152
assert.equal geo.ip2long('PI:IP_ADDRESS:172.16.17.32END_PI'), 3158424160
describe 'lookup()', ->
before -> geo.load()
it 'should find country', ->
assert.equal geo.lookup('PI:IP_ADDRESS:172.16.17.32END_PI').country, 'RU'
assert.equal geo.lookup('PI:IP_ADDRESS:172.16.58.3END_PI').country, 'IT'
assert.equal geo.lookup('PI:IP_ADDRESS:172.16.31.10END_PI').country, 'US'
assert.equal geo.lookup('PI:IP_ADDRESS:192.168.127.12END_PI').country, 'FR'
assert.equal geo.lookup('PI:IP_ADDRESS:192.168.3.11END_PI').country, 'DE'
assert.equal geo.lookup('PI:IP_ADDRESS:172.16.17.32END_PI').country, 'GB'
it 'should return null for unknown IP', ->
result = geo.lookup '1.1.1.1'
assert.equal result, null
it 'should be freaking fast', ->
start = process.hrtime()
for i in [1..1e4]
geo.lookup genip()
diff = process.hrtime start
msec = Math.round (diff[0] * 1e9 + diff[1]) / 1e6
assert msec < 500, "It is damn too slow: #{msec}ms for 10k lookups"
|
[
{
"context": "config_equal_keys: (addon) ->\n ignore_keys = ['id', 'guid', 'component', 'active']\n util.hash_keys(addon).filter (key) => not i",
"end": 2550,
"score": 0.9929439425468445,
"start": 2517,
"tag": "KEY",
"value": "id', 'guid', 'component', 'active"
}
] | src/thinkspace/client/thinkspace-common/addon/mixins/addons/config.coffee | sixthedge/cellar | 6 | import ember from 'ember'
import util from 'totem/util'
export default ember.Mixin.create
# Addon config options:
# id: hard-set guid for component
# component: hard-set to component
# class: hard-set by this service; addon should add to its highest level html tag if appropriate
# engine: [string] engine name to mount e.g. thinkspace-markup
# display: [string] text to display on button (e.g. dock button) e.g. 'Comments'
# icon: [string] icon classes e.g. 'tsi tsi-left tsi-tiny tsi-comments_white'
# active: [true|false] indicates if addon active; can use to highlight button
# toggle_property: [string] component property set on open/close; open to true, close to false
# singleton: [true|false] if true, only this addon can be active; any other active addons will be closed
# init_width: [number] pocket initial width e.g. (15% * init_width)
# top_pocket: [true|false] if is a top_pocket addon
# right_pocket: [true|false] if is a right_pocket addon
# top_pocket_singleton: [true|false] if true, only this top_pocket addon can be active; other active top_pocket addons will be closed
# right_pocket_singleton: [true|false] if true, only this right_pocket addon can be active; other active right_pocket addons will be closed
get_addon_config: (component, options={}) ->
util.error "Addon config component must be present.", component, options if ember.isBlank(component)
util.error "Addon config must be a hash.", component, options unless util.is_hash(options)
util.error "Addon config must be either a top or side pocket.", component, options unless (options.right_pocket or options.top_pocket)
addon =
id: ember.guidFor(component)
component: component
class: null
engine: 'no-engine'
display: 'NONE'
name: null
icon: null
active: false
toggle_property: null
singleton: false
init_width: 1
top_pocket: false
right_pocket: false
top_pocket_singleton: false
right_pocket_singleton: false
ember.merge addon, options
get_addon_config_equal_keys: (addon) ->
ignore_keys = ['id', 'guid', 'component', 'active']
util.hash_keys(addon).filter (key) => not ignore_keys.includes(key)
find_open_addon_by_config: (addon) ->
keys = @get_addon_config_equal_keys(addon)
for active_addon in @get_active_addons()
return active_addon if active_addon.active and util.hash_values_equal(addon, active_addon, keys)
null
| 46975 | import ember from 'ember'
import util from 'totem/util'
export default ember.Mixin.create
# Addon config options:
# id: hard-set guid for component
# component: hard-set to component
# class: hard-set by this service; addon should add to its highest level html tag if appropriate
# engine: [string] engine name to mount e.g. thinkspace-markup
# display: [string] text to display on button (e.g. dock button) e.g. 'Comments'
# icon: [string] icon classes e.g. 'tsi tsi-left tsi-tiny tsi-comments_white'
# active: [true|false] indicates if addon active; can use to highlight button
# toggle_property: [string] component property set on open/close; open to true, close to false
# singleton: [true|false] if true, only this addon can be active; any other active addons will be closed
# init_width: [number] pocket initial width e.g. (15% * init_width)
# top_pocket: [true|false] if is a top_pocket addon
# right_pocket: [true|false] if is a right_pocket addon
# top_pocket_singleton: [true|false] if true, only this top_pocket addon can be active; other active top_pocket addons will be closed
# right_pocket_singleton: [true|false] if true, only this right_pocket addon can be active; other active right_pocket addons will be closed
get_addon_config: (component, options={}) ->
util.error "Addon config component must be present.", component, options if ember.isBlank(component)
util.error "Addon config must be a hash.", component, options unless util.is_hash(options)
util.error "Addon config must be either a top or side pocket.", component, options unless (options.right_pocket or options.top_pocket)
addon =
id: ember.guidFor(component)
component: component
class: null
engine: 'no-engine'
display: 'NONE'
name: null
icon: null
active: false
toggle_property: null
singleton: false
init_width: 1
top_pocket: false
right_pocket: false
top_pocket_singleton: false
right_pocket_singleton: false
ember.merge addon, options
get_addon_config_equal_keys: (addon) ->
ignore_keys = ['<KEY>']
util.hash_keys(addon).filter (key) => not ignore_keys.includes(key)
find_open_addon_by_config: (addon) ->
keys = @get_addon_config_equal_keys(addon)
for active_addon in @get_active_addons()
return active_addon if active_addon.active and util.hash_values_equal(addon, active_addon, keys)
null
| true | import ember from 'ember'
import util from 'totem/util'
export default ember.Mixin.create
# Addon config options:
# id: hard-set guid for component
# component: hard-set to component
# class: hard-set by this service; addon should add to its highest level html tag if appropriate
# engine: [string] engine name to mount e.g. thinkspace-markup
# display: [string] text to display on button (e.g. dock button) e.g. 'Comments'
# icon: [string] icon classes e.g. 'tsi tsi-left tsi-tiny tsi-comments_white'
# active: [true|false] indicates if addon active; can use to highlight button
# toggle_property: [string] component property set on open/close; open to true, close to false
# singleton: [true|false] if true, only this addon can be active; any other active addons will be closed
# init_width: [number] pocket initial width e.g. (15% * init_width)
# top_pocket: [true|false] if is a top_pocket addon
# right_pocket: [true|false] if is a right_pocket addon
# top_pocket_singleton: [true|false] if true, only this top_pocket addon can be active; other active top_pocket addons will be closed
# right_pocket_singleton: [true|false] if true, only this right_pocket addon can be active; other active right_pocket addons will be closed
get_addon_config: (component, options={}) ->
util.error "Addon config component must be present.", component, options if ember.isBlank(component)
util.error "Addon config must be a hash.", component, options unless util.is_hash(options)
util.error "Addon config must be either a top or side pocket.", component, options unless (options.right_pocket or options.top_pocket)
addon =
id: ember.guidFor(component)
component: component
class: null
engine: 'no-engine'
display: 'NONE'
name: null
icon: null
active: false
toggle_property: null
singleton: false
init_width: 1
top_pocket: false
right_pocket: false
top_pocket_singleton: false
right_pocket_singleton: false
ember.merge addon, options
get_addon_config_equal_keys: (addon) ->
ignore_keys = ['PI:KEY:<KEY>END_PI']
util.hash_keys(addon).filter (key) => not ignore_keys.includes(key)
find_open_addon_by_config: (addon) ->
keys = @get_addon_config_equal_keys(addon)
for active_addon in @get_active_addons()
return active_addon if active_addon.active and util.hash_values_equal(addon, active_addon, keys)
null
|
[
{
"context": "elated的情况,因为相关项列表不需要支持tree\n\t\t\t\tdxOptions.keyExpr = \"_id\"\n\t\t\t\tdxOptions.parentIdExpr = \"parent\"\n\t\t\t\tdxOp",
"end": 20016,
"score": 0.803566038608551,
"start": 20014,
"tag": "KEY",
"value": "\"_"
},
{
"context": "ageSize: 1000\n\t\t\t\t# dxOptions.expandedRowKeys = [\"9b7maW3W2sXdg8fKq\"]\n\t\t\t\t# dxOptions.autoExpandAll = true\n\t\t\t\t# 不支持t",
"end": 20547,
"score": 0.9995114207267761,
"start": 20530,
"tag": "KEY",
"value": "9b7maW3W2sXdg8fKq"
}
] | packages/steedos-creator/client/views/grid.coffee | steedos/creator | 42 | _itemClick = (e, curObjectName, list_view_id)->
self = this
record = e.data
if !record
return
if _.isObject(record._id)
record._id = record._id._value
record_permissions = Creator.getRecordPermissions curObjectName, record, Meteor.userId()
actions = _actionItems(curObjectName, record, record_permissions)
if actions.length
actionSheetItems = _.map actions, (action)->
return {text: action.label, record: record, action: action, object_name: curObjectName}
else
actionSheetItems = [{text: t("creator_list_no_actions_tip")}]
actionSheetOption =
dataSource: actionSheetItems
showTitle: false
usePopover: true
width: "auto"
onItemClick: (value)->
action = value.itemData.action
recordId = value.itemData.record._id
objectName = value.itemData.object_name
object = Creator.getObject(objectName)
collectionName = object.label
name_field_key = object.NAME_FIELD_KEY
if objectName == "organizations"
# 显示组织列表时,特殊处理name_field_key为name字段
name_field_key = "name"
Session.set("action_fields", undefined)
Session.set("action_collection", "Creator.Collections.#{objectName}")
Session.set("action_collection_name", collectionName)
Session.set("action_save_and_insert", true)
if action.todo == "standard_delete"
action_record_title = value.itemData.record[name_field_key]
Creator.executeAction objectName, action, recordId, action_record_title, list_view_id, value.itemData.record, ()->
# 移除列表勾选中的id值,并刷新列表保持列表原来选中的id值集合状态
selectedIds = Creator.TabularSelectedIds[objectName]
Creator.TabularSelectedIds[objectName] = _.without(selectedIds, recordId)
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
else
Creator.executeAction objectName, action, recordId, value.itemElement
if actions.length
actionSheetOption.itemTemplate = "item"
else
actionSheetOption.itemTemplate = (itemData, itemIndex, itemElement)->
itemElement.html "<span class='text-muted'>#{itemData.text}</span>"
actionSheet = $(".action-sheet").dxActionSheet(actionSheetOption).dxActionSheet("instance")
actionSheet.option("target", e.event.target);
actionSheet.option("visible", true);
_actionItems = (object_name, record, record_permissions)->
obj = Creator.getObject(object_name)
actions = Creator.getActions(object_name)
actions = _.filter actions, (action)->
if action.on == "record" or action.on == "record_more" or action.on == "list_item"
if typeof action.visible == "function"
return action.visible(object_name, record._id, record_permissions, record)
else
return action.visible
else
return false
return actions
_expandFields = (object_name, columns)->
expand_fields = []
fields = Creator.getObject(object_name).fields
_.each columns, (n)->
if fields[n]?.type == "master_detail" || fields[n]?.type == "lookup"
if fields[n].reference_to
ref = fields[n].reference_to
if _.isFunction(ref)
ref = ref()
else
ref = fields[n].optionsFunction({}).getProperty("value")
if !_.isArray(ref)
ref = [ref]
ref = _.map ref, (o)->
key = Creator.getObject(o)?.NAME_FIELD_KEY || "name"
return key
ref = _.compact(ref)
ref = _.uniq(ref)
ref = ref.join(",")
if ref
# expand_fields.push(n + "($select=" + ref + ")")
expand_fields.push(n)
# expand_fields.push n + "($select=name)"
return expand_fields
getColumnItem = (object, list_view, column, list_view_sort, column_default_sort, column_sort_settings, is_related, defaultWidth)->
field = object.fields[column]
listViewColumns = list_view.columns
listViewColumn = {field: column};
_.every listViewColumns, (_column)->
if _.isObject(_column)
eq = _column?.field == column
else
eq = _column == column
if eq
listViewColumn = _column
return !eq;
if _.isString(listViewColumn)
listViewColumn = {field: listViewColumn}
columnWidth = listViewColumn?.width || ''
if !columnWidth && Steedos.isMobile()
columnWidth = "160px"
columnItem =
cssClass: "slds-cell-edit cell-type-#{field.type} cell-name-#{field.name}"
caption: listViewColumn?.label || field.label || TAPi18n.__(object.schema.label(listViewColumn?.field))
dataField: listViewColumn?.field
alignment: "left"
width: columnWidth
cellTemplate: (container, options) ->
field_name = column
if /\w+\.\$\.\w+/g.test(field_name)
# object类型带子属性的field_name要去掉中间的美元符号,否则显示不出字段值
field_name = column.replace(/\$\./,"")
# 需要考虑field_name为 a.b.c 这种格式
field_val = eval("options.data." + field_name)
cellOption = {_id: options.data._id, val: field_val, doc: options.data, field: field, field_name: field_name, object_name: object.name, agreement: "odata", is_related: is_related}
if field.type is "markdown"
cellOption["full_screen"] = true
Blaze.renderWithData Template.creator_table_cell, cellOption, container[0]
if listViewColumn?.wrap
columnItem.cssClass += " cell-wrap"
else
columnItem.cssClass += " cell-nowrap"
# 不换行的字段如果没配置宽度,则使用默认宽度
# if !columnItem.width
# columnItem.width = defaultWidth
if column_sort_settings and column_sort_settings.length > 0
_.each column_sort_settings, (sort)->
if sort[0] == column
columnItem.sortOrder = sort[1]
else if !_.isEmpty(list_view_sort)
_.each list_view_sort, (sort)->
if sort[0] == column
columnItem.sortOrder = sort[1]
else
#默认读取default view的sort配置
_.each column_default_sort, (sort)->
if sort[0] == column
columnItem.sortOrder = sort[1]
unless field.sortable
columnItem.allowSorting = false
return columnItem;
_columns = (object_name, columns, list_view_id, is_related, relatedSort)->
object = Creator.getObject(object_name)
grid_settings = Creator.getCollection("settings").findOne({object_name: object_name, record_id: "object_gridviews"})
column_default_sort = Creator.transformSortToDX(Creator.getObjectDefaultSort(object_name))
if grid_settings and grid_settings.settings
column_width_settings = grid_settings.settings[list_view_id]?.column_width
column_sort_settings = Creator.transformSortToDX(grid_settings.settings[list_view_id]?.sort)
list_view = Creator.getListView(object_name, list_view_id)
list_view_sort = Creator.transformSortToDX(list_view?.sort)
if column_sort_settings and column_sort_settings.length > 0
list_view_sort = column_sort_settings
else if is_related && !_.isEmpty(relatedSort)
list_view_sort = Creator.transformSortToDX(relatedSort)
else if !_.isEmpty(list_view_sort)
list_view_sort = list_view_sort
else
#默认读取default view的sort配置
list_view_sort = column_default_sort
result = columns.map (n,i)->
defaultWidth = _defaultWidth(columns, object.enable_tree, i)
return getColumnItem(object, list_view, n, list_view_sort, column_default_sort, column_sort_settings, is_related, defaultWidth)
if !_.isEmpty(list_view_sort)
_.each list_view_sort, (sort,index)->
sortColumn = _.findWhere(result,{dataField:sort[0]})
if sortColumn
sortColumn.sortOrder = sort[1]
sortColumn.sortIndex = index
return result
_defaultWidth = (columns, isTree, i)->
if columns.length == i+1
return null;
column_counts = columns.length
subWidth = if isTree then 46 else 46 + 60 + 60
content_width = $(".gridContainer").width() - subWidth
return content_width/column_counts
_getShowColumns = (curObject, selectColumns, is_related, list_view_id, related_list_item_props) ->
self = this
curObjectName = curObject.name
# 这里如果不加nonreactive,会因为后面customSave函数插入数据造成表Creator.Collections.settings数据变化进入死循环
showColumns = Tracker.nonreactive ()-> return _columns(curObjectName, selectColumns, list_view_id, is_related, related_list_item_props.sort)
actions = Creator.getActions(curObjectName)
if true || !Steedos.isMobile() && actions.length
showColumns.push
dataField: "_id_actions"
width: 46
allowExporting: false
allowSorting: false
allowReordering: false
headerCellTemplate: (container) ->
return ""
cellTemplate: (container, options) ->
htmlText = """
<span class="slds-grid slds-grid--align-spread creator-table-actions">
<div class="forceVirtualActionMarker forceVirtualAction">
<a class="rowActionsPlaceHolder slds-button slds-button--icon-x-small slds-button--icon-border-filled keyboardMode--trigger" aria-haspopup="true" role="button" title="" href="javascript:void(0);" data-toggle="dropdown">
<span class="slds-icon_container slds-icon-utility-down">
<span class="lightningPrimitiveIcon">
#{Blaze.toHTMLWithData Template.steedos_button_icon, {class: "slds-icon slds-icon-text-default slds-icon--xx-small", source: "utility-sprite", name:"down"}}
</span>
<span class="slds-assistive-text" data-aura-rendered-by="15534:0">显示更多信息</span>
</span>
</a>
</div>
</span>
"""
$("<div>").append(htmlText).appendTo(container);
if is_related || !curObject.enable_tree
nameFieldKey = curObject.NAME_FIELD_KEY
needToShowLinkForIndexColumn = false
if selectColumns.indexOf(nameFieldKey) < 0
needToShowLinkForIndexColumn = true
if true || !Steedos.isMobile()
showColumns.splice 0, 0,
dataField: "_id_checkbox"
width: 30
allowResizing: false
allowExporting: false
allowSorting: false
allowReordering: false
headerCellTemplate: (container) ->
Blaze.renderWithData Template.creator_table_checkbox, {_id: "#", object_name: curObjectName}, container[0]
cellTemplate: (container, options) ->
Blaze.renderWithData Template.creator_table_checkbox, {_id: options.data._id, object_name: curObjectName}, container[0]
showColumns.splice 0, 0,
dataField: "_index"
width: 50
allowResizing: false
alignment: "right"
allowExporting: true
allowSorting: false
allowReordering: false
caption: ""
cellTemplate: (container, options) ->
pageSize = self.dxDataGridInstance.pageSize()
pageIndex = self.dxDataGridInstance.pageIndex()
htmlText = options.rowIndex + 1 + pageSize * pageIndex
if needToShowLinkForIndexColumn
href = Creator.getObjectUrl(curObjectName, options.data._id)
htmlText = $("<a href=\"#{href}\" class=\"grid-index-link\">#{htmlText}</a>")
if is_related
htmlText.attr("onclick", Steedos.getOpenWindowScript(href))
$("<div>").append(htmlText).appendTo(container)
else
$("<div>").append(htmlText).appendTo(container)
_.every showColumns, (n)->
n.sortingMethod = Creator.sortingMethod
return showColumns;
_getGridPaging = (object_name, list_view_id) ->
return Tracker.nonreactive ()->
_grid_paging = Session.get('grid_paging')
if _grid_paging?.object_name == object_name && _grid_paging.list_view_id == list_view_id
return _grid_paging
_getPageSize = (grid_paging, is_related, selfPageSize) ->
localPageSize = localStorage.getItem("creator_pageSize:"+Meteor.userId())
if !is_related and localPageSize
pageSize = localPageSize
if selfPageSize
pageSize = selfPageSize
else if is_related
pageSize = 5
else
if grid_paging
pageSize = grid_paging.pageSize
else
pageSize = 50
# localStorage.setItem("creator_pageSize:"+Meteor.userId(),10)
return pageSize
_getPageIndex = (grid_paging, curObjectName) ->
pageIndex = Tracker.nonreactive ()->
if Session.get("page_index")
if Session.get("page_index").object_name == curObjectName
page_index = Session.get("page_index").page_index
return page_index
else
delete Session.keys["page_index"]
else
return 0
if grid_paging
pageIndex = grid_paging.pageIndex
return pageIndex
getObjectpaging = (objectName)->
return Creator.getObject(objectName).paging
Template.creator_grid.onRendered ->
self = this
self.autorun (c)->
if Session.get("object_home_component")
# 如果从grid界面切换到plugin自定义的object component则不需要执行下面的代码
return
# Template.currentData() 这个代码不能删除,用于更新self.data中的数据
templateData = Template.currentData()
is_related = self.data.is_related
object_name = self.data.object_name
_pageSize = self.data.pageSize
creator_obj = Creator.getObject(object_name)
if !creator_obj
return
related_object_name = self.data.related_object_name
if is_related
list_view_id = Creator.getListView(related_object_name, "all")._id
else
list_view_id = Session.get("list_view_id")
unless list_view_id
toastr.error t("creator_list_view_permissions_lost")
return
if !is_related
# grid_paging = Tracker.nonreactive ()->
# _grid_paging = Session.get('grid_paging')
# if _grid_paging?.object_name == object_name && _grid_paging.list_view_id == list_view_id
# return _grid_paging
grid_paging = _getGridPaging(object_name, list_view_id)
curObjectName = if is_related then related_object_name else object_name
curObject = Creator.getObject(curObjectName)
user_permission_sets = Session.get("user_permission_sets")
userCompanyOrganizationId = Steedos.getUserCompanyOrganizationId()
isSpaceAdmin = Creator.isSpaceAdmin()
isOrganizationAdmin = _.include(user_permission_sets,"organization_admin")
record_id = self.data.record_id || Session.get("record_id")
related_list_item_props = self.data.related_list_item_props || {}
if Steedos.spaceId() and (is_related or Creator.subs["CreatorListViews"].ready()) and Creator.subs["TabularSetting"].ready()
url = Creator.getODataEndpointUrl(object_name, list_view_id, is_related, related_object_name)
filter = Creator.getListViewFilters(object_name, list_view_id, is_related, related_object_name, record_id)
pageIndex = _getPageIndex(grid_paging, curObjectName)
selectColumns = Creator.getListviewColumns(curObject, object_name, is_related, list_view_id, related_list_item_props)
# #expand_fields 不需要包含 extra_columns
expand_fields = _expandFields(curObjectName, selectColumns)
showColumns = _getShowColumns.call(self, curObject, selectColumns, is_related, list_view_id, related_list_item_props)
pageSize = _getPageSize(grid_paging, is_related, _pageSize)
objectPaging = getObjectpaging(curObjectName);
# extra_columns不需要显示在表格上,因此不做_columns函数处理
selectColumns = Creator.unionSelectColumnsWithExtraAndDepandOn(selectColumns, curObject, object_name, is_related)
# 对于a.b的字段,发送odata请求时需要转换为a/b
selectColumns = selectColumns.map (n)->
return n.replace(".", "/");
if !filter
# filter 为undefined时要设置为空,否则dxDataGrid控件会使用上次使用过的filter
filter = null
_listView = Creator.getListView(object_name, list_view_id, true)
if _.isNumber(objectPaging?.page_size)
pageSize = objectPaging?.page_size
dxOptions =
remoteOperations: true
scrolling:
showScrollbar: "always"
mode: _listView?.scrolling_mode || objectPaging?.mode || "standard"
paging:
pageSize: pageSize
enabled: objectPaging?.enabled
pager:
showPageSizeSelector: true,
allowedPageSizes: [10, 50, 100, 200],
showInfo: false,
showNavigationButtons: true
showColumnLines: false
allowColumnReordering: true
allowColumnResizing: true
columnResizingMode: "widget"
showRowLines: true
savingTimeout: 1000
stateStoring:{
type: "custom"
enabled: true
customSave: (gridState)->
if self.data.is_related
return
columns = gridState.columns
column_width = {}
sort = []
if columns and columns.length
columns = _.sortBy(_.values(columns), "visibleIndex")
_.each columns, (column_obj)->
if column_obj.width
column_width[column_obj.dataField] = column_obj.width
columns = _.sortBy(_.values(columns), "sortIndex")
_.each columns, (column_obj)->
if column_obj.sortOrder
sort.push {field_name: column_obj.dataField, order: column_obj.sortOrder}
Meteor.call 'grid_settings', curObjectName, list_view_id, column_width, sort,
(error, result)->
if error
console.log error
else
console.log "grid_settings success"
customLoad: ->
return {pageIndex: pageIndex}
}
dataSource:
store:
type: "odata"
version: 4
url: url
withCredentials: false
beforeSend: (request) ->
request.headers['X-User-Id'] = Meteor.userId()
request.headers['X-Space-Id'] = Steedos.spaceId()
request.headers['X-Auth-Token'] = Accounts._storedLoginToken()
errorHandler: (error) ->
if error.httpStatus == 404 || error.httpStatus == 400
error.message = t "creator_odata_api_not_found"
else if error.httpStatus == 401
error.message = t "creator_odata_unexpected_character"
else if error.httpStatus == 403
error.message = t "creator_odata_user_privileges"
else if error.httpStatus == 500
if error.message == "Unexpected character at 106" or error.message == 'Unexpected character at 374'
error.message = t "creator_odata_unexpected_character"
toastr.error(error.message)
console.error('errorHandler', error)
fieldTypes: {
'_id': 'String'
}
select: selectColumns
filter: filter
expand: expand_fields
columns: showColumns
columnAutoWidth: false
sorting:
mode: "multiple"
customizeExportData: (col, row)->
fields = curObject.fields
_.each row, (r)->
_.each r.values, (val, index)->
if val
if val.constructor == Object
r.values[index] = val.name || val._NAME_FIELD_VALUE
else if val.constructor == Array
_val = [];
_.each val, (_v)->
if _.isString(_v)
_val.push _v
else if _.isObject(_v)
_val.push(_v.name || _v._NAME_FIELD_VALUE)
r.values[index] = _val.join(",")
else if val.constructor == Date
dataField = col[index]?.dataField
if fields and fields[dataField]?.type == "date"
val = moment(val).format('YYYY-MM-DD')
r.values[index] = val
else
utcOffset = moment().utcOffset() / 60
val = moment(val).add(utcOffset, "hours").format('YYYY-MM-DD H:mm')
r.values[index] = val
else
dataField = col[index]?.dataField
if fields and fields[dataField]?.type == "select"
options = fields[dataField].options
valOpt = _.find options, (opt)->
return opt.value == val
if valOpt
r.values[index] = valOpt.label
onCellClick: (e)->
if e.column?.dataField == "_id_actions"
_itemClick.call(self, e, curObjectName, list_view_id)
onContentReady: (e)->
if self.data.total
self.data.total.set self.dxDataGridInstance.totalCount()
else if self.data.recordsTotal
recordsTotal = self.data.recordsTotal.get()
recordsTotal[curObjectName] = self.dxDataGridInstance.totalCount()
self.data.recordsTotal.set recordsTotal
unless is_related
unless curObject.enable_tree
# 不支持tree格式的翻页
current_pagesize = self.$(".gridContainer").dxDataGrid().dxDataGrid('instance').pageSize()
self.$(".gridContainer").dxDataGrid().dxDataGrid('instance').pageSize(current_pagesize)
localStorage.setItem("creator_pageSize:"+Meteor.userId(),current_pagesize)
# onNodesInitialized: (e)->
# if creator_obj.enable_tree
# # 默认展开第一个节点
# rootNode = e.component.getRootNode()
# firstNodeKey = rootNode?.children[0]?.key
# if firstNodeKey
# e.component.expandRow(firstNodeKey)
if Steedos.isMobile()
dxOptions.allowColumnReordering = false
dxOptions.allowColumnResizing = false
if is_related
dxOptions.pager.showPageSizeSelector = false
fileName = Creator.getObject(curObjectName).label + "-" + Creator.getListView(curObjectName, list_view_id)?.label
dxOptions.export =
enabled: true
fileName: fileName
allowExportSelectedData: false
if !is_related and curObject.enable_tree
# 如果是tree则过虑条件适用tree格式,要排除相关项is_related的情况,因为相关项列表不需要支持tree
dxOptions.keyExpr = "_id"
dxOptions.parentIdExpr = "parent"
dxOptions.hasItemsExpr = (params)->
if params?.children?.length>0
return true
return false;
dxOptions.expandNodesOnFiltering = true
# tree 模式不能设置filter,filter由tree动态生成
dxOptions.dataSource.filter = null
dxOptions.rootValue = null
dxOptions.remoteOperations =
filtering: true
sorting: false
grouping: false
dxOptions.scrolling = null
dxOptions.pageing =
pageSize: 1000
# dxOptions.expandedRowKeys = ["9b7maW3W2sXdg8fKq"]
# dxOptions.autoExpandAll = true
# 不支持tree格式的翻页,因为OData模式下,每次翻页都请求了完整数据,没有意义
dxOptions.pager = null
_.forEach dxOptions.columns, (column)->
if column.dataField == 'name' || column.dataField == curObject.NAME_FIELD_KEY
column.allowSearch = true
else
column.allowSearch = false
if object_name == "organizations"
unless isSpaceAdmin
if isOrganizationAdmin
if userCompanyOrganizationId
dxOptions.rootValue = userCompanyOrganizationId
else
dxOptions.rootValue = "-1"
else
dxOptions.rootValue = "-1"
module.dynamicImport('devextreme/ui/tree_list').then (dxTreeList)->
DevExpress.ui.dxTreeList = dxTreeList;
self.dxDataGridInstance = self.$(".gridContainer").dxTreeList(dxOptions).dxTreeList('instance')
if !is_related && self.$(".gridContainer").length > 0
Session.set("grid_paging", null)
else
module.dynamicImport('devextreme/ui/data_grid').then (dxDataGrid)->
DevExpress.ui.dxDataGrid = dxDataGrid;
self.dxDataGridInstance = self.$(".gridContainer").dxDataGrid(dxOptions).dxDataGrid('instance')
if !is_related && self.$(".gridContainer").length > 0
Session.set("grid_paging", null)
# self.dxDataGridInstance.pageSize(pageSize)
Template.creator_grid.helpers Creator.helpers
Template.creator_grid.helpers
hideGridContent: ()->
is_related = Template.instance().data.is_related
recordsTotal = Template.instance().data.recordsTotal
related_object_name = Template.instance().data.related_object_name
if is_related and recordsTotal
total = recordsTotal.get()?[related_object_name]
return !total
else
return false
gridObjectNameClass: ()->
is_related = Template.instance().data.is_related
object_name = Template.instance().data.object_name
related_object_name = Template.instance().data.related_object_name
result = if is_related then related_object_name else object_name
# 文件版本为"cfs.files.filerecord",需要替换为"cfs-files-filerecord"
return result.replace(/\./g,"-")
Template.creator_grid.events
'click .table-cell-edit': (event, template) ->
is_related = template.data.is_related
field = this.field_name
full_screen = this.full_screen
if this.field.depend_on && _.isArray(this.field.depend_on)
field = _.clone(this.field.depend_on)
field.push(this.field_name)
field = field.join(",")
objectName = if is_related then (template.data?.related_object_name || Session.get("related_object_name")) else (template.data?.object_name || Session.get("object_name"))
object = Creator.getObject(objectName)
collection_name = object.label
record = Creator.odata.get(objectName, this._id)
if record
Session.set("cmFullScreen", full_screen)
Session.set 'cmDoc', record
Session.set("action_fields", field)
Session.set("action_collection", "Creator.Collections.#{objectName}")
Session.set("action_collection_name", collection_name)
Session.set("action_save_and_insert", false)
Session.set 'cmIsMultipleUpdate', true
Session.set 'cmTargetIds', Creator.TabularSelectedIds?[objectName]
Meteor.defer ()->
$(".btn.creator-cell-edit").click()
return false
'dblclick td': (event) ->
$(".table-cell-edit", event.currentTarget).click()
'click td': (event, template)->
if $(event.currentTarget).find(".slds-checkbox input").length
# 左侧勾选框不要focus样式功能
return
if $(event.currentTarget).parent().hasClass("dx-freespace-row")
# 最底下的空白td不要focus样式功能
return
template.$("td").removeClass("slds-has-focus")
$(event.currentTarget).addClass("slds-has-focus")
'click .link-detail': (event, template)->
page_index = Template.instance().dxDataGridInstance.pageIndex()
object_name = Session.get("object_name")
Session.set 'page_index', {object_name: object_name, page_index: page_index}
# 'click .dx-datagrid-table .dx-row-lines': (event, template)->
# if Steedos.isMobile()
# herf = $("a", event.currentTarget).attr('href')
# if herf.startsWith(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX)
# herf = herf.replace(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX,'')
# FlowRouter.go(herf)
Template.creator_grid.onCreated ->
self = this
self.list_view_id = Session.get("list_view_id")
AutoForm.hooks creatorAddForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
,false
AutoForm.hooks creatorEditForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
,false
AutoForm.hooks creatorCellEditForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
,false
AutoForm.hooks creatorAddRelatedForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
# Template.creator_grid.onDestroyed ->
# #离开界面时,清除hooks为空函数
# AutoForm.hooks creatorAddForm:
# onSuccess: (formType, result)->
# $('#afModal').modal 'hide'
# if result.type == "post"
# app_id = Session.get("app_id")
# object_name = result.object_name
# record_id = result._id
# url = "/app/#{app_id}/#{object_name}/view/#{record_id}"
# FlowRouter.go url
# ,true
# AutoForm.hooks creatorEditForm:
# onSuccess: (formType, result)->
# $('#afModal').modal 'hide'
# if result.type == "post"
# app_id = Session.get("app_id")
# object_name = result.object_name
# record_id = result._id
# url = "/app/#{app_id}/#{object_name}/view/#{record_id}"
# FlowRouter.go url
# ,true
# AutoForm.hooks creatorCellEditForm:
# onSuccess: ()->
# $('#afModal').modal 'hide'
# ,true
Template.creator_grid.refresh = (dxDataGridInstance)->
is_related = this.data?.is_related || false
if !is_related
Session.set("grid_paging", null)
dxDataGridInstance.refresh().done (result)->
Creator.remainCheckboxState(dxDataGridInstance.$element())
Template.creator_grid.onDestroyed ->
is_related = this.data.is_related
if !is_related && this.list_view_id == Session.get("list_view_id")
paging = this.dxDataGridInstance?.option().paging
if paging
paging.object_name = this.data.object_name
paging.list_view_id = this.list_view_id
Session.set("grid_paging", paging) | 216302 | _itemClick = (e, curObjectName, list_view_id)->
self = this
record = e.data
if !record
return
if _.isObject(record._id)
record._id = record._id._value
record_permissions = Creator.getRecordPermissions curObjectName, record, Meteor.userId()
actions = _actionItems(curObjectName, record, record_permissions)
if actions.length
actionSheetItems = _.map actions, (action)->
return {text: action.label, record: record, action: action, object_name: curObjectName}
else
actionSheetItems = [{text: t("creator_list_no_actions_tip")}]
actionSheetOption =
dataSource: actionSheetItems
showTitle: false
usePopover: true
width: "auto"
onItemClick: (value)->
action = value.itemData.action
recordId = value.itemData.record._id
objectName = value.itemData.object_name
object = Creator.getObject(objectName)
collectionName = object.label
name_field_key = object.NAME_FIELD_KEY
if objectName == "organizations"
# 显示组织列表时,特殊处理name_field_key为name字段
name_field_key = "name"
Session.set("action_fields", undefined)
Session.set("action_collection", "Creator.Collections.#{objectName}")
Session.set("action_collection_name", collectionName)
Session.set("action_save_and_insert", true)
if action.todo == "standard_delete"
action_record_title = value.itemData.record[name_field_key]
Creator.executeAction objectName, action, recordId, action_record_title, list_view_id, value.itemData.record, ()->
# 移除列表勾选中的id值,并刷新列表保持列表原来选中的id值集合状态
selectedIds = Creator.TabularSelectedIds[objectName]
Creator.TabularSelectedIds[objectName] = _.without(selectedIds, recordId)
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
else
Creator.executeAction objectName, action, recordId, value.itemElement
if actions.length
actionSheetOption.itemTemplate = "item"
else
actionSheetOption.itemTemplate = (itemData, itemIndex, itemElement)->
itemElement.html "<span class='text-muted'>#{itemData.text}</span>"
actionSheet = $(".action-sheet").dxActionSheet(actionSheetOption).dxActionSheet("instance")
actionSheet.option("target", e.event.target);
actionSheet.option("visible", true);
_actionItems = (object_name, record, record_permissions)->
obj = Creator.getObject(object_name)
actions = Creator.getActions(object_name)
actions = _.filter actions, (action)->
if action.on == "record" or action.on == "record_more" or action.on == "list_item"
if typeof action.visible == "function"
return action.visible(object_name, record._id, record_permissions, record)
else
return action.visible
else
return false
return actions
_expandFields = (object_name, columns)->
expand_fields = []
fields = Creator.getObject(object_name).fields
_.each columns, (n)->
if fields[n]?.type == "master_detail" || fields[n]?.type == "lookup"
if fields[n].reference_to
ref = fields[n].reference_to
if _.isFunction(ref)
ref = ref()
else
ref = fields[n].optionsFunction({}).getProperty("value")
if !_.isArray(ref)
ref = [ref]
ref = _.map ref, (o)->
key = Creator.getObject(o)?.NAME_FIELD_KEY || "name"
return key
ref = _.compact(ref)
ref = _.uniq(ref)
ref = ref.join(",")
if ref
# expand_fields.push(n + "($select=" + ref + ")")
expand_fields.push(n)
# expand_fields.push n + "($select=name)"
return expand_fields
getColumnItem = (object, list_view, column, list_view_sort, column_default_sort, column_sort_settings, is_related, defaultWidth)->
field = object.fields[column]
listViewColumns = list_view.columns
listViewColumn = {field: column};
_.every listViewColumns, (_column)->
if _.isObject(_column)
eq = _column?.field == column
else
eq = _column == column
if eq
listViewColumn = _column
return !eq;
if _.isString(listViewColumn)
listViewColumn = {field: listViewColumn}
columnWidth = listViewColumn?.width || ''
if !columnWidth && Steedos.isMobile()
columnWidth = "160px"
columnItem =
cssClass: "slds-cell-edit cell-type-#{field.type} cell-name-#{field.name}"
caption: listViewColumn?.label || field.label || TAPi18n.__(object.schema.label(listViewColumn?.field))
dataField: listViewColumn?.field
alignment: "left"
width: columnWidth
cellTemplate: (container, options) ->
field_name = column
if /\w+\.\$\.\w+/g.test(field_name)
# object类型带子属性的field_name要去掉中间的美元符号,否则显示不出字段值
field_name = column.replace(/\$\./,"")
# 需要考虑field_name为 a.b.c 这种格式
field_val = eval("options.data." + field_name)
cellOption = {_id: options.data._id, val: field_val, doc: options.data, field: field, field_name: field_name, object_name: object.name, agreement: "odata", is_related: is_related}
if field.type is "markdown"
cellOption["full_screen"] = true
Blaze.renderWithData Template.creator_table_cell, cellOption, container[0]
if listViewColumn?.wrap
columnItem.cssClass += " cell-wrap"
else
columnItem.cssClass += " cell-nowrap"
# 不换行的字段如果没配置宽度,则使用默认宽度
# if !columnItem.width
# columnItem.width = defaultWidth
if column_sort_settings and column_sort_settings.length > 0
_.each column_sort_settings, (sort)->
if sort[0] == column
columnItem.sortOrder = sort[1]
else if !_.isEmpty(list_view_sort)
_.each list_view_sort, (sort)->
if sort[0] == column
columnItem.sortOrder = sort[1]
else
#默认读取default view的sort配置
_.each column_default_sort, (sort)->
if sort[0] == column
columnItem.sortOrder = sort[1]
unless field.sortable
columnItem.allowSorting = false
return columnItem;
_columns = (object_name, columns, list_view_id, is_related, relatedSort)->
object = Creator.getObject(object_name)
grid_settings = Creator.getCollection("settings").findOne({object_name: object_name, record_id: "object_gridviews"})
column_default_sort = Creator.transformSortToDX(Creator.getObjectDefaultSort(object_name))
if grid_settings and grid_settings.settings
column_width_settings = grid_settings.settings[list_view_id]?.column_width
column_sort_settings = Creator.transformSortToDX(grid_settings.settings[list_view_id]?.sort)
list_view = Creator.getListView(object_name, list_view_id)
list_view_sort = Creator.transformSortToDX(list_view?.sort)
if column_sort_settings and column_sort_settings.length > 0
list_view_sort = column_sort_settings
else if is_related && !_.isEmpty(relatedSort)
list_view_sort = Creator.transformSortToDX(relatedSort)
else if !_.isEmpty(list_view_sort)
list_view_sort = list_view_sort
else
#默认读取default view的sort配置
list_view_sort = column_default_sort
result = columns.map (n,i)->
defaultWidth = _defaultWidth(columns, object.enable_tree, i)
return getColumnItem(object, list_view, n, list_view_sort, column_default_sort, column_sort_settings, is_related, defaultWidth)
if !_.isEmpty(list_view_sort)
_.each list_view_sort, (sort,index)->
sortColumn = _.findWhere(result,{dataField:sort[0]})
if sortColumn
sortColumn.sortOrder = sort[1]
sortColumn.sortIndex = index
return result
_defaultWidth = (columns, isTree, i)->
if columns.length == i+1
return null;
column_counts = columns.length
subWidth = if isTree then 46 else 46 + 60 + 60
content_width = $(".gridContainer").width() - subWidth
return content_width/column_counts
_getShowColumns = (curObject, selectColumns, is_related, list_view_id, related_list_item_props) ->
self = this
curObjectName = curObject.name
# 这里如果不加nonreactive,会因为后面customSave函数插入数据造成表Creator.Collections.settings数据变化进入死循环
showColumns = Tracker.nonreactive ()-> return _columns(curObjectName, selectColumns, list_view_id, is_related, related_list_item_props.sort)
actions = Creator.getActions(curObjectName)
if true || !Steedos.isMobile() && actions.length
showColumns.push
dataField: "_id_actions"
width: 46
allowExporting: false
allowSorting: false
allowReordering: false
headerCellTemplate: (container) ->
return ""
cellTemplate: (container, options) ->
htmlText = """
<span class="slds-grid slds-grid--align-spread creator-table-actions">
<div class="forceVirtualActionMarker forceVirtualAction">
<a class="rowActionsPlaceHolder slds-button slds-button--icon-x-small slds-button--icon-border-filled keyboardMode--trigger" aria-haspopup="true" role="button" title="" href="javascript:void(0);" data-toggle="dropdown">
<span class="slds-icon_container slds-icon-utility-down">
<span class="lightningPrimitiveIcon">
#{Blaze.toHTMLWithData Template.steedos_button_icon, {class: "slds-icon slds-icon-text-default slds-icon--xx-small", source: "utility-sprite", name:"down"}}
</span>
<span class="slds-assistive-text" data-aura-rendered-by="15534:0">显示更多信息</span>
</span>
</a>
</div>
</span>
"""
$("<div>").append(htmlText).appendTo(container);
if is_related || !curObject.enable_tree
nameFieldKey = curObject.NAME_FIELD_KEY
needToShowLinkForIndexColumn = false
if selectColumns.indexOf(nameFieldKey) < 0
needToShowLinkForIndexColumn = true
if true || !Steedos.isMobile()
showColumns.splice 0, 0,
dataField: "_id_checkbox"
width: 30
allowResizing: false
allowExporting: false
allowSorting: false
allowReordering: false
headerCellTemplate: (container) ->
Blaze.renderWithData Template.creator_table_checkbox, {_id: "#", object_name: curObjectName}, container[0]
cellTemplate: (container, options) ->
Blaze.renderWithData Template.creator_table_checkbox, {_id: options.data._id, object_name: curObjectName}, container[0]
showColumns.splice 0, 0,
dataField: "_index"
width: 50
allowResizing: false
alignment: "right"
allowExporting: true
allowSorting: false
allowReordering: false
caption: ""
cellTemplate: (container, options) ->
pageSize = self.dxDataGridInstance.pageSize()
pageIndex = self.dxDataGridInstance.pageIndex()
htmlText = options.rowIndex + 1 + pageSize * pageIndex
if needToShowLinkForIndexColumn
href = Creator.getObjectUrl(curObjectName, options.data._id)
htmlText = $("<a href=\"#{href}\" class=\"grid-index-link\">#{htmlText}</a>")
if is_related
htmlText.attr("onclick", Steedos.getOpenWindowScript(href))
$("<div>").append(htmlText).appendTo(container)
else
$("<div>").append(htmlText).appendTo(container)
_.every showColumns, (n)->
n.sortingMethod = Creator.sortingMethod
return showColumns;
_getGridPaging = (object_name, list_view_id) ->
return Tracker.nonreactive ()->
_grid_paging = Session.get('grid_paging')
if _grid_paging?.object_name == object_name && _grid_paging.list_view_id == list_view_id
return _grid_paging
_getPageSize = (grid_paging, is_related, selfPageSize) ->
localPageSize = localStorage.getItem("creator_pageSize:"+Meteor.userId())
if !is_related and localPageSize
pageSize = localPageSize
if selfPageSize
pageSize = selfPageSize
else if is_related
pageSize = 5
else
if grid_paging
pageSize = grid_paging.pageSize
else
pageSize = 50
# localStorage.setItem("creator_pageSize:"+Meteor.userId(),10)
return pageSize
_getPageIndex = (grid_paging, curObjectName) ->
pageIndex = Tracker.nonreactive ()->
if Session.get("page_index")
if Session.get("page_index").object_name == curObjectName
page_index = Session.get("page_index").page_index
return page_index
else
delete Session.keys["page_index"]
else
return 0
if grid_paging
pageIndex = grid_paging.pageIndex
return pageIndex
getObjectpaging = (objectName)->
return Creator.getObject(objectName).paging
Template.creator_grid.onRendered ->
self = this
self.autorun (c)->
if Session.get("object_home_component")
# 如果从grid界面切换到plugin自定义的object component则不需要执行下面的代码
return
# Template.currentData() 这个代码不能删除,用于更新self.data中的数据
templateData = Template.currentData()
is_related = self.data.is_related
object_name = self.data.object_name
_pageSize = self.data.pageSize
creator_obj = Creator.getObject(object_name)
if !creator_obj
return
related_object_name = self.data.related_object_name
if is_related
list_view_id = Creator.getListView(related_object_name, "all")._id
else
list_view_id = Session.get("list_view_id")
unless list_view_id
toastr.error t("creator_list_view_permissions_lost")
return
if !is_related
# grid_paging = Tracker.nonreactive ()->
# _grid_paging = Session.get('grid_paging')
# if _grid_paging?.object_name == object_name && _grid_paging.list_view_id == list_view_id
# return _grid_paging
grid_paging = _getGridPaging(object_name, list_view_id)
curObjectName = if is_related then related_object_name else object_name
curObject = Creator.getObject(curObjectName)
user_permission_sets = Session.get("user_permission_sets")
userCompanyOrganizationId = Steedos.getUserCompanyOrganizationId()
isSpaceAdmin = Creator.isSpaceAdmin()
isOrganizationAdmin = _.include(user_permission_sets,"organization_admin")
record_id = self.data.record_id || Session.get("record_id")
related_list_item_props = self.data.related_list_item_props || {}
if Steedos.spaceId() and (is_related or Creator.subs["CreatorListViews"].ready()) and Creator.subs["TabularSetting"].ready()
url = Creator.getODataEndpointUrl(object_name, list_view_id, is_related, related_object_name)
filter = Creator.getListViewFilters(object_name, list_view_id, is_related, related_object_name, record_id)
pageIndex = _getPageIndex(grid_paging, curObjectName)
selectColumns = Creator.getListviewColumns(curObject, object_name, is_related, list_view_id, related_list_item_props)
# #expand_fields 不需要包含 extra_columns
expand_fields = _expandFields(curObjectName, selectColumns)
showColumns = _getShowColumns.call(self, curObject, selectColumns, is_related, list_view_id, related_list_item_props)
pageSize = _getPageSize(grid_paging, is_related, _pageSize)
objectPaging = getObjectpaging(curObjectName);
# extra_columns不需要显示在表格上,因此不做_columns函数处理
selectColumns = Creator.unionSelectColumnsWithExtraAndDepandOn(selectColumns, curObject, object_name, is_related)
# 对于a.b的字段,发送odata请求时需要转换为a/b
selectColumns = selectColumns.map (n)->
return n.replace(".", "/");
if !filter
# filter 为undefined时要设置为空,否则dxDataGrid控件会使用上次使用过的filter
filter = null
_listView = Creator.getListView(object_name, list_view_id, true)
if _.isNumber(objectPaging?.page_size)
pageSize = objectPaging?.page_size
dxOptions =
remoteOperations: true
scrolling:
showScrollbar: "always"
mode: _listView?.scrolling_mode || objectPaging?.mode || "standard"
paging:
pageSize: pageSize
enabled: objectPaging?.enabled
pager:
showPageSizeSelector: true,
allowedPageSizes: [10, 50, 100, 200],
showInfo: false,
showNavigationButtons: true
showColumnLines: false
allowColumnReordering: true
allowColumnResizing: true
columnResizingMode: "widget"
showRowLines: true
savingTimeout: 1000
stateStoring:{
type: "custom"
enabled: true
customSave: (gridState)->
if self.data.is_related
return
columns = gridState.columns
column_width = {}
sort = []
if columns and columns.length
columns = _.sortBy(_.values(columns), "visibleIndex")
_.each columns, (column_obj)->
if column_obj.width
column_width[column_obj.dataField] = column_obj.width
columns = _.sortBy(_.values(columns), "sortIndex")
_.each columns, (column_obj)->
if column_obj.sortOrder
sort.push {field_name: column_obj.dataField, order: column_obj.sortOrder}
Meteor.call 'grid_settings', curObjectName, list_view_id, column_width, sort,
(error, result)->
if error
console.log error
else
console.log "grid_settings success"
customLoad: ->
return {pageIndex: pageIndex}
}
dataSource:
store:
type: "odata"
version: 4
url: url
withCredentials: false
beforeSend: (request) ->
request.headers['X-User-Id'] = Meteor.userId()
request.headers['X-Space-Id'] = Steedos.spaceId()
request.headers['X-Auth-Token'] = Accounts._storedLoginToken()
errorHandler: (error) ->
if error.httpStatus == 404 || error.httpStatus == 400
error.message = t "creator_odata_api_not_found"
else if error.httpStatus == 401
error.message = t "creator_odata_unexpected_character"
else if error.httpStatus == 403
error.message = t "creator_odata_user_privileges"
else if error.httpStatus == 500
if error.message == "Unexpected character at 106" or error.message == 'Unexpected character at 374'
error.message = t "creator_odata_unexpected_character"
toastr.error(error.message)
console.error('errorHandler', error)
fieldTypes: {
'_id': 'String'
}
select: selectColumns
filter: filter
expand: expand_fields
columns: showColumns
columnAutoWidth: false
sorting:
mode: "multiple"
customizeExportData: (col, row)->
fields = curObject.fields
_.each row, (r)->
_.each r.values, (val, index)->
if val
if val.constructor == Object
r.values[index] = val.name || val._NAME_FIELD_VALUE
else if val.constructor == Array
_val = [];
_.each val, (_v)->
if _.isString(_v)
_val.push _v
else if _.isObject(_v)
_val.push(_v.name || _v._NAME_FIELD_VALUE)
r.values[index] = _val.join(",")
else if val.constructor == Date
dataField = col[index]?.dataField
if fields and fields[dataField]?.type == "date"
val = moment(val).format('YYYY-MM-DD')
r.values[index] = val
else
utcOffset = moment().utcOffset() / 60
val = moment(val).add(utcOffset, "hours").format('YYYY-MM-DD H:mm')
r.values[index] = val
else
dataField = col[index]?.dataField
if fields and fields[dataField]?.type == "select"
options = fields[dataField].options
valOpt = _.find options, (opt)->
return opt.value == val
if valOpt
r.values[index] = valOpt.label
onCellClick: (e)->
if e.column?.dataField == "_id_actions"
_itemClick.call(self, e, curObjectName, list_view_id)
onContentReady: (e)->
if self.data.total
self.data.total.set self.dxDataGridInstance.totalCount()
else if self.data.recordsTotal
recordsTotal = self.data.recordsTotal.get()
recordsTotal[curObjectName] = self.dxDataGridInstance.totalCount()
self.data.recordsTotal.set recordsTotal
unless is_related
unless curObject.enable_tree
# 不支持tree格式的翻页
current_pagesize = self.$(".gridContainer").dxDataGrid().dxDataGrid('instance').pageSize()
self.$(".gridContainer").dxDataGrid().dxDataGrid('instance').pageSize(current_pagesize)
localStorage.setItem("creator_pageSize:"+Meteor.userId(),current_pagesize)
# onNodesInitialized: (e)->
# if creator_obj.enable_tree
# # 默认展开第一个节点
# rootNode = e.component.getRootNode()
# firstNodeKey = rootNode?.children[0]?.key
# if firstNodeKey
# e.component.expandRow(firstNodeKey)
if Steedos.isMobile()
dxOptions.allowColumnReordering = false
dxOptions.allowColumnResizing = false
if is_related
dxOptions.pager.showPageSizeSelector = false
fileName = Creator.getObject(curObjectName).label + "-" + Creator.getListView(curObjectName, list_view_id)?.label
dxOptions.export =
enabled: true
fileName: fileName
allowExportSelectedData: false
if !is_related and curObject.enable_tree
# 如果是tree则过虑条件适用tree格式,要排除相关项is_related的情况,因为相关项列表不需要支持tree
dxOptions.keyExpr = <KEY>id"
dxOptions.parentIdExpr = "parent"
dxOptions.hasItemsExpr = (params)->
if params?.children?.length>0
return true
return false;
dxOptions.expandNodesOnFiltering = true
# tree 模式不能设置filter,filter由tree动态生成
dxOptions.dataSource.filter = null
dxOptions.rootValue = null
dxOptions.remoteOperations =
filtering: true
sorting: false
grouping: false
dxOptions.scrolling = null
dxOptions.pageing =
pageSize: 1000
# dxOptions.expandedRowKeys = ["<KEY>"]
# dxOptions.autoExpandAll = true
# 不支持tree格式的翻页,因为OData模式下,每次翻页都请求了完整数据,没有意义
dxOptions.pager = null
_.forEach dxOptions.columns, (column)->
if column.dataField == 'name' || column.dataField == curObject.NAME_FIELD_KEY
column.allowSearch = true
else
column.allowSearch = false
if object_name == "organizations"
unless isSpaceAdmin
if isOrganizationAdmin
if userCompanyOrganizationId
dxOptions.rootValue = userCompanyOrganizationId
else
dxOptions.rootValue = "-1"
else
dxOptions.rootValue = "-1"
module.dynamicImport('devextreme/ui/tree_list').then (dxTreeList)->
DevExpress.ui.dxTreeList = dxTreeList;
self.dxDataGridInstance = self.$(".gridContainer").dxTreeList(dxOptions).dxTreeList('instance')
if !is_related && self.$(".gridContainer").length > 0
Session.set("grid_paging", null)
else
module.dynamicImport('devextreme/ui/data_grid').then (dxDataGrid)->
DevExpress.ui.dxDataGrid = dxDataGrid;
self.dxDataGridInstance = self.$(".gridContainer").dxDataGrid(dxOptions).dxDataGrid('instance')
if !is_related && self.$(".gridContainer").length > 0
Session.set("grid_paging", null)
# self.dxDataGridInstance.pageSize(pageSize)
Template.creator_grid.helpers Creator.helpers
Template.creator_grid.helpers
hideGridContent: ()->
is_related = Template.instance().data.is_related
recordsTotal = Template.instance().data.recordsTotal
related_object_name = Template.instance().data.related_object_name
if is_related and recordsTotal
total = recordsTotal.get()?[related_object_name]
return !total
else
return false
gridObjectNameClass: ()->
is_related = Template.instance().data.is_related
object_name = Template.instance().data.object_name
related_object_name = Template.instance().data.related_object_name
result = if is_related then related_object_name else object_name
# 文件版本为"cfs.files.filerecord",需要替换为"cfs-files-filerecord"
return result.replace(/\./g,"-")
Template.creator_grid.events
'click .table-cell-edit': (event, template) ->
is_related = template.data.is_related
field = this.field_name
full_screen = this.full_screen
if this.field.depend_on && _.isArray(this.field.depend_on)
field = _.clone(this.field.depend_on)
field.push(this.field_name)
field = field.join(",")
objectName = if is_related then (template.data?.related_object_name || Session.get("related_object_name")) else (template.data?.object_name || Session.get("object_name"))
object = Creator.getObject(objectName)
collection_name = object.label
record = Creator.odata.get(objectName, this._id)
if record
Session.set("cmFullScreen", full_screen)
Session.set 'cmDoc', record
Session.set("action_fields", field)
Session.set("action_collection", "Creator.Collections.#{objectName}")
Session.set("action_collection_name", collection_name)
Session.set("action_save_and_insert", false)
Session.set 'cmIsMultipleUpdate', true
Session.set 'cmTargetIds', Creator.TabularSelectedIds?[objectName]
Meteor.defer ()->
$(".btn.creator-cell-edit").click()
return false
'dblclick td': (event) ->
$(".table-cell-edit", event.currentTarget).click()
'click td': (event, template)->
if $(event.currentTarget).find(".slds-checkbox input").length
# 左侧勾选框不要focus样式功能
return
if $(event.currentTarget).parent().hasClass("dx-freespace-row")
# 最底下的空白td不要focus样式功能
return
template.$("td").removeClass("slds-has-focus")
$(event.currentTarget).addClass("slds-has-focus")
'click .link-detail': (event, template)->
page_index = Template.instance().dxDataGridInstance.pageIndex()
object_name = Session.get("object_name")
Session.set 'page_index', {object_name: object_name, page_index: page_index}
# 'click .dx-datagrid-table .dx-row-lines': (event, template)->
# if Steedos.isMobile()
# herf = $("a", event.currentTarget).attr('href')
# if herf.startsWith(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX)
# herf = herf.replace(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX,'')
# FlowRouter.go(herf)
Template.creator_grid.onCreated ->
self = this
self.list_view_id = Session.get("list_view_id")
AutoForm.hooks creatorAddForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
,false
AutoForm.hooks creatorEditForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
,false
AutoForm.hooks creatorCellEditForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
,false
AutoForm.hooks creatorAddRelatedForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
# Template.creator_grid.onDestroyed ->
# #离开界面时,清除hooks为空函数
# AutoForm.hooks creatorAddForm:
# onSuccess: (formType, result)->
# $('#afModal').modal 'hide'
# if result.type == "post"
# app_id = Session.get("app_id")
# object_name = result.object_name
# record_id = result._id
# url = "/app/#{app_id}/#{object_name}/view/#{record_id}"
# FlowRouter.go url
# ,true
# AutoForm.hooks creatorEditForm:
# onSuccess: (formType, result)->
# $('#afModal').modal 'hide'
# if result.type == "post"
# app_id = Session.get("app_id")
# object_name = result.object_name
# record_id = result._id
# url = "/app/#{app_id}/#{object_name}/view/#{record_id}"
# FlowRouter.go url
# ,true
# AutoForm.hooks creatorCellEditForm:
# onSuccess: ()->
# $('#afModal').modal 'hide'
# ,true
Template.creator_grid.refresh = (dxDataGridInstance)->
is_related = this.data?.is_related || false
if !is_related
Session.set("grid_paging", null)
dxDataGridInstance.refresh().done (result)->
Creator.remainCheckboxState(dxDataGridInstance.$element())
Template.creator_grid.onDestroyed ->
is_related = this.data.is_related
if !is_related && this.list_view_id == Session.get("list_view_id")
paging = this.dxDataGridInstance?.option().paging
if paging
paging.object_name = this.data.object_name
paging.list_view_id = this.list_view_id
Session.set("grid_paging", paging) | true | _itemClick = (e, curObjectName, list_view_id)->
self = this
record = e.data
if !record
return
if _.isObject(record._id)
record._id = record._id._value
record_permissions = Creator.getRecordPermissions curObjectName, record, Meteor.userId()
actions = _actionItems(curObjectName, record, record_permissions)
if actions.length
actionSheetItems = _.map actions, (action)->
return {text: action.label, record: record, action: action, object_name: curObjectName}
else
actionSheetItems = [{text: t("creator_list_no_actions_tip")}]
actionSheetOption =
dataSource: actionSheetItems
showTitle: false
usePopover: true
width: "auto"
onItemClick: (value)->
action = value.itemData.action
recordId = value.itemData.record._id
objectName = value.itemData.object_name
object = Creator.getObject(objectName)
collectionName = object.label
name_field_key = object.NAME_FIELD_KEY
if objectName == "organizations"
# 显示组织列表时,特殊处理name_field_key为name字段
name_field_key = "name"
Session.set("action_fields", undefined)
Session.set("action_collection", "Creator.Collections.#{objectName}")
Session.set("action_collection_name", collectionName)
Session.set("action_save_and_insert", true)
if action.todo == "standard_delete"
action_record_title = value.itemData.record[name_field_key]
Creator.executeAction objectName, action, recordId, action_record_title, list_view_id, value.itemData.record, ()->
# 移除列表勾选中的id值,并刷新列表保持列表原来选中的id值集合状态
selectedIds = Creator.TabularSelectedIds[objectName]
Creator.TabularSelectedIds[objectName] = _.without(selectedIds, recordId)
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
else
Creator.executeAction objectName, action, recordId, value.itemElement
if actions.length
actionSheetOption.itemTemplate = "item"
else
actionSheetOption.itemTemplate = (itemData, itemIndex, itemElement)->
itemElement.html "<span class='text-muted'>#{itemData.text}</span>"
actionSheet = $(".action-sheet").dxActionSheet(actionSheetOption).dxActionSheet("instance")
actionSheet.option("target", e.event.target);
actionSheet.option("visible", true);
_actionItems = (object_name, record, record_permissions)->
obj = Creator.getObject(object_name)
actions = Creator.getActions(object_name)
actions = _.filter actions, (action)->
if action.on == "record" or action.on == "record_more" or action.on == "list_item"
if typeof action.visible == "function"
return action.visible(object_name, record._id, record_permissions, record)
else
return action.visible
else
return false
return actions
_expandFields = (object_name, columns)->
expand_fields = []
fields = Creator.getObject(object_name).fields
_.each columns, (n)->
if fields[n]?.type == "master_detail" || fields[n]?.type == "lookup"
if fields[n].reference_to
ref = fields[n].reference_to
if _.isFunction(ref)
ref = ref()
else
ref = fields[n].optionsFunction({}).getProperty("value")
if !_.isArray(ref)
ref = [ref]
ref = _.map ref, (o)->
key = Creator.getObject(o)?.NAME_FIELD_KEY || "name"
return key
ref = _.compact(ref)
ref = _.uniq(ref)
ref = ref.join(",")
if ref
# expand_fields.push(n + "($select=" + ref + ")")
expand_fields.push(n)
# expand_fields.push n + "($select=name)"
return expand_fields
getColumnItem = (object, list_view, column, list_view_sort, column_default_sort, column_sort_settings, is_related, defaultWidth)->
field = object.fields[column]
listViewColumns = list_view.columns
listViewColumn = {field: column};
_.every listViewColumns, (_column)->
if _.isObject(_column)
eq = _column?.field == column
else
eq = _column == column
if eq
listViewColumn = _column
return !eq;
if _.isString(listViewColumn)
listViewColumn = {field: listViewColumn}
columnWidth = listViewColumn?.width || ''
if !columnWidth && Steedos.isMobile()
columnWidth = "160px"
columnItem =
cssClass: "slds-cell-edit cell-type-#{field.type} cell-name-#{field.name}"
caption: listViewColumn?.label || field.label || TAPi18n.__(object.schema.label(listViewColumn?.field))
dataField: listViewColumn?.field
alignment: "left"
width: columnWidth
cellTemplate: (container, options) ->
field_name = column
if /\w+\.\$\.\w+/g.test(field_name)
# object类型带子属性的field_name要去掉中间的美元符号,否则显示不出字段值
field_name = column.replace(/\$\./,"")
# 需要考虑field_name为 a.b.c 这种格式
field_val = eval("options.data." + field_name)
cellOption = {_id: options.data._id, val: field_val, doc: options.data, field: field, field_name: field_name, object_name: object.name, agreement: "odata", is_related: is_related}
if field.type is "markdown"
cellOption["full_screen"] = true
Blaze.renderWithData Template.creator_table_cell, cellOption, container[0]
if listViewColumn?.wrap
columnItem.cssClass += " cell-wrap"
else
columnItem.cssClass += " cell-nowrap"
# 不换行的字段如果没配置宽度,则使用默认宽度
# if !columnItem.width
# columnItem.width = defaultWidth
if column_sort_settings and column_sort_settings.length > 0
_.each column_sort_settings, (sort)->
if sort[0] == column
columnItem.sortOrder = sort[1]
else if !_.isEmpty(list_view_sort)
_.each list_view_sort, (sort)->
if sort[0] == column
columnItem.sortOrder = sort[1]
else
#默认读取default view的sort配置
_.each column_default_sort, (sort)->
if sort[0] == column
columnItem.sortOrder = sort[1]
unless field.sortable
columnItem.allowSorting = false
return columnItem;
_columns = (object_name, columns, list_view_id, is_related, relatedSort)->
object = Creator.getObject(object_name)
grid_settings = Creator.getCollection("settings").findOne({object_name: object_name, record_id: "object_gridviews"})
column_default_sort = Creator.transformSortToDX(Creator.getObjectDefaultSort(object_name))
if grid_settings and grid_settings.settings
column_width_settings = grid_settings.settings[list_view_id]?.column_width
column_sort_settings = Creator.transformSortToDX(grid_settings.settings[list_view_id]?.sort)
list_view = Creator.getListView(object_name, list_view_id)
list_view_sort = Creator.transformSortToDX(list_view?.sort)
if column_sort_settings and column_sort_settings.length > 0
list_view_sort = column_sort_settings
else if is_related && !_.isEmpty(relatedSort)
list_view_sort = Creator.transformSortToDX(relatedSort)
else if !_.isEmpty(list_view_sort)
list_view_sort = list_view_sort
else
#默认读取default view的sort配置
list_view_sort = column_default_sort
result = columns.map (n,i)->
defaultWidth = _defaultWidth(columns, object.enable_tree, i)
return getColumnItem(object, list_view, n, list_view_sort, column_default_sort, column_sort_settings, is_related, defaultWidth)
if !_.isEmpty(list_view_sort)
_.each list_view_sort, (sort,index)->
sortColumn = _.findWhere(result,{dataField:sort[0]})
if sortColumn
sortColumn.sortOrder = sort[1]
sortColumn.sortIndex = index
return result
_defaultWidth = (columns, isTree, i)->
if columns.length == i+1
return null;
column_counts = columns.length
subWidth = if isTree then 46 else 46 + 60 + 60
content_width = $(".gridContainer").width() - subWidth
return content_width/column_counts
_getShowColumns = (curObject, selectColumns, is_related, list_view_id, related_list_item_props) ->
self = this
curObjectName = curObject.name
# 这里如果不加nonreactive,会因为后面customSave函数插入数据造成表Creator.Collections.settings数据变化进入死循环
showColumns = Tracker.nonreactive ()-> return _columns(curObjectName, selectColumns, list_view_id, is_related, related_list_item_props.sort)
actions = Creator.getActions(curObjectName)
if true || !Steedos.isMobile() && actions.length
showColumns.push
dataField: "_id_actions"
width: 46
allowExporting: false
allowSorting: false
allowReordering: false
headerCellTemplate: (container) ->
return ""
cellTemplate: (container, options) ->
htmlText = """
<span class="slds-grid slds-grid--align-spread creator-table-actions">
<div class="forceVirtualActionMarker forceVirtualAction">
<a class="rowActionsPlaceHolder slds-button slds-button--icon-x-small slds-button--icon-border-filled keyboardMode--trigger" aria-haspopup="true" role="button" title="" href="javascript:void(0);" data-toggle="dropdown">
<span class="slds-icon_container slds-icon-utility-down">
<span class="lightningPrimitiveIcon">
#{Blaze.toHTMLWithData Template.steedos_button_icon, {class: "slds-icon slds-icon-text-default slds-icon--xx-small", source: "utility-sprite", name:"down"}}
</span>
<span class="slds-assistive-text" data-aura-rendered-by="15534:0">显示更多信息</span>
</span>
</a>
</div>
</span>
"""
$("<div>").append(htmlText).appendTo(container);
if is_related || !curObject.enable_tree
nameFieldKey = curObject.NAME_FIELD_KEY
needToShowLinkForIndexColumn = false
if selectColumns.indexOf(nameFieldKey) < 0
needToShowLinkForIndexColumn = true
if true || !Steedos.isMobile()
showColumns.splice 0, 0,
dataField: "_id_checkbox"
width: 30
allowResizing: false
allowExporting: false
allowSorting: false
allowReordering: false
headerCellTemplate: (container) ->
Blaze.renderWithData Template.creator_table_checkbox, {_id: "#", object_name: curObjectName}, container[0]
cellTemplate: (container, options) ->
Blaze.renderWithData Template.creator_table_checkbox, {_id: options.data._id, object_name: curObjectName}, container[0]
showColumns.splice 0, 0,
dataField: "_index"
width: 50
allowResizing: false
alignment: "right"
allowExporting: true
allowSorting: false
allowReordering: false
caption: ""
cellTemplate: (container, options) ->
pageSize = self.dxDataGridInstance.pageSize()
pageIndex = self.dxDataGridInstance.pageIndex()
htmlText = options.rowIndex + 1 + pageSize * pageIndex
if needToShowLinkForIndexColumn
href = Creator.getObjectUrl(curObjectName, options.data._id)
htmlText = $("<a href=\"#{href}\" class=\"grid-index-link\">#{htmlText}</a>")
if is_related
htmlText.attr("onclick", Steedos.getOpenWindowScript(href))
$("<div>").append(htmlText).appendTo(container)
else
$("<div>").append(htmlText).appendTo(container)
_.every showColumns, (n)->
n.sortingMethod = Creator.sortingMethod
return showColumns;
_getGridPaging = (object_name, list_view_id) ->
return Tracker.nonreactive ()->
_grid_paging = Session.get('grid_paging')
if _grid_paging?.object_name == object_name && _grid_paging.list_view_id == list_view_id
return _grid_paging
_getPageSize = (grid_paging, is_related, selfPageSize) ->
localPageSize = localStorage.getItem("creator_pageSize:"+Meteor.userId())
if !is_related and localPageSize
pageSize = localPageSize
if selfPageSize
pageSize = selfPageSize
else if is_related
pageSize = 5
else
if grid_paging
pageSize = grid_paging.pageSize
else
pageSize = 50
# localStorage.setItem("creator_pageSize:"+Meteor.userId(),10)
return pageSize
_getPageIndex = (grid_paging, curObjectName) ->
pageIndex = Tracker.nonreactive ()->
if Session.get("page_index")
if Session.get("page_index").object_name == curObjectName
page_index = Session.get("page_index").page_index
return page_index
else
delete Session.keys["page_index"]
else
return 0
if grid_paging
pageIndex = grid_paging.pageIndex
return pageIndex
getObjectpaging = (objectName)->
return Creator.getObject(objectName).paging
Template.creator_grid.onRendered ->
self = this
self.autorun (c)->
if Session.get("object_home_component")
# 如果从grid界面切换到plugin自定义的object component则不需要执行下面的代码
return
# Template.currentData() 这个代码不能删除,用于更新self.data中的数据
templateData = Template.currentData()
is_related = self.data.is_related
object_name = self.data.object_name
_pageSize = self.data.pageSize
creator_obj = Creator.getObject(object_name)
if !creator_obj
return
related_object_name = self.data.related_object_name
if is_related
list_view_id = Creator.getListView(related_object_name, "all")._id
else
list_view_id = Session.get("list_view_id")
unless list_view_id
toastr.error t("creator_list_view_permissions_lost")
return
if !is_related
# grid_paging = Tracker.nonreactive ()->
# _grid_paging = Session.get('grid_paging')
# if _grid_paging?.object_name == object_name && _grid_paging.list_view_id == list_view_id
# return _grid_paging
grid_paging = _getGridPaging(object_name, list_view_id)
curObjectName = if is_related then related_object_name else object_name
curObject = Creator.getObject(curObjectName)
user_permission_sets = Session.get("user_permission_sets")
userCompanyOrganizationId = Steedos.getUserCompanyOrganizationId()
isSpaceAdmin = Creator.isSpaceAdmin()
isOrganizationAdmin = _.include(user_permission_sets,"organization_admin")
record_id = self.data.record_id || Session.get("record_id")
related_list_item_props = self.data.related_list_item_props || {}
if Steedos.spaceId() and (is_related or Creator.subs["CreatorListViews"].ready()) and Creator.subs["TabularSetting"].ready()
url = Creator.getODataEndpointUrl(object_name, list_view_id, is_related, related_object_name)
filter = Creator.getListViewFilters(object_name, list_view_id, is_related, related_object_name, record_id)
pageIndex = _getPageIndex(grid_paging, curObjectName)
selectColumns = Creator.getListviewColumns(curObject, object_name, is_related, list_view_id, related_list_item_props)
# #expand_fields 不需要包含 extra_columns
expand_fields = _expandFields(curObjectName, selectColumns)
showColumns = _getShowColumns.call(self, curObject, selectColumns, is_related, list_view_id, related_list_item_props)
pageSize = _getPageSize(grid_paging, is_related, _pageSize)
objectPaging = getObjectpaging(curObjectName);
# extra_columns不需要显示在表格上,因此不做_columns函数处理
selectColumns = Creator.unionSelectColumnsWithExtraAndDepandOn(selectColumns, curObject, object_name, is_related)
# 对于a.b的字段,发送odata请求时需要转换为a/b
selectColumns = selectColumns.map (n)->
return n.replace(".", "/");
if !filter
# filter 为undefined时要设置为空,否则dxDataGrid控件会使用上次使用过的filter
filter = null
_listView = Creator.getListView(object_name, list_view_id, true)
if _.isNumber(objectPaging?.page_size)
pageSize = objectPaging?.page_size
dxOptions =
remoteOperations: true
scrolling:
showScrollbar: "always"
mode: _listView?.scrolling_mode || objectPaging?.mode || "standard"
paging:
pageSize: pageSize
enabled: objectPaging?.enabled
pager:
showPageSizeSelector: true,
allowedPageSizes: [10, 50, 100, 200],
showInfo: false,
showNavigationButtons: true
showColumnLines: false
allowColumnReordering: true
allowColumnResizing: true
columnResizingMode: "widget"
showRowLines: true
savingTimeout: 1000
stateStoring:{
type: "custom"
enabled: true
customSave: (gridState)->
if self.data.is_related
return
columns = gridState.columns
column_width = {}
sort = []
if columns and columns.length
columns = _.sortBy(_.values(columns), "visibleIndex")
_.each columns, (column_obj)->
if column_obj.width
column_width[column_obj.dataField] = column_obj.width
columns = _.sortBy(_.values(columns), "sortIndex")
_.each columns, (column_obj)->
if column_obj.sortOrder
sort.push {field_name: column_obj.dataField, order: column_obj.sortOrder}
Meteor.call 'grid_settings', curObjectName, list_view_id, column_width, sort,
(error, result)->
if error
console.log error
else
console.log "grid_settings success"
customLoad: ->
return {pageIndex: pageIndex}
}
dataSource:
store:
type: "odata"
version: 4
url: url
withCredentials: false
beforeSend: (request) ->
request.headers['X-User-Id'] = Meteor.userId()
request.headers['X-Space-Id'] = Steedos.spaceId()
request.headers['X-Auth-Token'] = Accounts._storedLoginToken()
errorHandler: (error) ->
if error.httpStatus == 404 || error.httpStatus == 400
error.message = t "creator_odata_api_not_found"
else if error.httpStatus == 401
error.message = t "creator_odata_unexpected_character"
else if error.httpStatus == 403
error.message = t "creator_odata_user_privileges"
else if error.httpStatus == 500
if error.message == "Unexpected character at 106" or error.message == 'Unexpected character at 374'
error.message = t "creator_odata_unexpected_character"
toastr.error(error.message)
console.error('errorHandler', error)
fieldTypes: {
'_id': 'String'
}
select: selectColumns
filter: filter
expand: expand_fields
columns: showColumns
columnAutoWidth: false
sorting:
mode: "multiple"
customizeExportData: (col, row)->
fields = curObject.fields
_.each row, (r)->
_.each r.values, (val, index)->
if val
if val.constructor == Object
r.values[index] = val.name || val._NAME_FIELD_VALUE
else if val.constructor == Array
_val = [];
_.each val, (_v)->
if _.isString(_v)
_val.push _v
else if _.isObject(_v)
_val.push(_v.name || _v._NAME_FIELD_VALUE)
r.values[index] = _val.join(",")
else if val.constructor == Date
dataField = col[index]?.dataField
if fields and fields[dataField]?.type == "date"
val = moment(val).format('YYYY-MM-DD')
r.values[index] = val
else
utcOffset = moment().utcOffset() / 60
val = moment(val).add(utcOffset, "hours").format('YYYY-MM-DD H:mm')
r.values[index] = val
else
dataField = col[index]?.dataField
if fields and fields[dataField]?.type == "select"
options = fields[dataField].options
valOpt = _.find options, (opt)->
return opt.value == val
if valOpt
r.values[index] = valOpt.label
onCellClick: (e)->
if e.column?.dataField == "_id_actions"
_itemClick.call(self, e, curObjectName, list_view_id)
onContentReady: (e)->
if self.data.total
self.data.total.set self.dxDataGridInstance.totalCount()
else if self.data.recordsTotal
recordsTotal = self.data.recordsTotal.get()
recordsTotal[curObjectName] = self.dxDataGridInstance.totalCount()
self.data.recordsTotal.set recordsTotal
unless is_related
unless curObject.enable_tree
# 不支持tree格式的翻页
current_pagesize = self.$(".gridContainer").dxDataGrid().dxDataGrid('instance').pageSize()
self.$(".gridContainer").dxDataGrid().dxDataGrid('instance').pageSize(current_pagesize)
localStorage.setItem("creator_pageSize:"+Meteor.userId(),current_pagesize)
# onNodesInitialized: (e)->
# if creator_obj.enable_tree
# # 默认展开第一个节点
# rootNode = e.component.getRootNode()
# firstNodeKey = rootNode?.children[0]?.key
# if firstNodeKey
# e.component.expandRow(firstNodeKey)
if Steedos.isMobile()
dxOptions.allowColumnReordering = false
dxOptions.allowColumnResizing = false
if is_related
dxOptions.pager.showPageSizeSelector = false
fileName = Creator.getObject(curObjectName).label + "-" + Creator.getListView(curObjectName, list_view_id)?.label
dxOptions.export =
enabled: true
fileName: fileName
allowExportSelectedData: false
if !is_related and curObject.enable_tree
# 如果是tree则过虑条件适用tree格式,要排除相关项is_related的情况,因为相关项列表不需要支持tree
dxOptions.keyExpr = PI:KEY:<KEY>END_PIid"
dxOptions.parentIdExpr = "parent"
dxOptions.hasItemsExpr = (params)->
if params?.children?.length>0
return true
return false;
dxOptions.expandNodesOnFiltering = true
# tree 模式不能设置filter,filter由tree动态生成
dxOptions.dataSource.filter = null
dxOptions.rootValue = null
dxOptions.remoteOperations =
filtering: true
sorting: false
grouping: false
dxOptions.scrolling = null
dxOptions.pageing =
pageSize: 1000
# dxOptions.expandedRowKeys = ["PI:KEY:<KEY>END_PI"]
# dxOptions.autoExpandAll = true
# 不支持tree格式的翻页,因为OData模式下,每次翻页都请求了完整数据,没有意义
dxOptions.pager = null
_.forEach dxOptions.columns, (column)->
if column.dataField == 'name' || column.dataField == curObject.NAME_FIELD_KEY
column.allowSearch = true
else
column.allowSearch = false
if object_name == "organizations"
unless isSpaceAdmin
if isOrganizationAdmin
if userCompanyOrganizationId
dxOptions.rootValue = userCompanyOrganizationId
else
dxOptions.rootValue = "-1"
else
dxOptions.rootValue = "-1"
module.dynamicImport('devextreme/ui/tree_list').then (dxTreeList)->
DevExpress.ui.dxTreeList = dxTreeList;
self.dxDataGridInstance = self.$(".gridContainer").dxTreeList(dxOptions).dxTreeList('instance')
if !is_related && self.$(".gridContainer").length > 0
Session.set("grid_paging", null)
else
module.dynamicImport('devextreme/ui/data_grid').then (dxDataGrid)->
DevExpress.ui.dxDataGrid = dxDataGrid;
self.dxDataGridInstance = self.$(".gridContainer").dxDataGrid(dxOptions).dxDataGrid('instance')
if !is_related && self.$(".gridContainer").length > 0
Session.set("grid_paging", null)
# self.dxDataGridInstance.pageSize(pageSize)
Template.creator_grid.helpers Creator.helpers
Template.creator_grid.helpers
hideGridContent: ()->
is_related = Template.instance().data.is_related
recordsTotal = Template.instance().data.recordsTotal
related_object_name = Template.instance().data.related_object_name
if is_related and recordsTotal
total = recordsTotal.get()?[related_object_name]
return !total
else
return false
gridObjectNameClass: ()->
is_related = Template.instance().data.is_related
object_name = Template.instance().data.object_name
related_object_name = Template.instance().data.related_object_name
result = if is_related then related_object_name else object_name
# 文件版本为"cfs.files.filerecord",需要替换为"cfs-files-filerecord"
return result.replace(/\./g,"-")
Template.creator_grid.events
'click .table-cell-edit': (event, template) ->
is_related = template.data.is_related
field = this.field_name
full_screen = this.full_screen
if this.field.depend_on && _.isArray(this.field.depend_on)
field = _.clone(this.field.depend_on)
field.push(this.field_name)
field = field.join(",")
objectName = if is_related then (template.data?.related_object_name || Session.get("related_object_name")) else (template.data?.object_name || Session.get("object_name"))
object = Creator.getObject(objectName)
collection_name = object.label
record = Creator.odata.get(objectName, this._id)
if record
Session.set("cmFullScreen", full_screen)
Session.set 'cmDoc', record
Session.set("action_fields", field)
Session.set("action_collection", "Creator.Collections.#{objectName}")
Session.set("action_collection_name", collection_name)
Session.set("action_save_and_insert", false)
Session.set 'cmIsMultipleUpdate', true
Session.set 'cmTargetIds', Creator.TabularSelectedIds?[objectName]
Meteor.defer ()->
$(".btn.creator-cell-edit").click()
return false
'dblclick td': (event) ->
$(".table-cell-edit", event.currentTarget).click()
'click td': (event, template)->
if $(event.currentTarget).find(".slds-checkbox input").length
# 左侧勾选框不要focus样式功能
return
if $(event.currentTarget).parent().hasClass("dx-freespace-row")
# 最底下的空白td不要focus样式功能
return
template.$("td").removeClass("slds-has-focus")
$(event.currentTarget).addClass("slds-has-focus")
'click .link-detail': (event, template)->
page_index = Template.instance().dxDataGridInstance.pageIndex()
object_name = Session.get("object_name")
Session.set 'page_index', {object_name: object_name, page_index: page_index}
# 'click .dx-datagrid-table .dx-row-lines': (event, template)->
# if Steedos.isMobile()
# herf = $("a", event.currentTarget).attr('href')
# if herf.startsWith(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX)
# herf = herf.replace(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX,'')
# FlowRouter.go(herf)
Template.creator_grid.onCreated ->
self = this
self.list_view_id = Session.get("list_view_id")
AutoForm.hooks creatorAddForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
,false
AutoForm.hooks creatorEditForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
,false
AutoForm.hooks creatorCellEditForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
,false
AutoForm.hooks creatorAddRelatedForm:
onSuccess: (formType,result)->
self.dxDataGridInstance?.refresh().done (result)->
Creator.remainCheckboxState(self.dxDataGridInstance.$element())
# Template.creator_grid.onDestroyed ->
# #离开界面时,清除hooks为空函数
# AutoForm.hooks creatorAddForm:
# onSuccess: (formType, result)->
# $('#afModal').modal 'hide'
# if result.type == "post"
# app_id = Session.get("app_id")
# object_name = result.object_name
# record_id = result._id
# url = "/app/#{app_id}/#{object_name}/view/#{record_id}"
# FlowRouter.go url
# ,true
# AutoForm.hooks creatorEditForm:
# onSuccess: (formType, result)->
# $('#afModal').modal 'hide'
# if result.type == "post"
# app_id = Session.get("app_id")
# object_name = result.object_name
# record_id = result._id
# url = "/app/#{app_id}/#{object_name}/view/#{record_id}"
# FlowRouter.go url
# ,true
# AutoForm.hooks creatorCellEditForm:
# onSuccess: ()->
# $('#afModal').modal 'hide'
# ,true
Template.creator_grid.refresh = (dxDataGridInstance)->
is_related = this.data?.is_related || false
if !is_related
Session.set("grid_paging", null)
dxDataGridInstance.refresh().done (result)->
Creator.remainCheckboxState(dxDataGridInstance.$element())
Template.creator_grid.onDestroyed ->
is_related = this.data.is_related
if !is_related && this.list_view_id == Session.get("list_view_id")
paging = this.dxDataGridInstance?.option().paging
if paging
paging.object_name = this.data.object_name
paging.list_view_id = this.list_view_id
Session.set("grid_paging", paging) |
[
{
"context": "a'\n\n it 'get,set', (done)->\n key = 'session_key'.add_5_Random_Letters()\n session_data = { value: key, expire: new Date",
"end": 698,
"score": 0.9897887110710144,
"start": 663,
"tag": "KEY",
"value": "session_key'.add_5_Random_Letters()"
},
{
"context": "();\n\n it 'destroy', (done)->\n key = 'session_key'.add_5_Random_Letters()\n session_data = { value: key, expire: new Date",
"end": 1055,
"score": 0.993708610534668,
"start": 1020,
"tag": "KEY",
"value": "session_key'.add_5_Random_Letters()"
},
{
"context": "express()\n options =\n secret : '1234567890'\n saveUninitialized: true\n resave ",
"end": 3656,
"score": 0.9465295672416687,
"start": 3646,
"tag": "KEY",
"value": "1234567890"
}
] | test/services/Session-Service.test.coffee | TeamMentor/TM_Site | 0 | Session_Service = require('../../src/services/Session-Service')
session = require('express-session')
express = require 'express'
supertest = require 'supertest'
describe '| services | Session.test', ()->
testDb = './_session_TestDb'
session_Service = null
beforeEach ()->
session_Service = new Session_Service { filename: testDb }
session_Service.setup()
afterEach ()->
if testDb.file_Exists()
testDb.file_Delete().assert_Is_True()
it 'constructor (no params)',->
using new Session_Service(),->
@.filename.assert_Is './.tmCache/_sessionData'
it 'get,set', (done)->
key = 'session_key'.add_5_Random_Letters()
session_data = { value: key, expire: new Date() }
using session_Service,->
@.set key, session_data, (err)=>
assert_Is_Null(err);
@.get key, (err, data)->
assert_Is_Null(err);
data.assert_Is(session_data)
done();
it 'destroy', (done)->
key = 'session_key'.add_5_Random_Letters()
session_data = { value: key, expire: new Date() }
session_Service.set key, session_data, (err)->
assert_Is_Null(err);
session_Service.get key, (err, data)->
assert_Is_Null(err);
data.assert_Is(session_data)
session_Service.destroy key, (err)->
assert_Is_Null(err);
session_Service.get key, (err, data)->
assert_Is_Null(err);
assert_Is_Null(data);
done()
it 'users_Searches (default values)', (done)->
using session_Service,->
@.set 'sid-1', {recent_Articles: [{id: 'id_1', title: 'title_1'}]}, =>
@.users_Searches (result)=>
result.assert_Is session_Service.DEFAULT_SEARCHES
done()
it 'users_Searches', (done)->
using session_Service,->
@.set 'sid-1', {user_Searches: [{ id :'abc1', title: 'search a' , results:11},
{ id :'abc2', title: 'search b' , results:12},
{ id :'abc2', title: 'search b' , results:13}
{ id :'abc3', title: 'search c' , results:0}]}, =>
@.users_Searches (result)=>
result.assert_Size_Is_Bigger_Than 5
if result.size() is 6
result.fourth().assert_Is { id :'abc1', title: 'search a' , results:11}
done()
it 'viewed_Articles', (done)->
using session_Service,->
@.set 'sid-1', {recent_Articles: [{id: 'id_1', title: 'title_1'}]}, =>
@.set 'sid-2', {recent_Articles: [{id: 'id_2', title: 'title_2'}]}, =>
@.set 'sid-3', {recent_Articles: [{id: 'id_3', title: 'title_3'}]}, =>
@.set 'sid-4', {recent_Articles: [{id: 'id_4', title: 'title_4'}]}, =>
@.db.find {}, (err,sessionData)=>
sessionData.size().assert_Is_Bigger_Than 3
@.viewed_Articles (data)->
data.json_Str().assert_Contains ['id_1','id_2', 'id_3', 'id_4','title_1','title_2', 'title_3', 'title_4']
done()
it 'viewed_Articles (default)', (done)->
using session_Service,->
@.viewed_Articles (data)=>
data.assert_Is @.DEFAULT_ARTICLES
done()
describe 'testing behaviour of express-session', ()->
app = null
testValue = 'this is a session value';
sessionAsJson = '{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"}}';
before ()-> # recrete the config used on server.js and add a couple test routes
app = express()
options =
secret : '1234567890'
saveUninitialized: true
resave : true
app.use session(options)
middleware = (req,res,next)->
req.session.value = testValue;
next()
app.get '/session_values' , (req,res)-> res.send req.session
app.get '/session_get_userId' , middleware, (req,res)-> res.send req.session.value
it 'Check default session values', (done)->
supertest(app).get '/session_values'
.expect 200,sessionAsJson, done
it 'Check specific session value', (done)->
supertest(app).get '/session_get_userId'
.expect 200,testValue, done | 225078 | Session_Service = require('../../src/services/Session-Service')
session = require('express-session')
express = require 'express'
supertest = require 'supertest'
describe '| services | Session.test', ()->
testDb = './_session_TestDb'
session_Service = null
beforeEach ()->
session_Service = new Session_Service { filename: testDb }
session_Service.setup()
afterEach ()->
if testDb.file_Exists()
testDb.file_Delete().assert_Is_True()
it 'constructor (no params)',->
using new Session_Service(),->
@.filename.assert_Is './.tmCache/_sessionData'
it 'get,set', (done)->
key = '<KEY>
session_data = { value: key, expire: new Date() }
using session_Service,->
@.set key, session_data, (err)=>
assert_Is_Null(err);
@.get key, (err, data)->
assert_Is_Null(err);
data.assert_Is(session_data)
done();
it 'destroy', (done)->
key = '<KEY>
session_data = { value: key, expire: new Date() }
session_Service.set key, session_data, (err)->
assert_Is_Null(err);
session_Service.get key, (err, data)->
assert_Is_Null(err);
data.assert_Is(session_data)
session_Service.destroy key, (err)->
assert_Is_Null(err);
session_Service.get key, (err, data)->
assert_Is_Null(err);
assert_Is_Null(data);
done()
it 'users_Searches (default values)', (done)->
using session_Service,->
@.set 'sid-1', {recent_Articles: [{id: 'id_1', title: 'title_1'}]}, =>
@.users_Searches (result)=>
result.assert_Is session_Service.DEFAULT_SEARCHES
done()
it 'users_Searches', (done)->
using session_Service,->
@.set 'sid-1', {user_Searches: [{ id :'abc1', title: 'search a' , results:11},
{ id :'abc2', title: 'search b' , results:12},
{ id :'abc2', title: 'search b' , results:13}
{ id :'abc3', title: 'search c' , results:0}]}, =>
@.users_Searches (result)=>
result.assert_Size_Is_Bigger_Than 5
if result.size() is 6
result.fourth().assert_Is { id :'abc1', title: 'search a' , results:11}
done()
it 'viewed_Articles', (done)->
using session_Service,->
@.set 'sid-1', {recent_Articles: [{id: 'id_1', title: 'title_1'}]}, =>
@.set 'sid-2', {recent_Articles: [{id: 'id_2', title: 'title_2'}]}, =>
@.set 'sid-3', {recent_Articles: [{id: 'id_3', title: 'title_3'}]}, =>
@.set 'sid-4', {recent_Articles: [{id: 'id_4', title: 'title_4'}]}, =>
@.db.find {}, (err,sessionData)=>
sessionData.size().assert_Is_Bigger_Than 3
@.viewed_Articles (data)->
data.json_Str().assert_Contains ['id_1','id_2', 'id_3', 'id_4','title_1','title_2', 'title_3', 'title_4']
done()
it 'viewed_Articles (default)', (done)->
using session_Service,->
@.viewed_Articles (data)=>
data.assert_Is @.DEFAULT_ARTICLES
done()
describe 'testing behaviour of express-session', ()->
app = null
testValue = 'this is a session value';
sessionAsJson = '{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"}}';
before ()-> # recrete the config used on server.js and add a couple test routes
app = express()
options =
secret : '<KEY>'
saveUninitialized: true
resave : true
app.use session(options)
middleware = (req,res,next)->
req.session.value = testValue;
next()
app.get '/session_values' , (req,res)-> res.send req.session
app.get '/session_get_userId' , middleware, (req,res)-> res.send req.session.value
it 'Check default session values', (done)->
supertest(app).get '/session_values'
.expect 200,sessionAsJson, done
it 'Check specific session value', (done)->
supertest(app).get '/session_get_userId'
.expect 200,testValue, done | true | Session_Service = require('../../src/services/Session-Service')
session = require('express-session')
express = require 'express'
supertest = require 'supertest'
describe '| services | Session.test', ()->
testDb = './_session_TestDb'
session_Service = null
beforeEach ()->
session_Service = new Session_Service { filename: testDb }
session_Service.setup()
afterEach ()->
if testDb.file_Exists()
testDb.file_Delete().assert_Is_True()
it 'constructor (no params)',->
using new Session_Service(),->
@.filename.assert_Is './.tmCache/_sessionData'
it 'get,set', (done)->
key = 'PI:KEY:<KEY>END_PI
session_data = { value: key, expire: new Date() }
using session_Service,->
@.set key, session_data, (err)=>
assert_Is_Null(err);
@.get key, (err, data)->
assert_Is_Null(err);
data.assert_Is(session_data)
done();
it 'destroy', (done)->
key = 'PI:KEY:<KEY>END_PI
session_data = { value: key, expire: new Date() }
session_Service.set key, session_data, (err)->
assert_Is_Null(err);
session_Service.get key, (err, data)->
assert_Is_Null(err);
data.assert_Is(session_data)
session_Service.destroy key, (err)->
assert_Is_Null(err);
session_Service.get key, (err, data)->
assert_Is_Null(err);
assert_Is_Null(data);
done()
it 'users_Searches (default values)', (done)->
using session_Service,->
@.set 'sid-1', {recent_Articles: [{id: 'id_1', title: 'title_1'}]}, =>
@.users_Searches (result)=>
result.assert_Is session_Service.DEFAULT_SEARCHES
done()
it 'users_Searches', (done)->
using session_Service,->
@.set 'sid-1', {user_Searches: [{ id :'abc1', title: 'search a' , results:11},
{ id :'abc2', title: 'search b' , results:12},
{ id :'abc2', title: 'search b' , results:13}
{ id :'abc3', title: 'search c' , results:0}]}, =>
@.users_Searches (result)=>
result.assert_Size_Is_Bigger_Than 5
if result.size() is 6
result.fourth().assert_Is { id :'abc1', title: 'search a' , results:11}
done()
it 'viewed_Articles', (done)->
using session_Service,->
@.set 'sid-1', {recent_Articles: [{id: 'id_1', title: 'title_1'}]}, =>
@.set 'sid-2', {recent_Articles: [{id: 'id_2', title: 'title_2'}]}, =>
@.set 'sid-3', {recent_Articles: [{id: 'id_3', title: 'title_3'}]}, =>
@.set 'sid-4', {recent_Articles: [{id: 'id_4', title: 'title_4'}]}, =>
@.db.find {}, (err,sessionData)=>
sessionData.size().assert_Is_Bigger_Than 3
@.viewed_Articles (data)->
data.json_Str().assert_Contains ['id_1','id_2', 'id_3', 'id_4','title_1','title_2', 'title_3', 'title_4']
done()
it 'viewed_Articles (default)', (done)->
using session_Service,->
@.viewed_Articles (data)=>
data.assert_Is @.DEFAULT_ARTICLES
done()
describe 'testing behaviour of express-session', ()->
app = null
testValue = 'this is a session value';
sessionAsJson = '{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"}}';
before ()-> # recrete the config used on server.js and add a couple test routes
app = express()
options =
secret : 'PI:KEY:<KEY>END_PI'
saveUninitialized: true
resave : true
app.use session(options)
middleware = (req,res,next)->
req.session.value = testValue;
next()
app.get '/session_values' , (req,res)-> res.send req.session
app.get '/session_get_userId' , middleware, (req,res)-> res.send req.session.value
it 'Check default session values', (done)->
supertest(app).get '/session_values'
.expect 200,sessionAsJson, done
it 'Check specific session value', (done)->
supertest(app).get '/session_get_userId'
.expect 200,testValue, done |
[
{
"context": " process.env.HUBOT_HOME_ASSISTANT_API_PASSWORD='foobar'\n process.env.HUBOT_HOME_ASSISTANT_MONITOR_EVE",
"end": 549,
"score": 0.998827338218689,
"start": 543,
"tag": "PASSWORD",
"value": "foobar"
}
] | test/home-assistant_stream_test.coffee | pjmorr/hubot-home-assistant | 0 | Helper = require 'hubot-test-helper'
chai = require 'chai'
nock = require 'nock'
fs = require 'fs'
expect = chai.expect
helper = new Helper [
'../src/home-assistant-streaming.coffee'
]
# Alter time as test runs
originalDateNow = Date.now
mockDateNow = () ->
return Date.parse('Fri Jun 22 2018 17:14:09 GMT-0500 (CDT)')
describe 'home-assistant streaming', ->
beforeEach ->
process.env.HUBOT_LOG_LEVEL='error'
process.env.HUBOT_HOME_ASSISTANT_HOST='http://hassio.local:8123'
process.env.HUBOT_HOME_ASSISTANT_API_PASSWORD='foobar'
process.env.HUBOT_HOME_ASSISTANT_MONITOR_EVENTS='true'
process.env.HUBOT_HOME_ASSISTANT_EVENTS_DESTINATION='room1'
process.env.HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES='true'
Date.now = mockDateNow
nock.disableNetConnect()
@room = helper.createRoom(httpd: false)
afterEach ->
delete process.env.HUBOT_LOG_LEVEL
delete process.env.HUBOT_HOME_ASSISTANT_HOST
delete process.env.HUBOT_HOME_ASSISTANT_API_PASSWORD
delete process.env.HUBOT_HOME_ASSISTANT_MONITOR_EVENTS
delete process.env.HUBOT_HOME_ASSISTANT_EVENTS_DESTINATION
delete process.env.HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES
Date.now = originalDateNow
nock.cleanAll()
@room.destroy()
it 'receives a series of streamed events', (done) ->
# SKIP: Not yet implemented (trouble with emulating EventSource call)
return this.skip()
nock('http://hassio.local:8123')
.get('/api/stream')
.reply(200, (uri, requestBody) ->
fs.createReadStream(__dirname + '/fixtures/stream.txt')
)
selfRoom = @room
setTimeout(() ->
try
expect(selfRoom.messages).to.eql [
# ['hubot', '']
]
done()
catch err
done err
return
, 1000)
| 119251 | Helper = require 'hubot-test-helper'
chai = require 'chai'
nock = require 'nock'
fs = require 'fs'
expect = chai.expect
helper = new Helper [
'../src/home-assistant-streaming.coffee'
]
# Alter time as test runs
originalDateNow = Date.now
mockDateNow = () ->
return Date.parse('Fri Jun 22 2018 17:14:09 GMT-0500 (CDT)')
describe 'home-assistant streaming', ->
beforeEach ->
process.env.HUBOT_LOG_LEVEL='error'
process.env.HUBOT_HOME_ASSISTANT_HOST='http://hassio.local:8123'
process.env.HUBOT_HOME_ASSISTANT_API_PASSWORD='<PASSWORD>'
process.env.HUBOT_HOME_ASSISTANT_MONITOR_EVENTS='true'
process.env.HUBOT_HOME_ASSISTANT_EVENTS_DESTINATION='room1'
process.env.HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES='true'
Date.now = mockDateNow
nock.disableNetConnect()
@room = helper.createRoom(httpd: false)
afterEach ->
delete process.env.HUBOT_LOG_LEVEL
delete process.env.HUBOT_HOME_ASSISTANT_HOST
delete process.env.HUBOT_HOME_ASSISTANT_API_PASSWORD
delete process.env.HUBOT_HOME_ASSISTANT_MONITOR_EVENTS
delete process.env.HUBOT_HOME_ASSISTANT_EVENTS_DESTINATION
delete process.env.HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES
Date.now = originalDateNow
nock.cleanAll()
@room.destroy()
it 'receives a series of streamed events', (done) ->
# SKIP: Not yet implemented (trouble with emulating EventSource call)
return this.skip()
nock('http://hassio.local:8123')
.get('/api/stream')
.reply(200, (uri, requestBody) ->
fs.createReadStream(__dirname + '/fixtures/stream.txt')
)
selfRoom = @room
setTimeout(() ->
try
expect(selfRoom.messages).to.eql [
# ['hubot', '']
]
done()
catch err
done err
return
, 1000)
| true | Helper = require 'hubot-test-helper'
chai = require 'chai'
nock = require 'nock'
fs = require 'fs'
expect = chai.expect
helper = new Helper [
'../src/home-assistant-streaming.coffee'
]
# Alter time as test runs
originalDateNow = Date.now
mockDateNow = () ->
return Date.parse('Fri Jun 22 2018 17:14:09 GMT-0500 (CDT)')
describe 'home-assistant streaming', ->
beforeEach ->
process.env.HUBOT_LOG_LEVEL='error'
process.env.HUBOT_HOME_ASSISTANT_HOST='http://hassio.local:8123'
process.env.HUBOT_HOME_ASSISTANT_API_PASSWORD='PI:PASSWORD:<PASSWORD>END_PI'
process.env.HUBOT_HOME_ASSISTANT_MONITOR_EVENTS='true'
process.env.HUBOT_HOME_ASSISTANT_EVENTS_DESTINATION='room1'
process.env.HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES='true'
Date.now = mockDateNow
nock.disableNetConnect()
@room = helper.createRoom(httpd: false)
afterEach ->
delete process.env.HUBOT_LOG_LEVEL
delete process.env.HUBOT_HOME_ASSISTANT_HOST
delete process.env.HUBOT_HOME_ASSISTANT_API_PASSWORD
delete process.env.HUBOT_HOME_ASSISTANT_MONITOR_EVENTS
delete process.env.HUBOT_HOME_ASSISTANT_EVENTS_DESTINATION
delete process.env.HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES
Date.now = originalDateNow
nock.cleanAll()
@room.destroy()
it 'receives a series of streamed events', (done) ->
# SKIP: Not yet implemented (trouble with emulating EventSource call)
return this.skip()
nock('http://hassio.local:8123')
.get('/api/stream')
.reply(200, (uri, requestBody) ->
fs.createReadStream(__dirname + '/fixtures/stream.txt')
)
selfRoom = @room
setTimeout(() ->
try
expect(selfRoom.messages).to.eql [
# ['hubot', '']
]
done()
catch err
done err
return
, 1000)
|
[
{
"context": "wn()\n\n beforeEach ->\n @partner = {\n id: \"soze-gallery\",\n name: \"Soze Gallery\",\n initials: \"SG",
"end": 670,
"score": 0.9512985944747925,
"start": 658,
"tag": "USERNAME",
"value": "soze-gallery"
},
{
"context": "artner = {\n id: \"soze-gallery\",\n name: \"Soze Gallery\",\n initials: \"SG\",\n locations: [{ city:",
"end": 698,
"score": 0.9995352625846863,
"start": 686,
"tag": "NAME",
"value": "Soze Gallery"
},
{
"context": " city: \"New York\" }],\n profile:\n id: \"soze-gallery\",\n href: \"/soze-gallery\",\n ",
"end": 821,
"score": 0.6589704155921936,
"start": 817,
"tag": "USERNAME",
"value": "soze"
},
{
"context": ": \"New York\" }],\n profile:\n id: \"soze-gallery\",\n href: \"/soze-gallery\",\n image: c",
"end": 829,
"score": 0.6977999806404114,
"start": 822,
"tag": "USERNAME",
"value": "gallery"
}
] | src/desktop/apps/galleries_institutions/components/partner_cell/test/view.test.coffee | jo-rs/force | 0 | benv = require 'benv'
sinon = require 'sinon'
Backbone = require 'backbone'
{ fabricate } = require '@artsy/antigravity'
Partner = require '../../../../../models/partner'
PartnerCellView = benv.requireWithJadeify require.resolve('../view'), ['template']
PartnerCellView.__set__ 'Cities', [{"slug": "new-york-ny-usa", "name": "New York", "full_name": "New York, NY, USA", "coords": [40.71, -74.01 ] }]
describe 'PartnerCellView', ->
before (done) ->
benv.setup ->
benv.expose $: benv.require('jquery'), jQuery: benv.require('jquery')
Backbone.$ = $
done()
after ->
benv.teardown()
beforeEach ->
@partner = {
id: "soze-gallery",
name: "Soze Gallery",
initials: "SG",
locations: [{ city: "Los Angeles" }, { city: "New York" }],
profile:
id: "soze-gallery",
href: "/soze-gallery",
image: cropped: url: "/something.jpeg"
}
describe '#render', ->
it 'renders partner data', ->
@view = new PartnerCellView partner: @partner
@view.render()
@view.$('.partner-cell-name').text().should.equal 'Soze Gallery'
@view.$('.partner-cell-follow-button').data('id').should.equal 'soze-gallery'
@view.$('.partner-featured-image').attr('href').should.equal '/soze-gallery'
@view.$('.partner-cell-name').attr('href').should.equal '/soze-gallery'
@view.$('.hoverable-image').data('initials').should.equal 'SG'
describe 'with an image', ->
beforeEach ->
@view = new PartnerCellView partner: @partner
@view.render()
it 'sets the class', ->
@view.$('.hoverable-image').hasClass('is-missing').should.be.false()
it 'sets background image', ->
@view.$('.hoverable-image').attr('style').should.containEql 'background-image: url(/something.jpeg)'
describe 'without an image', ->
beforeEach ->
@partner.profile.image = {}
@view = new PartnerCellView partner: @partner
@view.render()
it 'sets the class', ->
@view.$('.hoverable-image').hasClass('is-missing').should.be.true()
it 'does not set background image', ->
@view.$('.hoverable-image').is('style').should.be.false()
describe 'preferred city', ->
it 'lists preferred city first if gallery location matches', ->
@view = new PartnerCellView partner: @partner, preferredCitySlug: 'new-york-ny-usa'
@view.render()
@view.$('.partner-cell-location').text().should.equal 'New York & 1 other location'
it 'lists first location first if gallery location does not match', ->
@view = new PartnerCellView partner: @partner, preferredCitySlug: 'tokyo'
@view.render()
@view.$('.partner-cell-location').text().should.equal 'Los Angeles & 1 other location'
it 'lists first location first if no peferred city provided', ->
@view = new PartnerCellView partner: @partner
@view.render()
@view.$('.partner-cell-location').text().should.equal 'Los Angeles & 1 other location'
| 169728 | benv = require 'benv'
sinon = require 'sinon'
Backbone = require 'backbone'
{ fabricate } = require '@artsy/antigravity'
Partner = require '../../../../../models/partner'
PartnerCellView = benv.requireWithJadeify require.resolve('../view'), ['template']
PartnerCellView.__set__ 'Cities', [{"slug": "new-york-ny-usa", "name": "New York", "full_name": "New York, NY, USA", "coords": [40.71, -74.01 ] }]
describe 'PartnerCellView', ->
before (done) ->
benv.setup ->
benv.expose $: benv.require('jquery'), jQuery: benv.require('jquery')
Backbone.$ = $
done()
after ->
benv.teardown()
beforeEach ->
@partner = {
id: "soze-gallery",
name: "<NAME>",
initials: "SG",
locations: [{ city: "Los Angeles" }, { city: "New York" }],
profile:
id: "soze-gallery",
href: "/soze-gallery",
image: cropped: url: "/something.jpeg"
}
describe '#render', ->
it 'renders partner data', ->
@view = new PartnerCellView partner: @partner
@view.render()
@view.$('.partner-cell-name').text().should.equal 'Soze Gallery'
@view.$('.partner-cell-follow-button').data('id').should.equal 'soze-gallery'
@view.$('.partner-featured-image').attr('href').should.equal '/soze-gallery'
@view.$('.partner-cell-name').attr('href').should.equal '/soze-gallery'
@view.$('.hoverable-image').data('initials').should.equal 'SG'
describe 'with an image', ->
beforeEach ->
@view = new PartnerCellView partner: @partner
@view.render()
it 'sets the class', ->
@view.$('.hoverable-image').hasClass('is-missing').should.be.false()
it 'sets background image', ->
@view.$('.hoverable-image').attr('style').should.containEql 'background-image: url(/something.jpeg)'
describe 'without an image', ->
beforeEach ->
@partner.profile.image = {}
@view = new PartnerCellView partner: @partner
@view.render()
it 'sets the class', ->
@view.$('.hoverable-image').hasClass('is-missing').should.be.true()
it 'does not set background image', ->
@view.$('.hoverable-image').is('style').should.be.false()
describe 'preferred city', ->
it 'lists preferred city first if gallery location matches', ->
@view = new PartnerCellView partner: @partner, preferredCitySlug: 'new-york-ny-usa'
@view.render()
@view.$('.partner-cell-location').text().should.equal 'New York & 1 other location'
it 'lists first location first if gallery location does not match', ->
@view = new PartnerCellView partner: @partner, preferredCitySlug: 'tokyo'
@view.render()
@view.$('.partner-cell-location').text().should.equal 'Los Angeles & 1 other location'
it 'lists first location first if no peferred city provided', ->
@view = new PartnerCellView partner: @partner
@view.render()
@view.$('.partner-cell-location').text().should.equal 'Los Angeles & 1 other location'
| true | benv = require 'benv'
sinon = require 'sinon'
Backbone = require 'backbone'
{ fabricate } = require '@artsy/antigravity'
Partner = require '../../../../../models/partner'
PartnerCellView = benv.requireWithJadeify require.resolve('../view'), ['template']
PartnerCellView.__set__ 'Cities', [{"slug": "new-york-ny-usa", "name": "New York", "full_name": "New York, NY, USA", "coords": [40.71, -74.01 ] }]
describe 'PartnerCellView', ->
before (done) ->
benv.setup ->
benv.expose $: benv.require('jquery'), jQuery: benv.require('jquery')
Backbone.$ = $
done()
after ->
benv.teardown()
beforeEach ->
@partner = {
id: "soze-gallery",
name: "PI:NAME:<NAME>END_PI",
initials: "SG",
locations: [{ city: "Los Angeles" }, { city: "New York" }],
profile:
id: "soze-gallery",
href: "/soze-gallery",
image: cropped: url: "/something.jpeg"
}
describe '#render', ->
it 'renders partner data', ->
@view = new PartnerCellView partner: @partner
@view.render()
@view.$('.partner-cell-name').text().should.equal 'Soze Gallery'
@view.$('.partner-cell-follow-button').data('id').should.equal 'soze-gallery'
@view.$('.partner-featured-image').attr('href').should.equal '/soze-gallery'
@view.$('.partner-cell-name').attr('href').should.equal '/soze-gallery'
@view.$('.hoverable-image').data('initials').should.equal 'SG'
describe 'with an image', ->
beforeEach ->
@view = new PartnerCellView partner: @partner
@view.render()
it 'sets the class', ->
@view.$('.hoverable-image').hasClass('is-missing').should.be.false()
it 'sets background image', ->
@view.$('.hoverable-image').attr('style').should.containEql 'background-image: url(/something.jpeg)'
describe 'without an image', ->
beforeEach ->
@partner.profile.image = {}
@view = new PartnerCellView partner: @partner
@view.render()
it 'sets the class', ->
@view.$('.hoverable-image').hasClass('is-missing').should.be.true()
it 'does not set background image', ->
@view.$('.hoverable-image').is('style').should.be.false()
describe 'preferred city', ->
it 'lists preferred city first if gallery location matches', ->
@view = new PartnerCellView partner: @partner, preferredCitySlug: 'new-york-ny-usa'
@view.render()
@view.$('.partner-cell-location').text().should.equal 'New York & 1 other location'
it 'lists first location first if gallery location does not match', ->
@view = new PartnerCellView partner: @partner, preferredCitySlug: 'tokyo'
@view.render()
@view.$('.partner-cell-location').text().should.equal 'Los Angeles & 1 other location'
it 'lists first location first if no peferred city provided', ->
@view = new PartnerCellView partner: @partner
@view.render()
@view.$('.partner-cell-location').text().should.equal 'Los Angeles & 1 other location'
|
[
{
"context": "# Copyright Joyent, Inc. and other Node contributors.\n#\n# Permission",
"end": 18,
"score": 0.9991774559020996,
"start": 12,
"tag": "NAME",
"value": "Joyent"
}
] | test/pummel/test-net-connect-econnrefused.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.
# verify that connect reqs are properly cleaned up
pummel = ->
console.log "Round", rounds, "/", ROUNDS
pending = 0
while pending < ATTEMPTS_PER_ROUND
net.createConnection(common.PORT).on "error", (err) ->
assert.equal err.code, "ECONNREFUSED"
return if --pending > 0
return check() if rounds is ROUNDS
rounds++
pummel()
return
reqs++
pending++
return
check = ->
setTimeout (->
assert.equal process._getActiveRequests().length, 0
assert.equal process._getActiveHandles().length, 1 # the timer
check_called = true
return
), 0
return
common = require("../common")
assert = require("assert")
net = require("net")
ROUNDS = 10
ATTEMPTS_PER_ROUND = 100
rounds = 1
reqs = 0
pummel()
check_called = false
process.on "exit", ->
assert.equal rounds, ROUNDS
assert.equal reqs, ROUNDS * ATTEMPTS_PER_ROUND
assert check_called
return
| 124159 | # 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.
# verify that connect reqs are properly cleaned up
pummel = ->
console.log "Round", rounds, "/", ROUNDS
pending = 0
while pending < ATTEMPTS_PER_ROUND
net.createConnection(common.PORT).on "error", (err) ->
assert.equal err.code, "ECONNREFUSED"
return if --pending > 0
return check() if rounds is ROUNDS
rounds++
pummel()
return
reqs++
pending++
return
check = ->
setTimeout (->
assert.equal process._getActiveRequests().length, 0
assert.equal process._getActiveHandles().length, 1 # the timer
check_called = true
return
), 0
return
common = require("../common")
assert = require("assert")
net = require("net")
ROUNDS = 10
ATTEMPTS_PER_ROUND = 100
rounds = 1
reqs = 0
pummel()
check_called = false
process.on "exit", ->
assert.equal rounds, ROUNDS
assert.equal reqs, ROUNDS * ATTEMPTS_PER_ROUND
assert check_called
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.
# verify that connect reqs are properly cleaned up
pummel = ->
console.log "Round", rounds, "/", ROUNDS
pending = 0
while pending < ATTEMPTS_PER_ROUND
net.createConnection(common.PORT).on "error", (err) ->
assert.equal err.code, "ECONNREFUSED"
return if --pending > 0
return check() if rounds is ROUNDS
rounds++
pummel()
return
reqs++
pending++
return
check = ->
setTimeout (->
assert.equal process._getActiveRequests().length, 0
assert.equal process._getActiveHandles().length, 1 # the timer
check_called = true
return
), 0
return
common = require("../common")
assert = require("assert")
net = require("net")
ROUNDS = 10
ATTEMPTS_PER_ROUND = 100
rounds = 1
reqs = 0
pummel()
check_called = false
process.on "exit", ->
assert.equal rounds, ROUNDS
assert.equal reqs, ROUNDS * ATTEMPTS_PER_ROUND
assert check_called
return
|
[
{
"context": "ttp://ralphcrisostomo.net\n *\n * Copyright (c) 2014 Ralph Crisostomo\n * Licensed under the MIT license.\n###\n\n'use stri",
"end": 101,
"score": 0.9998900294303894,
"start": 85,
"tag": "NAME",
"value": "Ralph Crisostomo"
},
{
"context": "\n \"coffee-script\": \"^1.9.2\"\n \"gulp\": \"^3.8.11\"\n \"gulp-chmod\": \"^1.2.0\"\n \"gulp-clean\":",
"end": 1811,
"score": 0.8809491991996765,
"start": 1807,
"tag": "IP_ADDRESS",
"value": "8.11"
}
] | root/template.coffee | ralphcrisostomo/grunt-init-grunt-init | 0 | ###
* grunt-init-{%= name %}
* http://ralphcrisostomo.net
*
* Copyright (c) 2014 Ralph Crisostomo
* Licensed under the MIT license.
###
'use strict'
# Basic template description.
exports.description = 'Create a Node.js module including Nodeunit unit tests.'
# Template-specific notes to be displayed before question prompts.
exports.notes = '_Project name_ shouldn\'t contain "node" or "js" and should ' +
'be a unique ID not already in use at search.npmjs.org.'
# Template-specific notes to be displayed after question prompts.
exports.after = 'You should now install project dependencies with _npm ' +
'install_. After that you may execute project tasks with _grunt_. For ' +
'more information about installing and configuring Grunt please see ' +
'the Getting Started guide:' +
'\n\n' +
'http:#gruntjs.com/getting-started'
# Any existing file or directory matching this wildcard will cause a warning.
exports.warnOn = '*'
# The actual init template.
exports.template = (grunt, init, done) ->
# Underscore utilities
_ = grunt.util._
init.process {type: 'node'}, [
# Prompt for these values.
init.prompt('name')
init.prompt('description')
init.prompt('version')
init.prompt('repository')
init.prompt('homepage')
init.prompt('bugs')
init.prompt('licenses')
init.prompt('author_name')
init.prompt('author_email')
init.prompt('author_url')
init.prompt('node_version', '>= 0.12.0')
], (err, props) ->
props.bin = {}
props.bin["#{props.name}"] = "./build/bin/#{props.name}"
props.main = './build/lib/main'
props.keywords = []
props.preferGlobal = true
props.dependencies =
"commander": "^2.8.1"
props.devDependencies =
"chai": "^2.3.0"
"coffee-script": "^1.9.2"
"gulp": "^3.8.11"
"gulp-chmod": "^1.2.0"
"gulp-clean": "^0.3.1"
"gulp-coffee": "^2.3.1"
"gulp-coffeelint": "^0.4.0"
"gulp-insert": "^0.4.0"
"gulp-mocha": "^2.0.1"
"gulp-rename": "^1.2.2"
"gulp-uglify": "^1.2.0"
"run-sequence": "^1.1.0"
# Files to copy (and process).
files = init.filesToCopy(props)
# Add properly-named license files.
init.addLicenseFiles(files, props.licenses)
# Actually copy (and process) files.
init.copyAndProcess(files, props)
# Generate package.json file.
init.writePackageJSON 'package.json', props, (pkg, props) ->
pkg['scripts'] =
test: 'gulp test'
#postinstall: 'git flow init && git add . && git commit -am "init commit"'
pkg
# All done!
done()
| 125439 | ###
* grunt-init-{%= name %}
* http://ralphcrisostomo.net
*
* Copyright (c) 2014 <NAME>
* Licensed under the MIT license.
###
'use strict'
# Basic template description.
exports.description = 'Create a Node.js module including Nodeunit unit tests.'
# Template-specific notes to be displayed before question prompts.
exports.notes = '_Project name_ shouldn\'t contain "node" or "js" and should ' +
'be a unique ID not already in use at search.npmjs.org.'
# Template-specific notes to be displayed after question prompts.
exports.after = 'You should now install project dependencies with _npm ' +
'install_. After that you may execute project tasks with _grunt_. For ' +
'more information about installing and configuring Grunt please see ' +
'the Getting Started guide:' +
'\n\n' +
'http:#gruntjs.com/getting-started'
# Any existing file or directory matching this wildcard will cause a warning.
exports.warnOn = '*'
# The actual init template.
exports.template = (grunt, init, done) ->
# Underscore utilities
_ = grunt.util._
init.process {type: 'node'}, [
# Prompt for these values.
init.prompt('name')
init.prompt('description')
init.prompt('version')
init.prompt('repository')
init.prompt('homepage')
init.prompt('bugs')
init.prompt('licenses')
init.prompt('author_name')
init.prompt('author_email')
init.prompt('author_url')
init.prompt('node_version', '>= 0.12.0')
], (err, props) ->
props.bin = {}
props.bin["#{props.name}"] = "./build/bin/#{props.name}"
props.main = './build/lib/main'
props.keywords = []
props.preferGlobal = true
props.dependencies =
"commander": "^2.8.1"
props.devDependencies =
"chai": "^2.3.0"
"coffee-script": "^1.9.2"
"gulp": "^3.8.11"
"gulp-chmod": "^1.2.0"
"gulp-clean": "^0.3.1"
"gulp-coffee": "^2.3.1"
"gulp-coffeelint": "^0.4.0"
"gulp-insert": "^0.4.0"
"gulp-mocha": "^2.0.1"
"gulp-rename": "^1.2.2"
"gulp-uglify": "^1.2.0"
"run-sequence": "^1.1.0"
# Files to copy (and process).
files = init.filesToCopy(props)
# Add properly-named license files.
init.addLicenseFiles(files, props.licenses)
# Actually copy (and process) files.
init.copyAndProcess(files, props)
# Generate package.json file.
init.writePackageJSON 'package.json', props, (pkg, props) ->
pkg['scripts'] =
test: 'gulp test'
#postinstall: 'git flow init && git add . && git commit -am "init commit"'
pkg
# All done!
done()
| true | ###
* grunt-init-{%= name %}
* http://ralphcrisostomo.net
*
* Copyright (c) 2014 PI:NAME:<NAME>END_PI
* Licensed under the MIT license.
###
'use strict'
# Basic template description.
exports.description = 'Create a Node.js module including Nodeunit unit tests.'
# Template-specific notes to be displayed before question prompts.
exports.notes = '_Project name_ shouldn\'t contain "node" or "js" and should ' +
'be a unique ID not already in use at search.npmjs.org.'
# Template-specific notes to be displayed after question prompts.
exports.after = 'You should now install project dependencies with _npm ' +
'install_. After that you may execute project tasks with _grunt_. For ' +
'more information about installing and configuring Grunt please see ' +
'the Getting Started guide:' +
'\n\n' +
'http:#gruntjs.com/getting-started'
# Any existing file or directory matching this wildcard will cause a warning.
exports.warnOn = '*'
# The actual init template.
exports.template = (grunt, init, done) ->
# Underscore utilities
_ = grunt.util._
init.process {type: 'node'}, [
# Prompt for these values.
init.prompt('name')
init.prompt('description')
init.prompt('version')
init.prompt('repository')
init.prompt('homepage')
init.prompt('bugs')
init.prompt('licenses')
init.prompt('author_name')
init.prompt('author_email')
init.prompt('author_url')
init.prompt('node_version', '>= 0.12.0')
], (err, props) ->
props.bin = {}
props.bin["#{props.name}"] = "./build/bin/#{props.name}"
props.main = './build/lib/main'
props.keywords = []
props.preferGlobal = true
props.dependencies =
"commander": "^2.8.1"
props.devDependencies =
"chai": "^2.3.0"
"coffee-script": "^1.9.2"
"gulp": "^3.8.11"
"gulp-chmod": "^1.2.0"
"gulp-clean": "^0.3.1"
"gulp-coffee": "^2.3.1"
"gulp-coffeelint": "^0.4.0"
"gulp-insert": "^0.4.0"
"gulp-mocha": "^2.0.1"
"gulp-rename": "^1.2.2"
"gulp-uglify": "^1.2.0"
"run-sequence": "^1.1.0"
# Files to copy (and process).
files = init.filesToCopy(props)
# Add properly-named license files.
init.addLicenseFiles(files, props.licenses)
# Actually copy (and process) files.
init.copyAndProcess(files, props)
# Generate package.json file.
init.writePackageJSON 'package.json', props, (pkg, props) ->
pkg['scripts'] =
test: 'gulp test'
#postinstall: 'git flow init && git add . && git commit -am "init commit"'
pkg
# All done!
done()
|
[
{
"context": "ername\n return false unless user?.password is password\n\n ## response a access token\n token = @",
"end": 2069,
"score": 0.994118332862854,
"start": 2061,
"tag": "PASSWORD",
"value": "password"
}
] | example/mongo/mongo-provider.coffee | tungv/oauth2-provider | 2 | Provider = require 't-oauth2-provider'
mongoose = require 'mongoose'
fibrous = require 'fibrous'
require './model/grant.coffee'
require './model/access-token.coffee'
class MongoOAuthProvider extends Provider
constructor: (config) ->
@db =
user: mongoose.model 'user'
client: mongoose.model 'client'
grant: mongoose.model 'grant'
accessToken: mongoose.model 'accessToken'
@exchangeMethods = ['basic', 'oauth2-client-password']
super config, {passport: require 'passport'}
## this should be rewrite as an external module
getCode: (length)-> Provider.uid(length)
issueGrantCode: (client, redirectURI, user, ares, callback) ->
code = @getCode(16)
grant = new @db.grant {
code
redirectURI
client: client.id
user: user.id
}
grant.save (err)->
return callback err if err
callback null, code
issueImplicitToken: (client, user, ares, callback) ->
code = @getCode(32)
accessToken = new @db.accessToken {
token: code
client: client.clientId
user: user.id
}
accessToken.save (err)->
return callback err if err
callback null, code
exchangeCodeForToken: (client, code, redirectURI, done) ->
@db.grant.findOne {code}, (err, grant)=>
return done err if err
return done err, false if client.id isnt grant.client or redirectURI isnt grant.redirectURI
token = @getCode()
accessToken = new @db.accessToken {
token
user: grant.user
client: grant.client
}
accessToken.save (err)->
return done err if err
done null, token
exchangePasswordForToken: (client, username, password, scope, done) ->
fibrous.run =>
## validating client
clientId = client.clientId
clientSecret = client.clientSecret
localClient = @db.client.sync.find clientId
return false unless localClient?.clientSecret is clientSecret
## validating user
user = @db.user.sync.find username
return false unless user?.password is password
## response a access token
token = @getCode()
accessToken = new @db.accessToken {
token
user: user.id
client: clientId
}
accessToken.save()
return token
, done
findClient: (clientId, redirectURI, cb)->
@db.client.findOne {clientId}, (err, client)->
return cb err if err
## WARNING: For security purposes, it is highly advisable to check that
## redirectURI provided by the client matches one registered with
## the server. For simplicity, this example does not. You have
## been warned.
cb null, client, redirectURI
validateUser: (username, password, done)->
fibrous.run ()->
## password must be provided
return false unless password
user = mongoose.model('user').sync.findOne {username}
return false if user?.password isnt password
return user
, done
validateClient: (clientId, clientSecret, done)->
fibrous.run ()->
## clientSecret must be provided
return false unless clientSecret
client = mongoose.model('client').sync.findOne {clientId}
return false if client?.clientSecret isnt clientSecret
return client
, done
validateToken: (accessToken, done)->
fibrous.run ->
token = mongoose.model('accessToken').sync.findOne {token: accessToken}
## invalid or expired token
return false unless token
## token provided to a user (via login)
if token.user?
user = mongoose.model('user').sync.findById token.user
## invalid user (user might be removed since login)
return false unless user
## to keep this example simple, restricted scopes are not implemented,
## and this is just for illustrative purposes
return [user, scope:'*']
## token provided to a client (consumer)
client = mongoose.model('client').sync.findById token.client
return false unless client
## to keep this example simple, restricted scopes are not implemented,
## and this is just for illustrative purposes
return [client, scope:'*']
, (err, data)->
return done err if err
return done null, data if typeof data is 'Boolean'
return done null, data[0], data[1]
## serialize client into session storage (can be overwrite)
serializeClient: (client, done)-> done null, client.id
## deserialize client from session storage (can be overwrite)
deserializeClient: (id, done)->
## get client (consumer)
@db.client.findById id, (err, client)->
return done err if err
done null, client
serializeUser: (user, done) ->
done null, user.id
return
deserializeUser: (id, done) ->
mongoose.model('user').findById id, (err, user) ->
done err, user
return
module.exports = MongoOAuthProvider | 106348 | Provider = require 't-oauth2-provider'
mongoose = require 'mongoose'
fibrous = require 'fibrous'
require './model/grant.coffee'
require './model/access-token.coffee'
class MongoOAuthProvider extends Provider
constructor: (config) ->
@db =
user: mongoose.model 'user'
client: mongoose.model 'client'
grant: mongoose.model 'grant'
accessToken: mongoose.model 'accessToken'
@exchangeMethods = ['basic', 'oauth2-client-password']
super config, {passport: require 'passport'}
## this should be rewrite as an external module
getCode: (length)-> Provider.uid(length)
issueGrantCode: (client, redirectURI, user, ares, callback) ->
code = @getCode(16)
grant = new @db.grant {
code
redirectURI
client: client.id
user: user.id
}
grant.save (err)->
return callback err if err
callback null, code
issueImplicitToken: (client, user, ares, callback) ->
code = @getCode(32)
accessToken = new @db.accessToken {
token: code
client: client.clientId
user: user.id
}
accessToken.save (err)->
return callback err if err
callback null, code
exchangeCodeForToken: (client, code, redirectURI, done) ->
@db.grant.findOne {code}, (err, grant)=>
return done err if err
return done err, false if client.id isnt grant.client or redirectURI isnt grant.redirectURI
token = @getCode()
accessToken = new @db.accessToken {
token
user: grant.user
client: grant.client
}
accessToken.save (err)->
return done err if err
done null, token
exchangePasswordForToken: (client, username, password, scope, done) ->
fibrous.run =>
## validating client
clientId = client.clientId
clientSecret = client.clientSecret
localClient = @db.client.sync.find clientId
return false unless localClient?.clientSecret is clientSecret
## validating user
user = @db.user.sync.find username
return false unless user?.password is <PASSWORD>
## response a access token
token = @getCode()
accessToken = new @db.accessToken {
token
user: user.id
client: clientId
}
accessToken.save()
return token
, done
findClient: (clientId, redirectURI, cb)->
@db.client.findOne {clientId}, (err, client)->
return cb err if err
## WARNING: For security purposes, it is highly advisable to check that
## redirectURI provided by the client matches one registered with
## the server. For simplicity, this example does not. You have
## been warned.
cb null, client, redirectURI
validateUser: (username, password, done)->
fibrous.run ()->
## password must be provided
return false unless password
user = mongoose.model('user').sync.findOne {username}
return false if user?.password isnt password
return user
, done
validateClient: (clientId, clientSecret, done)->
fibrous.run ()->
## clientSecret must be provided
return false unless clientSecret
client = mongoose.model('client').sync.findOne {clientId}
return false if client?.clientSecret isnt clientSecret
return client
, done
validateToken: (accessToken, done)->
fibrous.run ->
token = mongoose.model('accessToken').sync.findOne {token: accessToken}
## invalid or expired token
return false unless token
## token provided to a user (via login)
if token.user?
user = mongoose.model('user').sync.findById token.user
## invalid user (user might be removed since login)
return false unless user
## to keep this example simple, restricted scopes are not implemented,
## and this is just for illustrative purposes
return [user, scope:'*']
## token provided to a client (consumer)
client = mongoose.model('client').sync.findById token.client
return false unless client
## to keep this example simple, restricted scopes are not implemented,
## and this is just for illustrative purposes
return [client, scope:'*']
, (err, data)->
return done err if err
return done null, data if typeof data is 'Boolean'
return done null, data[0], data[1]
## serialize client into session storage (can be overwrite)
serializeClient: (client, done)-> done null, client.id
## deserialize client from session storage (can be overwrite)
deserializeClient: (id, done)->
## get client (consumer)
@db.client.findById id, (err, client)->
return done err if err
done null, client
serializeUser: (user, done) ->
done null, user.id
return
deserializeUser: (id, done) ->
mongoose.model('user').findById id, (err, user) ->
done err, user
return
module.exports = MongoOAuthProvider | true | Provider = require 't-oauth2-provider'
mongoose = require 'mongoose'
fibrous = require 'fibrous'
require './model/grant.coffee'
require './model/access-token.coffee'
class MongoOAuthProvider extends Provider
constructor: (config) ->
@db =
user: mongoose.model 'user'
client: mongoose.model 'client'
grant: mongoose.model 'grant'
accessToken: mongoose.model 'accessToken'
@exchangeMethods = ['basic', 'oauth2-client-password']
super config, {passport: require 'passport'}
## this should be rewrite as an external module
getCode: (length)-> Provider.uid(length)
issueGrantCode: (client, redirectURI, user, ares, callback) ->
code = @getCode(16)
grant = new @db.grant {
code
redirectURI
client: client.id
user: user.id
}
grant.save (err)->
return callback err if err
callback null, code
issueImplicitToken: (client, user, ares, callback) ->
code = @getCode(32)
accessToken = new @db.accessToken {
token: code
client: client.clientId
user: user.id
}
accessToken.save (err)->
return callback err if err
callback null, code
exchangeCodeForToken: (client, code, redirectURI, done) ->
@db.grant.findOne {code}, (err, grant)=>
return done err if err
return done err, false if client.id isnt grant.client or redirectURI isnt grant.redirectURI
token = @getCode()
accessToken = new @db.accessToken {
token
user: grant.user
client: grant.client
}
accessToken.save (err)->
return done err if err
done null, token
exchangePasswordForToken: (client, username, password, scope, done) ->
fibrous.run =>
## validating client
clientId = client.clientId
clientSecret = client.clientSecret
localClient = @db.client.sync.find clientId
return false unless localClient?.clientSecret is clientSecret
## validating user
user = @db.user.sync.find username
return false unless user?.password is PI:PASSWORD:<PASSWORD>END_PI
## response a access token
token = @getCode()
accessToken = new @db.accessToken {
token
user: user.id
client: clientId
}
accessToken.save()
return token
, done
findClient: (clientId, redirectURI, cb)->
@db.client.findOne {clientId}, (err, client)->
return cb err if err
## WARNING: For security purposes, it is highly advisable to check that
## redirectURI provided by the client matches one registered with
## the server. For simplicity, this example does not. You have
## been warned.
cb null, client, redirectURI
validateUser: (username, password, done)->
fibrous.run ()->
## password must be provided
return false unless password
user = mongoose.model('user').sync.findOne {username}
return false if user?.password isnt password
return user
, done
validateClient: (clientId, clientSecret, done)->
fibrous.run ()->
## clientSecret must be provided
return false unless clientSecret
client = mongoose.model('client').sync.findOne {clientId}
return false if client?.clientSecret isnt clientSecret
return client
, done
validateToken: (accessToken, done)->
fibrous.run ->
token = mongoose.model('accessToken').sync.findOne {token: accessToken}
## invalid or expired token
return false unless token
## token provided to a user (via login)
if token.user?
user = mongoose.model('user').sync.findById token.user
## invalid user (user might be removed since login)
return false unless user
## to keep this example simple, restricted scopes are not implemented,
## and this is just for illustrative purposes
return [user, scope:'*']
## token provided to a client (consumer)
client = mongoose.model('client').sync.findById token.client
return false unless client
## to keep this example simple, restricted scopes are not implemented,
## and this is just for illustrative purposes
return [client, scope:'*']
, (err, data)->
return done err if err
return done null, data if typeof data is 'Boolean'
return done null, data[0], data[1]
## serialize client into session storage (can be overwrite)
serializeClient: (client, done)-> done null, client.id
## deserialize client from session storage (can be overwrite)
deserializeClient: (id, done)->
## get client (consumer)
@db.client.findById id, (err, client)->
return done err if err
done null, client
serializeUser: (user, done) ->
done null, user.id
return
deserializeUser: (id, done) ->
mongoose.model('user').findById id, (err, user) ->
done err, user
return
module.exports = MongoOAuthProvider |
[
{
"context": "Welcome:\n tabTitle: \"Selamat Datang\"\n subtitle:\n text1: \"Penyunting teks yang bol",
"end": 36,
"score": 0.9234474897384644,
"start": 22,
"tag": "NAME",
"value": "Selamat Datang"
},
{
"context": "eh digodam untuk\"\n superscript: \"\"\n text2: \" Abad Ke-21\"\n help:\n forHelpVisit: \"Untuk bantuan, layari",
"end": 147,
"score": 0.9896998405456543,
"start": 137,
"tag": "NAME",
"value": "Abad Ke-21"
}
] | def/ms/welcome.cson | juggernautjp/atom-i18n-beta | 2 | Welcome:
tabTitle: "Selamat Datang"
subtitle:
text1: "Penyunting teks yang boleh digodam untuk"
superscript: ""
text2: " Abad Ke-21"
help:
forHelpVisit: "Untuk bantuan, layari"
atomDocs:
text1: ""
link: "Dokumen-dokumen Atom"
text2: " untuk Panduan Pengguna serta rujukan API."
_template: "${text1}<a>${link}</a>${text2}"
atomForum:
text1: "Forum berkaitan Atom di "
link: "discuss.atom.io"
text2: "" # optional
_template: "${text1}<a>${link}</a>${text2}"
atomOrg:
text1: "Laman "
link: "Atom org"
text2: ". Di sinilah tempat berkumpulnya pakej-pakej Atom yang dihasilkan dari Github."
_template: "${text1}<a>${link}</a>${text2}"
showWelcomeGuide: "Tunjukkan tetingkap Selamat Datang ketika membuka Atom."
| 206183 | Welcome:
tabTitle: "<NAME>"
subtitle:
text1: "Penyunting teks yang boleh digodam untuk"
superscript: ""
text2: " <NAME>"
help:
forHelpVisit: "Untuk bantuan, layari"
atomDocs:
text1: ""
link: "Dokumen-dokumen Atom"
text2: " untuk Panduan Pengguna serta rujukan API."
_template: "${text1}<a>${link}</a>${text2}"
atomForum:
text1: "Forum berkaitan Atom di "
link: "discuss.atom.io"
text2: "" # optional
_template: "${text1}<a>${link}</a>${text2}"
atomOrg:
text1: "Laman "
link: "Atom org"
text2: ". Di sinilah tempat berkumpulnya pakej-pakej Atom yang dihasilkan dari Github."
_template: "${text1}<a>${link}</a>${text2}"
showWelcomeGuide: "Tunjukkan tetingkap Selamat Datang ketika membuka Atom."
| true | Welcome:
tabTitle: "PI:NAME:<NAME>END_PI"
subtitle:
text1: "Penyunting teks yang boleh digodam untuk"
superscript: ""
text2: " PI:NAME:<NAME>END_PI"
help:
forHelpVisit: "Untuk bantuan, layari"
atomDocs:
text1: ""
link: "Dokumen-dokumen Atom"
text2: " untuk Panduan Pengguna serta rujukan API."
_template: "${text1}<a>${link}</a>${text2}"
atomForum:
text1: "Forum berkaitan Atom di "
link: "discuss.atom.io"
text2: "" # optional
_template: "${text1}<a>${link}</a>${text2}"
atomOrg:
text1: "Laman "
link: "Atom org"
text2: ". Di sinilah tempat berkumpulnya pakej-pakej Atom yang dihasilkan dari Github."
_template: "${text1}<a>${link}</a>${text2}"
showWelcomeGuide: "Tunjukkan tetingkap Selamat Datang ketika membuka Atom."
|
[
{
"context": " or 3000\nio = require('socket.io') server\n\nKEY = 'tZWNpjTrjnM5rMh8xLpeM8X95'\nREQUEST_TIME = 30000\nmap_key = 'AIzaSyCEEF6lOjdG",
"end": 240,
"score": 0.9997001886367798,
"start": 215,
"tag": "KEY",
"value": "tZWNpjTrjnM5rMh8xLpeM8X95"
},
{
"context": "nM5rMh8xLpeM8X95'\nREQUEST_TIME = 30000\nmap_key = 'AIzaSyCEEF6lOjdGNiqMZYrQczJi0JpK7R0iZhs'\nroute = undefined\ninterval = undefined\n\napp.use ",
"end": 313,
"score": 0.999763548374176,
"start": 274,
"tag": "KEY",
"value": "AIzaSyCEEF6lOjdGNiqMZYrQczJi0JpK7R0iZhs"
}
] | app.coffee | Jetmate/CTAMap | 0 | helmet = require 'helmet'
compression = require 'compression'
express = require 'express'
http = require 'http'
app = express()
server = app.listen process.env.PORT or 3000
io = require('socket.io') server
KEY = 'tZWNpjTrjnM5rMh8xLpeM8X95'
REQUEST_TIME = 30000
map_key = 'AIzaSyCEEF6lOjdGNiqMZYrQczJi0JpK7R0iZhs'
route = undefined
interval = undefined
app.use helmet()
app.use (req, res, next) ->
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate')
res.header('Expires', '-1')
res.header('Pragma', 'no-cache')
next()
app.use compression()
app.get '/map.html', (req, res, next) ->
if req.query.input_type == 'name'
route = req.query.rt
else
route = req.query['rt-number']
next()
app.use express.static 'public'
getJSON = (type, options, fun, args...) ->
options ?= ''
# console.log "http://www.ctabustracker.com/bustime/api/v2/#{type}?key=#{KEY}#{options}&format=json"
http.get "http://www.ctabustracker.com/bustime/api/v2/#{type}?key=#{KEY}#{options}&format=json", (res) ->
bodyChunks = []
res
.on 'data', (chunk) ->
bodyChunks.push chunk
.on 'end', ->
# console.log(JSON.parse(Buffer.concat(bodyChunks)))
fun JSON.parse(Buffer.concat(bodyChunks))['bustime-response'], args...
getRoutes = (socket) ->
socket.emit 'routes'
getJSON 'getroutes', '', (body) ->
for route in body.routes
getJSON 'getvehicles', "&rt=#{route.rt}", (body, route, routes) ->
if not body.error?
socket.emit 'route', route
if route == routes[routes.length - 1]
socket.emit 'end'
, route, body.routes
getPoints = (socket, route) ->
socket.emit 'points'
getJSON 'getpatterns', "&rt=#{route}", (body) ->
for point in body.ptr[0].pt
socket.emit 'point', {lat: parseFloat(point.lat), lng: parseFloat(point.lon)}
socket.emit 'end'
# getStops = (socket, route) ->
# socket.emit 'stops'
# getJSON 'getdirections', "&rt=#{route}", (body) ->
# dir = body.directions[0].dir
# getJSON 'getstops', "&rt=#{route}&dir=#{dir}", (body) ->
# for stop in body.stops
# socket.emit 'stop', {lat: parseFloat(stop.lat), lng: parseFloat(stop.lon)}
# socket.emit 'end'
getVehicles = (socket, route) ->
socket.emit 'vehicles'
getJSON 'getvehicles', "&rt=#{route}", (body) ->
for vehicle in body.vehicle
socket.emit 'vehicle', {lat: parseFloat(vehicle.lat), lng: parseFloat(vehicle.lon)}, vehicle.hdg
io.on 'connection', (socket) ->
socket.on 'index_ready', ->
getRoutes(socket)
socket.on 'map_ready', ->
getPoints(socket, route)
getVehicles(socket, route)
interval = setInterval(getVehicles, REQUEST_TIME, socket, route)
socket.on 'disconnect', ->
clearInterval(interval)
| 198996 | helmet = require 'helmet'
compression = require 'compression'
express = require 'express'
http = require 'http'
app = express()
server = app.listen process.env.PORT or 3000
io = require('socket.io') server
KEY = '<KEY>'
REQUEST_TIME = 30000
map_key = '<KEY>'
route = undefined
interval = undefined
app.use helmet()
app.use (req, res, next) ->
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate')
res.header('Expires', '-1')
res.header('Pragma', 'no-cache')
next()
app.use compression()
app.get '/map.html', (req, res, next) ->
if req.query.input_type == 'name'
route = req.query.rt
else
route = req.query['rt-number']
next()
app.use express.static 'public'
getJSON = (type, options, fun, args...) ->
options ?= ''
# console.log "http://www.ctabustracker.com/bustime/api/v2/#{type}?key=#{KEY}#{options}&format=json"
http.get "http://www.ctabustracker.com/bustime/api/v2/#{type}?key=#{KEY}#{options}&format=json", (res) ->
bodyChunks = []
res
.on 'data', (chunk) ->
bodyChunks.push chunk
.on 'end', ->
# console.log(JSON.parse(Buffer.concat(bodyChunks)))
fun JSON.parse(Buffer.concat(bodyChunks))['bustime-response'], args...
getRoutes = (socket) ->
socket.emit 'routes'
getJSON 'getroutes', '', (body) ->
for route in body.routes
getJSON 'getvehicles', "&rt=#{route.rt}", (body, route, routes) ->
if not body.error?
socket.emit 'route', route
if route == routes[routes.length - 1]
socket.emit 'end'
, route, body.routes
getPoints = (socket, route) ->
socket.emit 'points'
getJSON 'getpatterns', "&rt=#{route}", (body) ->
for point in body.ptr[0].pt
socket.emit 'point', {lat: parseFloat(point.lat), lng: parseFloat(point.lon)}
socket.emit 'end'
# getStops = (socket, route) ->
# socket.emit 'stops'
# getJSON 'getdirections', "&rt=#{route}", (body) ->
# dir = body.directions[0].dir
# getJSON 'getstops', "&rt=#{route}&dir=#{dir}", (body) ->
# for stop in body.stops
# socket.emit 'stop', {lat: parseFloat(stop.lat), lng: parseFloat(stop.lon)}
# socket.emit 'end'
getVehicles = (socket, route) ->
socket.emit 'vehicles'
getJSON 'getvehicles', "&rt=#{route}", (body) ->
for vehicle in body.vehicle
socket.emit 'vehicle', {lat: parseFloat(vehicle.lat), lng: parseFloat(vehicle.lon)}, vehicle.hdg
io.on 'connection', (socket) ->
socket.on 'index_ready', ->
getRoutes(socket)
socket.on 'map_ready', ->
getPoints(socket, route)
getVehicles(socket, route)
interval = setInterval(getVehicles, REQUEST_TIME, socket, route)
socket.on 'disconnect', ->
clearInterval(interval)
| true | helmet = require 'helmet'
compression = require 'compression'
express = require 'express'
http = require 'http'
app = express()
server = app.listen process.env.PORT or 3000
io = require('socket.io') server
KEY = 'PI:KEY:<KEY>END_PI'
REQUEST_TIME = 30000
map_key = 'PI:KEY:<KEY>END_PI'
route = undefined
interval = undefined
app.use helmet()
app.use (req, res, next) ->
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate')
res.header('Expires', '-1')
res.header('Pragma', 'no-cache')
next()
app.use compression()
app.get '/map.html', (req, res, next) ->
if req.query.input_type == 'name'
route = req.query.rt
else
route = req.query['rt-number']
next()
app.use express.static 'public'
getJSON = (type, options, fun, args...) ->
options ?= ''
# console.log "http://www.ctabustracker.com/bustime/api/v2/#{type}?key=#{KEY}#{options}&format=json"
http.get "http://www.ctabustracker.com/bustime/api/v2/#{type}?key=#{KEY}#{options}&format=json", (res) ->
bodyChunks = []
res
.on 'data', (chunk) ->
bodyChunks.push chunk
.on 'end', ->
# console.log(JSON.parse(Buffer.concat(bodyChunks)))
fun JSON.parse(Buffer.concat(bodyChunks))['bustime-response'], args...
getRoutes = (socket) ->
socket.emit 'routes'
getJSON 'getroutes', '', (body) ->
for route in body.routes
getJSON 'getvehicles', "&rt=#{route.rt}", (body, route, routes) ->
if not body.error?
socket.emit 'route', route
if route == routes[routes.length - 1]
socket.emit 'end'
, route, body.routes
getPoints = (socket, route) ->
socket.emit 'points'
getJSON 'getpatterns', "&rt=#{route}", (body) ->
for point in body.ptr[0].pt
socket.emit 'point', {lat: parseFloat(point.lat), lng: parseFloat(point.lon)}
socket.emit 'end'
# getStops = (socket, route) ->
# socket.emit 'stops'
# getJSON 'getdirections', "&rt=#{route}", (body) ->
# dir = body.directions[0].dir
# getJSON 'getstops', "&rt=#{route}&dir=#{dir}", (body) ->
# for stop in body.stops
# socket.emit 'stop', {lat: parseFloat(stop.lat), lng: parseFloat(stop.lon)}
# socket.emit 'end'
getVehicles = (socket, route) ->
socket.emit 'vehicles'
getJSON 'getvehicles', "&rt=#{route}", (body) ->
for vehicle in body.vehicle
socket.emit 'vehicle', {lat: parseFloat(vehicle.lat), lng: parseFloat(vehicle.lon)}, vehicle.hdg
io.on 'connection', (socket) ->
socket.on 'index_ready', ->
getRoutes(socket)
socket.on 'map_ready', ->
getPoints(socket, route)
getVehicles(socket, route)
interval = setInterval(getVehicles, REQUEST_TIME, socket, route)
socket.on 'disconnect', ->
clearInterval(interval)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.