mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-23 13:50:24 +08:00
Use newfound ninja skills to refactor stuff
This commit is contained in:
@@ -9,15 +9,12 @@ angular.module("sideBySide").factory("jsonReader", () ->
|
||||
return (source) ->
|
||||
parsed = eval('(' + source + ')')
|
||||
|
||||
newContent = []
|
||||
for verse in parsed.content
|
||||
for i,verse of parsed.content
|
||||
if typeof(verse) == "string"
|
||||
newContent.push({ section: "", text: verse })
|
||||
parsed.content[i] = { section: "", text: verse }
|
||||
else
|
||||
if "section" not of verse
|
||||
verse.section = ""
|
||||
newContent.push(verse)
|
||||
verse.section = "" if "section" not of verse
|
||||
parsed.content[i] = verse
|
||||
|
||||
parsed.content = newContent
|
||||
return parsed
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user