define([ "underscore", "constants", "storage" ], function(_, constants, storage) { var settings = { layoutOrientation: "horizontal", editMode: 'ltr', lazyRendering: true, editorFontClass: 'font-rich', fontSizeRatio: 1, maxWidthRatio: 1, cursorFocusRatio: 0.5, defaultContent: "\n\n\n> Written with [StackEdit](" + constants.MAIN_URL + ").", commitMsg: "Published with " + constants.MAIN_URL, conflictMode: 'merge', markdownMimeType: 'text/plain', gdriveMultiAccount: 1, gdriveFullAccess: true, dropboxFullAccess: true, githubFullAccess: true, template: [ '', '', '', '', '', '<%= documentTitle %>', '', '', '', '
<%= documentHTML %>
', '' ].join('\n'), pdfTemplate: [ '', '', '', '', '<%= documentTitle %>', '', '', '', '', '<%= documentHTML %>', '' ].join('\n'), pdfOptions: [ '{', ' "marginTop": 25,', ' "marginRight": 25,', ' "marginBottom": 25,', ' "marginLeft": 25,', ' "pageSize": "A4"', '}' ].join('\n'), couchdbUrl: constants.COUCHDB_URL, extensionSettings: {} }; try { _.extend(settings, JSON.parse(storage.settings)); } catch(e) { // Ignore parsing error } return settings; });