mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-09 11:34:24 +08:00
Apparently camelCase is all the rage these days
This commit is contained in:
@@ -2,15 +2,15 @@ angular.module("sideBySide").factory("jsonReader", () ->
|
||||
return (source) ->
|
||||
parsed = eval('(' + source + ')')
|
||||
|
||||
new_content = []
|
||||
newContent = []
|
||||
for verse in parsed.content
|
||||
if typeof(verse) == "string"
|
||||
new_content.push({ section: "", text: verse })
|
||||
newContent.push({ section: "", text: verse })
|
||||
else
|
||||
if "section" not of verse
|
||||
verse.section = ""
|
||||
new_content.push(verse)
|
||||
newContent.push(verse)
|
||||
|
||||
parsed.content = new_content
|
||||
parsed.content = newContent
|
||||
return parsed
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
angular.module("sideBySide").factory("markdownReader", () ->
|
||||
return (source) ->
|
||||
read_meta = (block, inlineLexer) ->
|
||||
readMeta = (block, inlineLexer) ->
|
||||
meta = {}
|
||||
lexed = inlineLexer.output(block.text)
|
||||
for line in lexed.split("\n")
|
||||
@@ -8,8 +8,8 @@ angular.module("sideBySide").factory("markdownReader", () ->
|
||||
meta[match[1].trim()] = match[2].trim()
|
||||
return meta
|
||||
|
||||
read_content = (lexed) ->
|
||||
get_section = (lexed) ->
|
||||
readContent = (lexed) ->
|
||||
getSection = (lexed) ->
|
||||
items = []
|
||||
while lexed.length > 0
|
||||
if lexed[0]["type"] == "heading"
|
||||
@@ -25,7 +25,7 @@ angular.module("sideBySide").factory("markdownReader", () ->
|
||||
else
|
||||
heading = ''
|
||||
|
||||
text = get_section(lexed)
|
||||
text = getSection(lexed)
|
||||
text.links = lexed.links
|
||||
content.push({
|
||||
section: heading
|
||||
@@ -39,7 +39,7 @@ angular.module("sideBySide").factory("markdownReader", () ->
|
||||
inlineLexer = new marked.InlineLexer(lexed.links)
|
||||
|
||||
return {
|
||||
meta: read_meta(meta, inlineLexer)
|
||||
content: read_content(lexed)
|
||||
meta: readMeta(meta, inlineLexer)
|
||||
content: readContent(lexed)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ angular.module("sideBySide").factory("transformer", () ->
|
||||
# Check whether all translations have same number of verses
|
||||
#
|
||||
# @param translations [array] Translations to check
|
||||
check_lengths = (translations) ->
|
||||
checkLengths = (translations) ->
|
||||
if translations.length < 1
|
||||
throw "No poems found!"
|
||||
lengths = []
|
||||
@@ -51,7 +51,7 @@ angular.module("sideBySide").factory("transformer", () ->
|
||||
" (" + details.join("; ") + ")."
|
||||
|
||||
|
||||
check_lengths(translations)
|
||||
checkLengths(translations)
|
||||
|
||||
data = {
|
||||
meta: []
|
||||
|
||||
Reference in New Issue
Block a user