mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-21 13:30:27 +08:00
17 lines
382 B
CoffeeScript
17 lines
382 B
CoffeeScript
angular.module("sideBySide").factory("jsonReader", () ->
|
|
return (source) ->
|
|
parsed = eval('(' + source + ')')
|
|
|
|
newContent = []
|
|
for verse in parsed.content
|
|
if typeof(verse) == "string"
|
|
newContent.push({ section: "", text: verse })
|
|
else
|
|
if "section" not of verse
|
|
verse.section = ""
|
|
newContent.push(verse)
|
|
|
|
parsed.content = newContent
|
|
return parsed
|
|
)
|