From f618338d3283beec567b9f211532592feb6b38f2 Mon Sep 17 00:00:00 2001 From: Dominik Kundel Date: Fri, 14 Mar 2014 00:53:29 +0100 Subject: [PATCH 01/16] added button to access new modal for editor config --- app/templates/play/level/playback.jade | 3 +++ app/views/play/level/playback_view.coffee | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/app/templates/play/level/playback.jade b/app/templates/play/level/playback.jade index 4d00d230f..c5a88171e 100644 --- a/app/templates/play/level/playback.jade +++ b/app/templates/play/level/playback.jade @@ -37,3 +37,6 @@ button.btn.btn-xs.btn-inverse#music-button(title="Toggle Music") li.selectable#edit-wizard-settings i.icon-user span(data-i18n="play_level.customize_wizard") Customize Wizard + li.selectable#edit-editor-config + i.icon-edit + span Editor Config diff --git a/app/views/play/level/playback_view.coffee b/app/views/play/level/playback_view.coffee index f9c13a9e3..46a5f3a77 100644 --- a/app/views/play/level/playback_view.coffee +++ b/app/views/play/level/playback_view.coffee @@ -2,6 +2,8 @@ View = require 'views/kinds/CocoView' template = require 'templates/play/level/playback' {me} = require 'lib/auth' +EditorConfigModal = require './modal/editor_config_modal' + module.exports = class PlaybackView extends View id: "playback-view" template: template @@ -25,6 +27,7 @@ module.exports = class PlaybackView extends View 'click #debug-toggle': 'onToggleDebug' 'click #grid-toggle': 'onToggleGrid' 'click #edit-wizard-settings': 'onEditWizardSettings' + 'click #edit-editor-config': 'onEditEditorConfig' 'click #music-button': 'onToggleMusic' 'click #zoom-in-button': -> Backbone.Mediator.publish('camera-zoom-in') unless @disabled 'click #zoom-out-button': -> Backbone.Mediator.publish('camera-zoom-out') unless @disabled @@ -77,6 +80,9 @@ module.exports = class PlaybackView extends View onEditWizardSettings: -> Backbone.Mediator.publish 'edit-wizard-settings' + onEditEditorConfig: -> + @openModalView(new EditorConfigModal()) + onDisableControls: (e) -> if not e.controls or 'playback' in e.controls @disabled = true From 6f2a04c5c041f02529fa8c6288469e8a4049c3f1 Mon Sep 17 00:00:00 2001 From: Dominik Kundel Date: Fri, 14 Mar 2014 00:54:06 +0100 Subject: [PATCH 02/16] added new editor config modal --- .../play/level/modal/editor_config.jade | 28 ++++++++++++++++++ .../level/modal/editor_config_modal.coffee | 29 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 app/templates/play/level/modal/editor_config.jade create mode 100644 app/views/play/level/modal/editor_config_modal.coffee diff --git a/app/templates/play/level/modal/editor_config.jade b/app/templates/play/level/modal/editor_config.jade new file mode 100644 index 000000000..098014503 --- /dev/null +++ b/app/templates/play/level/modal/editor_config.jade @@ -0,0 +1,28 @@ +// TODO: refactor to be like other modals +.modal-dialog + .modal-header + button(type='button', data-dismiss="modal", aria-hidden="true").close × + h3 Editor Settings + + .modal-body + .form + .form-group + label(for="keyBindings") + select#keyBindings(name="keyBindings", type="checkbox", checked=multiplayer) + option(value="default" selected=(keyBindings === "default")) Default (Ace) + option(value="vim" selected=(keyBindings === "vim")) Vim + option(value="emacs" selected=(keyBindings === "emacs")) Emacs + span.help-block Adds additional shortcuts known from the common editors. + .form-group.checkbox + label(for="invisibles") + input#invisibles(name="invisibles", type="checkbox", checked=invisibles) + | Show Invisibles + span.help-block Displays invisibles such as spaces or tabs. + .form-group.checkbox + label(for="indentGuides") + input#indentGuides(name="indentGuides", type="checkbox", checked=indentGuides) + | Show Indent Guides + span.help-block Displays vertical lines to see indentation better. + + .modal-footer + a(href='#', data-dismiss="modal", aria-hidden="true", data-i18n="modal.close").btn.btn-primary Close diff --git a/app/views/play/level/modal/editor_config_modal.coffee b/app/views/play/level/modal/editor_config_modal.coffee new file mode 100644 index 000000000..9b4fb095f --- /dev/null +++ b/app/views/play/level/modal/editor_config_modal.coffee @@ -0,0 +1,29 @@ +View = require 'views/kinds/ModalView' +template = require 'templates/play/level/modal/editor_config' +{me} = require('lib/auth') + +module.exports = class EditorConfigModal extends View + id: 'level-editor-config-modal' + template: template + + events: + 'click textarea': 'onClickLink' + 'change #invisibles': 'updateInvisiblesSelection' + 'change #keyBindings': 'updateKeyBindingsSelection' + 'change #indentGuides': 'updateIndentGuides' + + constructor: (options) -> + super(options) + + getRenderData: -> + c = super() + c.keyBindings = 'vim' + c.invisibles = false + c.indentGuides = true + c + + afterRender: -> + super() + + destroy: -> + super() From fca5bbfb1f9f211beb03fc64dc5781a4140e54a4 Mon Sep 17 00:00:00 2001 From: Dominik Kundel Date: Fri, 14 Mar 2014 02:08:31 +0100 Subject: [PATCH 03/16] added aceConfig to user schema --- server/users/user_handler.coffee | 4 ++-- server/users/user_schema.coffee | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/server/users/user_handler.coffee b/server/users/user_handler.coffee index 87c414a55..125845fe9 100644 --- a/server/users/user_handler.coffee +++ b/server/users/user_handler.coffee @@ -9,7 +9,7 @@ errors = require '../commons/errors' async = require 'async' serverProperties = ['passwordHash', 'emailLower', 'nameLower', 'passwordReset'] -privateProperties = ['permissions', 'email', 'firstName', 'lastName', 'gender', 'facebookID', 'music', 'volume'] +privateProperties = ['permissions', 'email', 'firstName', 'lastName', 'gender', 'facebookID', 'music', 'volume', 'aceConfig'] UserHandler = class UserHandler extends Handler modelClass: User @@ -18,7 +18,7 @@ UserHandler = class UserHandler extends Handler 'name', 'photoURL', 'password', 'anonymous', 'wizardColor1', 'volume', 'firstName', 'lastName', 'gender', 'facebookID', 'emailSubscriptions', 'testGroupNumber', 'music', 'hourOfCode', 'hourOfCodeComplete', 'preferredLanguage', - 'wizard' + 'wizard', 'aceConfig' ] jsonSchema: schema diff --git a/server/users/user_schema.coffee b/server/users/user_schema.coffee index d43a8d6b6..8c10fa769 100644 --- a/server/users/user_schema.coffee +++ b/server/users/user_schema.coffee @@ -45,6 +45,11 @@ UserSchema = c.object {}, wizard: c.object {}, colorConfig: c.object {additionalProperties: c.colorConfig()} + aceConfig: c.object {}, + keyBindings: {type: 'string', 'default': 'default', 'enum': ['default', 'vim', 'emacs']} + invisibles: {type: 'boolean', 'default': false} + indentGuides: {type: 'boolean', 'default': false} + c.extendBasicProperties UserSchema, 'user' module.exports = UserSchema From 8a5aeb6227763e69466895a0d63ac9529c76b608 Mon Sep 17 00:00:00 2001 From: Dominik Kundel Date: Fri, 14 Mar 2014 02:09:11 +0100 Subject: [PATCH 04/16] save editor config to database --- .../level/modal/editor_config_modal.coffee | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/app/views/play/level/modal/editor_config_modal.coffee b/app/views/play/level/modal/editor_config_modal.coffee index 9b4fb095f..a0f26d662 100644 --- a/app/views/play/level/modal/editor_config_modal.coffee +++ b/app/views/play/level/modal/editor_config_modal.coffee @@ -5,6 +5,12 @@ template = require 'templates/play/level/modal/editor_config' module.exports = class EditorConfigModal extends View id: 'level-editor-config-modal' template: template + aceConfig: {} + + defaultConfig: + keyBindings: 'default' + invisibles: false + indentGuides: false events: 'click textarea': 'onClickLink' @@ -16,14 +22,33 @@ module.exports = class EditorConfigModal extends View super(options) getRenderData: -> + @aceConfig = _.cloneDeep me.get('aceConfig') || {} + @aceConfig = _.defaults @aceConfig, @defaultConfig c = super() - c.keyBindings = 'vim' - c.invisibles = false - c.indentGuides = true + c.keyBindings = @aceConfig.keyBindings + c.invisibles = @aceConfig.invisibles + c.indentGuides = @aceConfig.indentGuides c + updateInvisiblesSelection: -> + @aceConfig.invisibles = @$el.find('#invisibles').prop('checked') + + updateKeyBindingsSelection: -> + @aceConfig.keyBindings = @$el.find('#keyBindings').val() + + updateIndentGuides: -> + @aceConfig.indentGuides = @$el.find('#indentGuides').prop('checked') + afterRender: -> super() + onHidden: -> + @aceConfig.invisibles = @$el.find('#invisibles').prop('checked') + @aceConfig.keyBindings = @$el.find('#keyBindings').val() + @aceConfig.indentGuides = @$el.find('#indentGuides').prop('checked') + me.set 'aceConfig', @aceConfig + me.save() + console.log 'config', @aceConfig + destroy: -> super() From 7e955c72b8d177519898d74c470b587def3e41e3 Mon Sep 17 00:00:00 2001 From: Dominik Kundel Date: Fri, 14 Mar 2014 02:49:58 +0100 Subject: [PATCH 05/16] apply config to editor --- .../level/modal/editor_config_modal.coffee | 2 +- app/views/play/level/tome/spell_view.coffee | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/views/play/level/modal/editor_config_modal.coffee b/app/views/play/level/modal/editor_config_modal.coffee index a0f26d662..fafaf31e3 100644 --- a/app/views/play/level/modal/editor_config_modal.coffee +++ b/app/views/play/level/modal/editor_config_modal.coffee @@ -47,8 +47,8 @@ module.exports = class EditorConfigModal extends View @aceConfig.keyBindings = @$el.find('#keyBindings').val() @aceConfig.indentGuides = @$el.find('#indentGuides').prop('checked') me.set 'aceConfig', @aceConfig + Backbone.Mediator.publish 'change:editor-config' me.save() - console.log 'config', @aceConfig destroy: -> super() diff --git a/app/views/play/level/tome/spell_view.coffee b/app/views/play/level/tome/spell_view.coffee index 19567edad..1069b434a 100644 --- a/app/views/play/level/tome/spell_view.coffee +++ b/app/views/play/level/tome/spell_view.coffee @@ -15,6 +15,11 @@ module.exports = class SpellView extends View eventsSuppressed: true writable: true + keyBindings: + 'default': null + 'vim': 'ace/keyboard/vim' + 'emacs': 'ace/keyboard/emacs' + subscriptions: 'level-disable-controls': 'onDisableControls' 'level-enable-controls': 'onEnableControls' @@ -30,6 +35,7 @@ module.exports = class SpellView extends View 'focus-editor': 'focus' 'tome:spell-statement-index-updated': 'onStatementIndexUpdated' 'spell-beautify': 'onSpellBeautify' + 'change:editor-config': 'onChangeEditorConfig' events: 'mouseout': 'onMouseOut' @@ -56,6 +62,7 @@ module.exports = class SpellView extends View createACE: -> # Test themes and settings here: http://ace.ajax.org/build/kitchen-sink.html + aceConfig = me.get 'aceConfig' @ace = ace.edit @$el.find('.ace')[0] @aceSession = @ace.getSession() @aceDoc = @aceSession.getDocument() @@ -66,11 +73,12 @@ module.exports = class SpellView extends View @aceSession.setNewLineMode "unix" @aceSession.setUseSoftTabs true @ace.setTheme 'ace/theme/textmate' - @ace.setDisplayIndentGuides false + @ace.setDisplayIndentGuides (aceConfig.indentGuides || false) @ace.setShowPrintMargin false - @ace.setShowInvisibles false + @ace.setShowInvisibles (aceConfig.invisibles || false) @ace.setBehavioursEnabled false @ace.setAnimatedScroll true + @ace.setKeyboardHandler (@keyBindings[aceConfig.keyBindings] || null) @toggleControls null, @writable @aceSession.selection.on 'changeCursor', @onCursorActivity $(@ace.container).find('.ace_gutter').on 'click', '.ace_error, .ace_warning, .ace_info', @onAnnotationClick @@ -548,6 +556,12 @@ module.exports = class SpellView extends View pretty = @spellThang.aether.beautify ugly @ace.setValue pretty + onChangeEditorConfig: (e) -> + aceConfig = me.get 'aceConfig' + @ace.setDisplayIndentGuides (aceConfig.indentGuides || false) + @ace.setShowInvisibles (aceConfig.invisibles || false) + @ace.setKeyboardHandler (@keyBindings[aceConfig.keyBindings] || null) + dismiss: -> @recompile() if @spell.hasChangedSignificantly @getSource() From 4f0805ce1e36d562b6d11a61e24ab3178e371adf Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Thu, 13 Mar 2014 18:50:52 -0700 Subject: [PATCH 06/16] I changed the semantics of the i18n fallback to not hit 'text' for other properties, so updated a test. --- server/routes/mail.coffee | 10 ++++++---- test/app/lib/utils.spec.coffee | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/routes/mail.coffee b/server/routes/mail.coffee index 07f7169fd..69decd276 100644 --- a/server/routes/mail.coffee +++ b/server/routes/mail.coffee @@ -16,7 +16,7 @@ sendwithus = require '../sendwithus' module.exports.setup = (app) -> app.all config.mail.mailchimpWebhook, handleMailchimpWebHook app.get '/mail/cron/ladder-update', handleLadderUpdate - + getAllLadderScores = (next) -> query = Level.find({type: 'ladder'}) .select('levelID') @@ -28,6 +28,8 @@ getAllLadderScores = (next) -> for level in levels for team in ['humans', 'ogres'] 'I ... am not doing this.' + # Query to get sessions to make histogram + # db.level.sessions.find({"submitted":true,"levelID":"brawlwood",team:"ogres"},{"_id":0,"totalScore":1}) isRequestFromDesignatedCronHandler = (req, res) -> if req.ip isnt config.mail.cronHandlerPublicIP and req.ip isnt config.mail.cronHandlerPrivateIP @@ -36,13 +38,13 @@ isRequestFromDesignatedCronHandler = (req, res) -> res.end() return false return true - - + + handleLadderUpdate = (req, res) -> log.info("Going to see about sending ladder update emails.") requestIsFromDesignatedCronHandler = isRequestFromDesignatedCronHandler req, res unless requestIsFromDesignatedCronHandler then return - + res.send('Great work, Captain Cron! I can take it from here.') res.end() # TODO: somehow fetch the histograms diff --git a/test/app/lib/utils.spec.coffee b/test/app/lib/utils.spec.coffee index 7852ddf5e..925bc8e54 100644 --- a/test/app/lib/utils.spec.coffee +++ b/test/app/lib/utils.spec.coffee @@ -40,7 +40,7 @@ describe 'utils library', -> expect(util.i18n(this.fixture1, 'text', 'en')).toEqual(this.fixture1.text) expect(util.i18n(this.fixture1, 'blurb', 'en')).toEqual(this.fixture1.blurb) delete this.fixture1.blurb - expect(util.i18n(this.fixture1, 'blurb', 'en')).toEqual(this.fixture1.text) + expect(util.i18n(this.fixture1, 'blurb', 'en')).toEqual(null) it 'i18n can fall forward if a general language is not found', -> expect(util.i18n(this.fixture1, 'text', 'pt')).toEqual(this.fixture1.i18n['pt-BR'].text) From 0392f630cc92c19dbc8254ce9689d436ce33572c Mon Sep 17 00:00:00 2001 From: Dominik Kundel Date: Fri, 14 Mar 2014 03:26:53 +0100 Subject: [PATCH 07/16] including i18n support for new editor config and minor styling changes --- app/locale/de.coffee | 11 ++++++++++- app/locale/en.coffee | 9 +++++++++ app/styles/play/level/modal/editor_config.sass | 12 ++++++++++++ .../play/level/modal/editor_config.jade | 18 +++++++++--------- app/templates/play/level/playback.jade | 2 +- 5 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 app/styles/play/level/modal/editor_config.sass diff --git a/app/locale/de.coffee b/app/locale/de.coffee index 7e9f4b9ee..b24588df6 100644 --- a/app/locale/de.coffee +++ b/app/locale/de.coffee @@ -200,7 +200,16 @@ module.exports = nativeDescription: "Deutsch", englishDescription: "German", tra tome_available_spells: "Verfügbare Zauber" hud_continue: "Weiter (drücke Shift + Leertaste)" spell_saved: "Zauber gespeichert" -# skip_tutorial: "Skip (esc)" + skip_tutorial: "Überspringen (Esc)" + editor_config: "Editor Einstellungen" + editor_config_title: "Editor Einstellungen" + editor_config_keybindings_label: "Tastenbelegung" + editor_config_keybindings_default: "Standard (Ace)" + editor_config_keybindings_description: "Fügt zusätzliche Tastenkombinationen, bekannt aus anderen Editoren, hinzu" + editor_config_invisibles_label: "Zeige unsichtbare Zeichen" + editor_config_invisibles_description: "Zeigt unsichtbare Zeichen wie Leertasten an." + editor_config_indentguides_label: "Zeige Einrückungshilfe" + editor_config_indentguides_description: "Zeigt vertikale Linien an um Einrückungen besser zu sehen." admin: av_title: "Administrator Übersicht" diff --git a/app/locale/en.coffee b/app/locale/en.coffee index 2766dda9c..c47643a85 100644 --- a/app/locale/en.coffee +++ b/app/locale/en.coffee @@ -206,6 +206,15 @@ module.exports = nativeDescription: "English", englishDescription: "English", tr hud_continue: "Continue (shift+space)" spell_saved: "Spell Saved" skip_tutorial: "Skip (esc)" + editor_config: "Editor Config" + editor_config_title: "Editor Configuration" + editor_config_keybindings_label: "Key Bindings" + editor_config_keybindings_default: "Default (Ace)" + editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." + editor_config_invisibles_label: "Show Invisibles" + editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." + editor_config_indentguides_label: "Show Indent Guides" + editor_config_indentguides_description: "Displays vertical lines to see indentation better." admin: av_title: "Admin Views" diff --git a/app/styles/play/level/modal/editor_config.sass b/app/styles/play/level/modal/editor_config.sass new file mode 100644 index 000000000..1d97d3965 --- /dev/null +++ b/app/styles/play/level/modal/editor_config.sass @@ -0,0 +1,12 @@ +#level-editor-config-modal + .select-group + display: block + min-height: 20px + margin-top: 10px + margin-bottom: 10px + padding-left: 20px + vertical-align: middle + + label + font-weight: normal + margin-right: 20px \ No newline at end of file diff --git a/app/templates/play/level/modal/editor_config.jade b/app/templates/play/level/modal/editor_config.jade index 098014503..ed42f0cf4 100644 --- a/app/templates/play/level/modal/editor_config.jade +++ b/app/templates/play/level/modal/editor_config.jade @@ -2,27 +2,27 @@ .modal-dialog .modal-header button(type='button', data-dismiss="modal", aria-hidden="true").close × - h3 Editor Settings + h3(data-i18n="play_level.editor_config_title") Editor Configuration .modal-body .form - .form-group - label(for="keyBindings") + .form-group.select-group + label.control-label(for="keyBindings" data-i18n="play_level.editor_config_keybindings_label") Key Bindings select#keyBindings(name="keyBindings", type="checkbox", checked=multiplayer) - option(value="default" selected=(keyBindings === "default")) Default (Ace) + option(value="default" selected=(keyBindings === "default") data-i18n="play_level.editor_config_keybindings_default") Default (Ace) option(value="vim" selected=(keyBindings === "vim")) Vim option(value="emacs" selected=(keyBindings === "emacs")) Emacs - span.help-block Adds additional shortcuts known from the common editors. + span.help-block(data-i18n="play_level.editor_config_keybindings_description") Adds additional shortcuts known from the common editors. .form-group.checkbox label(for="invisibles") input#invisibles(name="invisibles", type="checkbox", checked=invisibles) - | Show Invisibles - span.help-block Displays invisibles such as spaces or tabs. + span(data-i18n="play_level.editor_config_invisibles_label") Show Invisibles + span.help-block(data-i18n="play_level.editor_config_invisibles_description") Displays invisibles such as spaces or tabs. .form-group.checkbox label(for="indentGuides") input#indentGuides(name="indentGuides", type="checkbox", checked=indentGuides) - | Show Indent Guides - span.help-block Displays vertical lines to see indentation better. + span(data-i18n="play_level.editor_config_indentguides_label") Show Indent Guides + span.help-block(data-i18n="play_level.editor_config_indentguides_description") Displays vertical lines to see indentation better. .modal-footer a(href='#', data-dismiss="modal", aria-hidden="true", data-i18n="modal.close").btn.btn-primary Close diff --git a/app/templates/play/level/playback.jade b/app/templates/play/level/playback.jade index c5a88171e..48f9ce2b6 100644 --- a/app/templates/play/level/playback.jade +++ b/app/templates/play/level/playback.jade @@ -39,4 +39,4 @@ button.btn.btn-xs.btn-inverse#music-button(title="Toggle Music") span(data-i18n="play_level.customize_wizard") Customize Wizard li.selectable#edit-editor-config i.icon-edit - span Editor Config + span(data-i18n="play_level.editor_config") Editor Config From 190469d794f75725553a5f8bb9a345eefd204ebe Mon Sep 17 00:00:00 2001 From: Dominik Kundel Date: Fri, 14 Mar 2014 03:28:20 +0100 Subject: [PATCH 08/16] removed unnecessary comment --- app/templates/play/level/modal/editor_config.jade | 1 - 1 file changed, 1 deletion(-) diff --git a/app/templates/play/level/modal/editor_config.jade b/app/templates/play/level/modal/editor_config.jade index ed42f0cf4..3145b0aed 100644 --- a/app/templates/play/level/modal/editor_config.jade +++ b/app/templates/play/level/modal/editor_config.jade @@ -1,4 +1,3 @@ -// TODO: refactor to be like other modals .modal-dialog .modal-header button(type='button', data-dismiss="modal", aria-hidden="true").close × From 3c0b496033025f45b48ee7e8ced889db7cff2acb Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Fri, 14 Mar 2014 07:46:36 -0700 Subject: [PATCH 09/16] Fix for if aceConfig doesn't exist yet. --- app/views/play/level/modal/editor_config_modal.coffee | 3 +-- app/views/play/level/tome/spell_view.coffee | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/play/level/modal/editor_config_modal.coffee b/app/views/play/level/modal/editor_config_modal.coffee index fafaf31e3..646768cdf 100644 --- a/app/views/play/level/modal/editor_config_modal.coffee +++ b/app/views/play/level/modal/editor_config_modal.coffee @@ -13,7 +13,6 @@ module.exports = class EditorConfigModal extends View indentGuides: false events: - 'click textarea': 'onClickLink' 'change #invisibles': 'updateInvisiblesSelection' 'change #keyBindings': 'updateKeyBindingsSelection' 'change #indentGuides': 'updateIndentGuides' @@ -22,7 +21,7 @@ module.exports = class EditorConfigModal extends View super(options) getRenderData: -> - @aceConfig = _.cloneDeep me.get('aceConfig') || {} + @aceConfig = _.cloneDeep me.get('aceConfig') ? {} @aceConfig = _.defaults @aceConfig, @defaultConfig c = super() c.keyBindings = @aceConfig.keyBindings diff --git a/app/views/play/level/tome/spell_view.coffee b/app/views/play/level/tome/spell_view.coffee index 618185596..806f1a262 100644 --- a/app/views/play/level/tome/spell_view.coffee +++ b/app/views/play/level/tome/spell_view.coffee @@ -62,7 +62,7 @@ module.exports = class SpellView extends View createACE: -> # Test themes and settings here: http://ace.ajax.org/build/kitchen-sink.html - aceConfig = me.get 'aceConfig' + aceConfig = me.get('aceConfig') ? {} @ace = ace.edit @$el.find('.ace')[0] @aceSession = @ace.getSession() @aceDoc = @aceSession.getDocument() @@ -73,9 +73,9 @@ module.exports = class SpellView extends View @aceSession.setNewLineMode "unix" @aceSession.setUseSoftTabs true @ace.setTheme 'ace/theme/textmate' - @ace.setDisplayIndentGuides (aceConfig.indentGuides || false) + @ace.setDisplayIndentGuides aceConfig.indentGuides # default false @ace.setShowPrintMargin false - @ace.setShowInvisibles (aceConfig.invisibles || false) + @ace.setShowInvisibles aceConfig.invisibles # default false @ace.setBehavioursEnabled false @ace.setAnimatedScroll true @ace.setKeyboardHandler (@keyBindings[aceConfig.keyBindings] || null) From 5c76ca71e34b15962ce0aeee532c4178973e0832 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Fri, 14 Mar 2014 10:14:48 -0700 Subject: [PATCH 10/16] Added configuring of behaviors to the editor config. --- app/locale/en.coffee | 2 ++ .../play/level/modal/editor_config.jade | 18 ++++++++----- .../level/modal/editor_config_modal.coffee | 25 ++++++++++++------- app/views/play/level/tome/spell_view.coffee | 8 +++--- server/users/user_schema.coffee | 1 + 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/app/locale/en.coffee b/app/locale/en.coffee index 1e004c8d7..204317e0b 100644 --- a/app/locale/en.coffee +++ b/app/locale/en.coffee @@ -216,6 +216,8 @@ module.exports = nativeDescription: "English", englishDescription: "English", tr editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." editor_config_indentguides_label: "Show Indent Guides" editor_config_indentguides_description: "Displays vertical lines to see indentation better." + editor_config_behaviors_label: "Smart Behaviors" + editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Admin Views" diff --git a/app/templates/play/level/modal/editor_config.jade b/app/templates/play/level/modal/editor_config.jade index 3145b0aed..ca622f77c 100644 --- a/app/templates/play/level/modal/editor_config.jade +++ b/app/templates/play/level/modal/editor_config.jade @@ -6,22 +6,28 @@ .modal-body .form .form-group.select-group - label.control-label(for="keyBindings" data-i18n="play_level.editor_config_keybindings_label") Key Bindings - select#keyBindings(name="keyBindings", type="checkbox", checked=multiplayer) + label.control-label(for="tome-key-bindings" data-i18n="play_level.editor_config_keybindings_label") Key Bindings + select#tome-key-bindings(name="keyBindings", type="checkbox", checked=multiplayer) option(value="default" selected=(keyBindings === "default") data-i18n="play_level.editor_config_keybindings_default") Default (Ace) option(value="vim" selected=(keyBindings === "vim")) Vim option(value="emacs" selected=(keyBindings === "emacs")) Emacs span.help-block(data-i18n="play_level.editor_config_keybindings_description") Adds additional shortcuts known from the common editors. .form-group.checkbox - label(for="invisibles") - input#invisibles(name="invisibles", type="checkbox", checked=invisibles) + label(for="tome-invisibles") + input#tome-invisibles(name="invisibles", type="checkbox", checked=invisibles) span(data-i18n="play_level.editor_config_invisibles_label") Show Invisibles span.help-block(data-i18n="play_level.editor_config_invisibles_description") Displays invisibles such as spaces or tabs. .form-group.checkbox - label(for="indentGuides") - input#indentGuides(name="indentGuides", type="checkbox", checked=indentGuides) + label(for="tome-indent-guides") + input#tome-indent-guides(name="indentGuides", type="checkbox", checked=indentGuides) span(data-i18n="play_level.editor_config_indentguides_label") Show Indent Guides span.help-block(data-i18n="play_level.editor_config_indentguides_description") Displays vertical lines to see indentation better. + .form-group.checkbox + label(for="tome-behaviors") + input#tome-behaviors(name="behaviors", type="checkbox", checked=behaviors) + span(data-i18n="play_level.editor_config_behaviors_label") Smart Behaviors + span.help-block(data-i18n="play_level.editor_config_behaviors_description") Autocompletes brackets, braces, and quotes. .modal-footer a(href='#', data-dismiss="modal", aria-hidden="true", data-i18n="modal.close").btn.btn-primary Close + diff --git a/app/views/play/level/modal/editor_config_modal.coffee b/app/views/play/level/modal/editor_config_modal.coffee index 646768cdf..044a4dfaa 100644 --- a/app/views/play/level/modal/editor_config_modal.coffee +++ b/app/views/play/level/modal/editor_config_modal.coffee @@ -11,11 +11,13 @@ module.exports = class EditorConfigModal extends View keyBindings: 'default' invisibles: false indentGuides: false + behaviors: false events: - 'change #invisibles': 'updateInvisiblesSelection' - 'change #keyBindings': 'updateKeyBindingsSelection' - 'change #indentGuides': 'updateIndentGuides' + 'change #tome-invisibles': 'updateInvisiblesSelection' + 'change #tome-key-bindings': 'updateKeyBindingsSelection' + 'change #tome-indent-guides': 'updateIndentGuides' + 'change #tome-behaviors': 'updateBehaviors' constructor: (options) -> super(options) @@ -27,24 +29,29 @@ module.exports = class EditorConfigModal extends View c.keyBindings = @aceConfig.keyBindings c.invisibles = @aceConfig.invisibles c.indentGuides = @aceConfig.indentGuides + c.behaviors = @aceConfig.behaviors c updateInvisiblesSelection: -> - @aceConfig.invisibles = @$el.find('#invisibles').prop('checked') + @aceConfig.invisibles = @$el.find('#tome-invisibles').prop('checked') updateKeyBindingsSelection: -> - @aceConfig.keyBindings = @$el.find('#keyBindings').val() + @aceConfig.keyBindings = @$el.find('#tome-key-bindings').val() updateIndentGuides: -> - @aceConfig.indentGuides = @$el.find('#indentGuides').prop('checked') + @aceConfig.indentGuides = @$el.find('#tome-indent-guides').prop('checked') + + updateBehaviors: -> + @aceConfig.behaviors = @$el.find('#tome-behaviors').prop('checked') afterRender: -> super() onHidden: -> - @aceConfig.invisibles = @$el.find('#invisibles').prop('checked') - @aceConfig.keyBindings = @$el.find('#keyBindings').val() - @aceConfig.indentGuides = @$el.find('#indentGuides').prop('checked') + @aceConfig.invisibles = @$el.find('#tome-invisibles').prop('checked') + @aceConfig.keyBindings = @$el.find('#tome-key-bindings').val() + @aceConfig.indentGuides = @$el.find('#tome-indent-guides').prop('checked') + @aceConfig.behaviors = @$el.find('#tome-behaviors').prop('checked') me.set 'aceConfig', @aceConfig Backbone.Mediator.publish 'change:editor-config' me.save() diff --git a/app/views/play/level/tome/spell_view.coffee b/app/views/play/level/tome/spell_view.coffee index 806f1a262..e9ac98dab 100644 --- a/app/views/play/level/tome/spell_view.coffee +++ b/app/views/play/level/tome/spell_view.coffee @@ -73,12 +73,12 @@ module.exports = class SpellView extends View @aceSession.setNewLineMode "unix" @aceSession.setUseSoftTabs true @ace.setTheme 'ace/theme/textmate' - @ace.setDisplayIndentGuides aceConfig.indentGuides # default false + @ace.setDisplayIndentGuides aceConfig.indentGuides @ace.setShowPrintMargin false - @ace.setShowInvisibles aceConfig.invisibles # default false - @ace.setBehavioursEnabled false + @ace.setShowInvisibles aceConfig.invisibles + @ace.setBehavioursEnabled aceConfig.behaviors @ace.setAnimatedScroll true - @ace.setKeyboardHandler (@keyBindings[aceConfig.keyBindings] || null) + @ace.setKeyboardHandler @keyBindings[aceConfig.keyBindings ? 'default'] @toggleControls null, @writable @aceSession.selection.on 'changeCursor', @onCursorActivity $(@ace.container).find('.ace_gutter').on 'click', '.ace_error, .ace_warning, .ace_info', @onAnnotationClick diff --git a/server/users/user_schema.coffee b/server/users/user_schema.coffee index 8c10fa769..650d680d6 100644 --- a/server/users/user_schema.coffee +++ b/server/users/user_schema.coffee @@ -49,6 +49,7 @@ UserSchema = c.object {}, keyBindings: {type: 'string', 'default': 'default', 'enum': ['default', 'vim', 'emacs']} invisibles: {type: 'boolean', 'default': false} indentGuides: {type: 'boolean', 'default': false} + behaviors: {type: 'boolean', 'default': false} c.extendBasicProperties UserSchema, 'user' From c0e966a08c762ed39cd0e724c8c47241eee0d878 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Fri, 14 Mar 2014 10:24:07 -0700 Subject: [PATCH 11/16] Propagated new editor i18n tags. --- app/locale/ar.coffee | 11 +++++++++++ app/locale/bg.coffee | 11 +++++++++++ app/locale/cs.coffee | 11 +++++++++++ app/locale/da.coffee | 11 +++++++++++ app/locale/de.coffee | 2 ++ app/locale/el.coffee | 11 +++++++++++ app/locale/en-AU.coffee | 11 +++++++++++ app/locale/en-GB.coffee | 11 +++++++++++ app/locale/en-US.coffee | 11 +++++++++++ app/locale/es-419.coffee | 11 +++++++++++ app/locale/es-ES.coffee | 11 +++++++++++ app/locale/es.coffee | 11 +++++++++++ app/locale/fa.coffee | 11 +++++++++++ app/locale/fi.coffee | 11 +++++++++++ app/locale/fr.coffee | 11 +++++++++++ app/locale/he.coffee | 11 +++++++++++ app/locale/hi.coffee | 11 +++++++++++ app/locale/hu.coffee | 11 +++++++++++ app/locale/id.coffee | 11 +++++++++++ app/locale/it.coffee | 11 +++++++++++ app/locale/ja.coffee | 11 +++++++++++ app/locale/ko.coffee | 11 +++++++++++ app/locale/lt.coffee | 11 +++++++++++ app/locale/ms-BA.coffee | 11 +++++++++++ app/locale/nb.coffee | 11 +++++++++++ app/locale/nl.coffee | 11 +++++++++++ app/locale/nn.coffee | 11 +++++++++++ app/locale/no.coffee | 11 +++++++++++ app/locale/pl.coffee | 11 +++++++++++ app/locale/pt-BR.coffee | 11 +++++++++++ app/locale/pt-PT.coffee | 11 +++++++++++ app/locale/pt.coffee | 11 +++++++++++ app/locale/ro.coffee | 11 +++++++++++ app/locale/ru.coffee | 11 +++++++++++ app/locale/sk.coffee | 11 +++++++++++ app/locale/sl.coffee | 11 +++++++++++ app/locale/sr.coffee | 11 +++++++++++ app/locale/sv.coffee | 11 +++++++++++ app/locale/th.coffee | 11 +++++++++++ app/locale/tr.coffee | 11 +++++++++++ app/locale/uk.coffee | 11 +++++++++++ app/locale/ur.coffee | 11 +++++++++++ app/locale/vi.coffee | 11 +++++++++++ app/locale/zh-HANS.coffee | 11 +++++++++++ app/locale/zh-HANT.coffee | 11 +++++++++++ app/locale/zh.coffee | 11 +++++++++++ 46 files changed, 497 insertions(+) diff --git a/app/locale/ar.coffee b/app/locale/ar.coffee index 9921bae54..09fcff581 100644 --- a/app/locale/ar.coffee +++ b/app/locale/ar.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "العربية", englishDescription: "Arabi # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/bg.coffee b/app/locale/bg.coffee index 01f6cadb8..3ad52cddd 100644 --- a/app/locale/bg.coffee +++ b/app/locale/bg.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "български език", englishDescri # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/cs.coffee b/app/locale/cs.coffee index d42c5f537..28a2c2e07 100644 --- a/app/locale/cs.coffee +++ b/app/locale/cs.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr hud_continue: "Pokračovat (stiskněte shift-mezera)" spell_saved: "Kouzlo uloženo" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Administrátorský pohled" diff --git a/app/locale/da.coffee b/app/locale/da.coffee index 6c0d2431a..94b36bccc 100644 --- a/app/locale/da.coffee +++ b/app/locale/da.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "dansk", englishDescription: "Danish", trans hud_continue: "Fortsæt (tryk skift-mellemrum)" spell_saved: "Trylleformularen er gemt" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: # av_title: "Admin Views" diff --git a/app/locale/de.coffee b/app/locale/de.coffee index 8830bf667..155669e56 100644 --- a/app/locale/de.coffee +++ b/app/locale/de.coffee @@ -216,6 +216,8 @@ module.exports = nativeDescription: "Deutsch", englishDescription: "German", tra editor_config_invisibles_description: "Zeigt unsichtbare Zeichen wie Leertasten an." editor_config_indentguides_label: "Zeige Einrückungshilfe" editor_config_indentguides_description: "Zeigt vertikale Linien an um Einrückungen besser zu sehen." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Administrator Übersicht" diff --git a/app/locale/el.coffee b/app/locale/el.coffee index 2530712ab..01e907b39 100644 --- a/app/locale/el.coffee +++ b/app/locale/el.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "ελληνικά", englishDescription: "Gre # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/en-AU.coffee b/app/locale/en-AU.coffee index 71c90c79f..8486acbc4 100644 --- a/app/locale/en-AU.coffee +++ b/app/locale/en-AU.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "English (AU)", englishDescription: "English # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/en-GB.coffee b/app/locale/en-GB.coffee index 445d6137f..757a7012b 100644 --- a/app/locale/en-GB.coffee +++ b/app/locale/en-GB.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "English (UK)", englishDescription: "English # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/en-US.coffee b/app/locale/en-US.coffee index 5fc32bbf7..027e45419 100644 --- a/app/locale/en-US.coffee +++ b/app/locale/en-US.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "English (US)", englishDescription: "English # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/es-419.coffee b/app/locale/es-419.coffee index 01a26a711..a494a2e63 100644 --- a/app/locale/es-419.coffee +++ b/app/locale/es-419.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "español (América Latina)", englishDescrip hud_continue: "Continuar (presionar shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/es-ES.coffee b/app/locale/es-ES.coffee index ff87aa110..4b5307600 100644 --- a/app/locale/es-ES.coffee +++ b/app/locale/es-ES.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "español (ES)", englishDescription: "Spanis hud_continue: "Continuar (pulsa Shift+Space)" spell_saved: "Hechizo guardado" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: # av_title: "Admin Views" diff --git a/app/locale/es.coffee b/app/locale/es.coffee index 7665ee54a..6e71b9c7b 100644 --- a/app/locale/es.coffee +++ b/app/locale/es.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "español", englishDescription: "Spanish", t hud_continue: "Continuar (presionar shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/fa.coffee b/app/locale/fa.coffee index dfce565db..f6e870b6d 100644 --- a/app/locale/fa.coffee +++ b/app/locale/fa.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "فارسی", englishDescription: "Persian", # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/fi.coffee b/app/locale/fi.coffee index dff88274a..95eebb045 100644 --- a/app/locale/fi.coffee +++ b/app/locale/fi.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "suomi", englishDescription: "Finnish", tran # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/fr.coffee b/app/locale/fr.coffee index e8b6e2767..b3f01ca55 100644 --- a/app/locale/fr.coffee +++ b/app/locale/fr.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "français", englishDescription: "French", t hud_continue: "Continuer (appuie sur shift ou espace)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Vues d'administrateurs" diff --git a/app/locale/he.coffee b/app/locale/he.coffee index ca162af86..97c562d2e 100644 --- a/app/locale/he.coffee +++ b/app/locale/he.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "עברית", englishDescription: "Hebrew", # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/hi.coffee b/app/locale/hi.coffee index be1778581..9a29a9e68 100644 --- a/app/locale/hi.coffee +++ b/app/locale/hi.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "मानक हिन्दी", englishDe # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/hu.coffee b/app/locale/hu.coffee index ad1074dae..62d910253 100644 --- a/app/locale/hu.coffee +++ b/app/locale/hu.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t hud_continue: "Folytatás (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/id.coffee b/app/locale/id.coffee index f569350ab..04061d098 100644 --- a/app/locale/id.coffee +++ b/app/locale/id.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "Bahasa Indonesia", englishDescription: "Ind # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/it.coffee b/app/locale/it.coffee index be34d77c5..b9a4159ce 100644 --- a/app/locale/it.coffee +++ b/app/locale/it.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "italiano", englishDescription: "Italian", t hud_continue: "Continua (premi Maiusc-Spazio)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Vista amministratore" diff --git a/app/locale/ja.coffee b/app/locale/ja.coffee index 5aa861ae5..aee267bdc 100644 --- a/app/locale/ja.coffee +++ b/app/locale/ja.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "日本語", englishDescription: "Japanese", hud_continue: "続く (Shift+Spaceキー)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "管理画面" diff --git a/app/locale/ko.coffee b/app/locale/ko.coffee index a89161b7c..6922e26b7 100644 --- a/app/locale/ko.coffee +++ b/app/locale/ko.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/lt.coffee b/app/locale/lt.coffee index 2780e834f..fef80fa08 100644 --- a/app/locale/lt.coffee +++ b/app/locale/lt.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/ms-BA.coffee b/app/locale/ms-BA.coffee index 25eb81dc6..721cf870a 100644 --- a/app/locale/ms-BA.coffee +++ b/app/locale/ms-BA.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/nb.coffee b/app/locale/nb.coffee index 8c7b9a283..c0997bb67 100644 --- a/app/locale/nb.coffee +++ b/app/locale/nb.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "Norsk Bokmål", englishDescription: "Norweg hud_continue: "Fortsett (trykk shift-mellomrom)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/nl.coffee b/app/locale/nl.coffee index ffa8ea90b..463e559fb 100644 --- a/app/locale/nl.coffee +++ b/app/locale/nl.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "Nederlands", englishDescription: "Dutch", t hud_continue: "Ga verder (druk shift-space)" spell_saved: "Spreuk Opgeslagen" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Administrator panels" diff --git a/app/locale/nn.coffee b/app/locale/nn.coffee index ef7f37a76..437e89e76 100644 --- a/app/locale/nn.coffee +++ b/app/locale/nn.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "Norwegian Nynorsk", englishDescription: "No # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/no.coffee b/app/locale/no.coffee index ba381e55d..9312bf07b 100644 --- a/app/locale/no.coffee +++ b/app/locale/no.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "Norsk", englishDescription: "Norwegian", tr hud_continue: "Fortsett (trykk shift-mellomrom)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/pl.coffee b/app/locale/pl.coffee index 31516e816..9c1984988 100644 --- a/app/locale/pl.coffee +++ b/app/locale/pl.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish hud_continue: "Kontynuuj (Shift + spacja)" spell_saved: "Czar zapisany" skip_tutorial: "Pomiń (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Panel administracyjny" diff --git a/app/locale/pt-BR.coffee b/app/locale/pt-BR.coffee index 06ba3cc36..114adef31 100644 --- a/app/locale/pt-BR.coffee +++ b/app/locale/pt-BR.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "português do Brasil", englishDescription: hud_continue: "Continue (tecle Shift+Space)" spell_saved: "Feitiço Salvo" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Visualização de Administrador" diff --git a/app/locale/pt-PT.coffee b/app/locale/pt-PT.coffee index a394b773d..670e8dc77 100644 --- a/app/locale/pt-PT.coffee +++ b/app/locale/pt-PT.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "Português europeu", englishDescription: "P hud_continue: "Continuar (pressiona shift-space)" spell_saved: "Feitiço Guardado" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Visualizações de Admin" diff --git a/app/locale/pt.coffee b/app/locale/pt.coffee index 8907f3239..d52a82b6a 100644 --- a/app/locale/pt.coffee +++ b/app/locale/pt.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "português", englishDescription: "Portugues hud_continue: "Continue (tecle Shift+Space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/ro.coffee b/app/locale/ro.coffee index 707eccbb6..2697f5bb3 100644 --- a/app/locale/ro.coffee +++ b/app/locale/ro.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman hud_continue: "Continuă (apasă shift-space)" spell_saved: "Vrajă salvată" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Admin vede" diff --git a/app/locale/ru.coffee b/app/locale/ru.coffee index 1021d054c..4a9315d28 100644 --- a/app/locale/ru.coffee +++ b/app/locale/ru.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi hud_continue: "Продолжить (Shift+Пробел)" spell_saved: "Заклинание сохранено" skip_tutorial: "Пропуск (Esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Админ панель" diff --git a/app/locale/sk.coffee b/app/locale/sk.coffee index 0746c09bb..74c9e5850 100644 --- a/app/locale/sk.coffee +++ b/app/locale/sk.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak", # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/sl.coffee b/app/locale/sl.coffee index 16e9f1f2a..ca6f003fa 100644 --- a/app/locale/sl.coffee +++ b/app/locale/sl.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "slovenščina", englishDescription: "Sloven # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/sr.coffee b/app/locale/sr.coffee index d7fcf369c..6630a4d02 100644 --- a/app/locale/sr.coffee +++ b/app/locale/sr.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "српски", englishDescription: "Serbian hud_continue: "Настави (притисни ентер)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/sv.coffee b/app/locale/sv.coffee index d5999988d..eaa034fe3 100644 --- a/app/locale/sv.coffee +++ b/app/locale/sv.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "Svenska", englishDescription: "Swedish", tr # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/th.coffee b/app/locale/th.coffee index ee0101df5..7a8384608 100644 --- a/app/locale/th.coffee +++ b/app/locale/th.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "ไทย", englishDescription: "Thai", tra # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/tr.coffee b/app/locale/tr.coffee index 5b5699693..2be1a8c1a 100644 --- a/app/locale/tr.coffee +++ b/app/locale/tr.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "Türkçe", englishDescription: "Turkish", t hud_continue: "Devam (ÜstKarakter+Boşluk)" spell_saved: "Büyü Kaydedildi" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "Yönetici Görünümleri" diff --git a/app/locale/uk.coffee b/app/locale/uk.coffee index fe19433b8..57619748b 100644 --- a/app/locale/uk.coffee +++ b/app/locale/uk.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "українська мова", englishDesc hud_continue: "Продовжити (натисніть shift-space)" spell_saved: "Заклинання збережено" skip_tutorial: "Пропустити (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: # av_title: "Admin Views" diff --git a/app/locale/ur.coffee b/app/locale/ur.coffee index f25261b33..c383d2986 100644 --- a/app/locale/ur.coffee +++ b/app/locale/ur.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "اُردُو", englishDescription: "Urdu", # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/vi.coffee b/app/locale/vi.coffee index 6e9690350..5b956e9af 100644 --- a/app/locale/vi.coffee +++ b/app/locale/vi.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "Tiếng Việt", englishDescription: "Vietn # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/zh-HANS.coffee b/app/locale/zh-HANS.coffee index cf05668c5..c1cafeeba 100644 --- a/app/locale/zh-HANS.coffee +++ b/app/locale/zh-HANS.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "简体中文", englishDescription: "Chinese hud_continue: "继续(按 Shift-空格)" spell_saved: "咒语已保存" skip_tutorial: "跳过(esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." admin: av_title: "管理员视图" diff --git a/app/locale/zh-HANT.coffee b/app/locale/zh-HANT.coffee index 38c864554..2ed2ed41f 100644 --- a/app/locale/zh-HANT.coffee +++ b/app/locale/zh-HANT.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "繁体中文", englishDescription: "Chinese hud_continue: "繼續 (按 shift-空格)" spell_saved: "咒語已儲存" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" diff --git a/app/locale/zh.coffee b/app/locale/zh.coffee index e847517ac..6847da6ed 100644 --- a/app/locale/zh.coffee +++ b/app/locale/zh.coffee @@ -207,6 +207,17 @@ module.exports = nativeDescription: "中文", englishDescription: "Chinese", tra # hud_continue: "Continue (shift+space)" # spell_saved: "Spell Saved" # skip_tutorial: "Skip (esc)" +# editor_config: "Editor Config" +# editor_config_title: "Editor Configuration" +# editor_config_keybindings_label: "Key Bindings" +# editor_config_keybindings_default: "Default (Ace)" +# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors." +# editor_config_invisibles_label: "Show Invisibles" +# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs." +# editor_config_indentguides_label: "Show Indent Guides" +# editor_config_indentguides_description: "Displays vertical lines to see indentation better." +# editor_config_behaviors_label: "Smart Behaviors" +# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes." # admin: # av_title: "Admin Views" From 71aa6cc2c6f29628e12c47acc68914aea6bc677b Mon Sep 17 00:00:00 2001 From: Michael Schmatz Date: Fri, 14 Mar 2014 11:30:04 -0700 Subject: [PATCH 12/16] Added random session pair choosing Due to a bug I cannot test this immediately --- app/views/play/spectate_view.coffee | 30 +++++++++++++++++------ server/levels/level_handler.coffee | 37 +++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 7 deletions(-) diff --git a/app/views/play/spectate_view.coffee b/app/views/play/spectate_view.coffee index 0a935bead..49841a230 100644 --- a/app/views/play/spectate_view.coffee +++ b/app/views/play/spectate_view.coffee @@ -423,14 +423,30 @@ module.exports = class SpectateLevelView extends View onNextGamePressed: (e) -> console.log "You want to see the next game!" - @sessionOne = "53193c8f7a89df21c4d968e9" - @sessionTwo = "531aa613026834331eac5e7e" - url = "/play/spectate/dungeon-arena?session-one=#{@sessionOne}&session-two=#{@sessionTwo}" - Backbone.Mediator.publish 'router:navigate', { - route: url, - viewClass: SpectateLevelView, - viewArgs: [{spectateSessions:{sessionOne: @sessionOne, sessionTwo: @sessionTwo}}, "dungeon-arena"]} + @fetchRandomSessionPair (err, data) => + if err? then return console.log "There was an error fetching the random session pair: #{data}" + @sessionOne = data[0]._id + @sessionTwo = data[1]._id + console.log "Playing session #{@sessionOne} against #{@sessionTwo}" + url = "/play/spectate/dungeon-arena?session-one=#{@sessionOne}&session-two=#{@sessionTwo}" + Backbone.Mediator.publish 'router:navigate', { + route: url, + viewClass: SpectateLevelView, + viewArgs: [{spectateSessions:{sessionOne: @sessionOne, sessionTwo: @sessionTwo}}, "dungeon-arena"]} + fetchRandomSessionPair: (cb) -> + console.log "Fetching random session pair!" + randomSessionPairURL = "/db/level/#{@level.get('original')}.#{@level.get('version').major}/random_session_pair" + $.ajax + url: randomSessionPairURL + type: "GET" + complete: (jqxhr, textStatus) -> + if textStatus isnt "success" + cb("error", jqxhr.statusText) + else + cb(null, $.parseJSON(jqxhr.responseText)) + + diff --git a/server/levels/level_handler.coffee b/server/levels/level_handler.coffee index 4a2bdd24a..fd6bb946f 100644 --- a/server/levels/level_handler.coffee +++ b/server/levels/level_handler.coffee @@ -31,6 +31,8 @@ LevelHandler = class LevelHandler extends Handler return @getLeaderboard(req, res, args[0]) if args[1] is 'leaderboard' return @getMySessions(req, res, args[0]) if args[1] is 'my_sessions' return @getFeedback(req, res, args[0]) if args[1] is 'feedback' + return @getRandomSessionPair(req,res,args[0]) if args[1] is 'random_session_pair' + return @sendNotFoundError(res) fetchLevelByIDAndHandleErrors: (id, req, res, callback) -> @@ -146,6 +148,41 @@ LevelHandler = class LevelHandler extends Handler return @sendDatabaseError(res, err) if err resultSessions ?= [] @sendSuccess res, resultSessions + + getRandomSessionPair: (req, res, id) -> + findParameters = {} + + [original,version] = id.split '.' + version = parseInt(version) ? 0 + + sessionsQueryParameters = + level: + original: original + majorVersion: version + submitted:true + + + query = Session + .find(sessionsQueryParameters) + .select('team') + .lean() + + query.exec (err, resultSessions) => + return @sendDatabaseError res, err if err? or not resultSessions + + teamSessions = _.groupBy resultSessions, 'team' + sessions = [] + numberOfTeams = 0 + for team of teamSessions + numberOfTeams += 1 + sessions.push _.sample(teamSessions[team]) + if numberOfTeams != 2 then return @sendDatabaseError res, "There aren't sessions of 2 teams, so cannot choose random opponents!" + + @sendSuccess res, sessions + + + + validateLeaderboardRequestParameters: (req) -> req.query.order = parseInt(req.query.order) ? -1 From eee4934d1b7c136ddd5ebc8116670e9e86bc11f2 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Fri, 14 Mar 2014 11:57:17 -0700 Subject: [PATCH 13/16] Put back the sort for the leaderboard handler. --- server/levels/level_handler.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/levels/level_handler.coffee b/server/levels/level_handler.coffee index 4a2bdd24a..0874d70df 100644 --- a/server/levels/level_handler.coffee +++ b/server/levels/level_handler.coffee @@ -136,10 +136,11 @@ LevelHandler = class LevelHandler extends Handler 'creatorName' 'creator' ] - + query = Session .find(sessionsQueryParameters) .limit(req.query.limit) + .sort(sortParameters) .select(selectProperties.join ' ') query.exec (err, resultSessions) => From af8008596a2a6cdaf46a73d6ea674bc7f777fb97 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Fri, 14 Mar 2014 11:58:29 -0700 Subject: [PATCH 14/16] Made editing thangs in the level editor not so slow by avoiding calling level.serialize. --- app/views/editor/level/thangs_tab_view.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/editor/level/thangs_tab_view.coffee b/app/views/editor/level/thangs_tab_view.coffee index 0242e3fe7..b948b6107 100644 --- a/app/views/editor/level/thangs_tab_view.coffee +++ b/app/views/editor/level/thangs_tab_view.coffee @@ -330,6 +330,7 @@ module.exports = class ThangsTabView extends View onThangsChanged: (e) => @level.set 'thangs', @thangsTreema.data + return if @editThangView serializedLevel = @level.serialize @supermodel try @world.loadFromLevel serializedLevel, false @@ -381,6 +382,8 @@ module.exports = class ThangsTabView extends View onLevelThangDoneEditing: -> @removeSubView @editThangView + @editThangView = null + @onThangsChanged() @$el.find('.thangs-column').show() From 075ea23be99ed68bd5d80abbf9386bed9b2041f7 Mon Sep 17 00:00:00 2001 From: Michael Schmatz Date: Fri, 14 Mar 2014 12:54:52 -0700 Subject: [PATCH 15/16] Fixed random sessions fetching --- app/views/play/spectate_view.coffee | 22 +++++----- server/levels/level_handler.coffee | 68 +++++++++++++++++------------ 2 files changed, 52 insertions(+), 38 deletions(-) diff --git a/app/views/play/spectate_view.coffee b/app/views/play/spectate_view.coffee index 49841a230..67123d829 100644 --- a/app/views/play/spectate_view.coffee +++ b/app/views/play/spectate_view.coffee @@ -68,17 +68,19 @@ module.exports = class SpectateLevelView extends View @originalOptions = _.cloneDeep(options) console.profile?() if PROFILE_ME super options - if options.spectateSessions? - @sessionOne = options.spectateSessions.sessionOne - @sessionTwo = options.spectateSessions.sessionTwo - else - @sessionOne = @getQueryVariable 'session-one' - @sessionTwo = @getQueryVariable 'session-two' - $(window).on('resize', @onWindowResize) @supermodel.once 'error', @onLevelLoadError - - @load() + + @sessionOne = @getQueryVariable 'session-one' + @sessionTwo = @getQueryVariable 'session-two' + if not @sessionOne or not @sessionTwo + @fetchRandomSessionPair (err, data) => + if err? then return console.log "There was an error fetching the random session pair: #{data}" + @sessionOne = data[0]._id + @sessionTwo = data[1]._id + @load() + else + @load() onLevelLoadError: (e) => application.router.navigate "/play?not_found=#{@levelID}", {trigger: true} @@ -436,7 +438,7 @@ module.exports = class SpectateLevelView extends View fetchRandomSessionPair: (cb) -> console.log "Fetching random session pair!" - randomSessionPairURL = "/db/level/#{@level.get('original')}.#{@level.get('version').major}/random_session_pair" + randomSessionPairURL = "/db/level/#{@levelID}/random_session_pair" $.ajax url: randomSessionPairURL type: "GET" diff --git a/server/levels/level_handler.coffee b/server/levels/level_handler.coffee index ebb01b646..81a5e6166 100644 --- a/server/levels/level_handler.coffee +++ b/server/levels/level_handler.coffee @@ -150,39 +150,51 @@ LevelHandler = class LevelHandler extends Handler resultSessions ?= [] @sendSuccess res, resultSessions - getRandomSessionPair: (req, res, id) -> + getRandomSessionPair: (req, res, slugOrID) -> findParameters = {} - - [original,version] = id.split '.' - version = parseInt(version) ? 0 + if Handler.isID slugOrID + findParameters["_id"] = slugOrID + else + findParameters["slug"] = slugOrID + selectString = 'original version' + query = Level.findOne(findParameters) + .select(selectString) + .lean() - sessionsQueryParameters = - level: - original: original - majorVersion: version - submitted:true - - - query = Session - .find(sessionsQueryParameters) - .select('team') - .lean() - - query.exec (err, resultSessions) => - return @sendDatabaseError res, err if err? or not resultSessions - - teamSessions = _.groupBy resultSessions, 'team' - sessions = [] - numberOfTeams = 0 - for team of teamSessions - numberOfTeams += 1 - sessions.push _.sample(teamSessions[team]) - if numberOfTeams != 2 then return @sendDatabaseError res, "There aren't sessions of 2 teams, so cannot choose random opponents!" + query.exec (err, level) => + return @sendDatabaseError(res, err) if err + return @sendNotFoundError(res) unless level? + + sessionsQueryParameters = + level: + original: level.original.toString() + majorVersion: level.version.major + submitted:true + + console.log sessionsQueryParameters - @sendSuccess res, sessions + query = Session + .find(sessionsQueryParameters) + .select('team') + .lean() + + query.exec (err, resultSessions) => + return @sendDatabaseError res, err if err? or not resultSessions + + teamSessions = _.groupBy resultSessions, 'team' + console.log teamSessions + sessions = [] + numberOfTeams = 0 + for team of teamSessions + numberOfTeams += 1 + sessions.push _.sample(teamSessions[team]) + if numberOfTeams != 2 then return @sendDatabaseError res, "There aren't sessions of 2 teams, so cannot choose random opponents!" + + @sendSuccess res, sessions + + - validateLeaderboardRequestParameters: (req) -> From 07a0057e7264e02bebe5be0bc6420fbd6ee1f948 Mon Sep 17 00:00:00 2001 From: Michael Schmatz Date: Fri, 14 Mar 2014 13:20:42 -0700 Subject: [PATCH 16/16] Removed defaults on schema for ladder-related things --- server/levels/sessions/level_session_schema.coffee | 7 ------- 1 file changed, 7 deletions(-) diff --git a/server/levels/sessions/level_session_schema.coffee b/server/levels/sessions/level_session_schema.coffee index a7d742001..d798a9d88 100644 --- a/server/levels/sessions/level_session_schema.coffee +++ b/server/levels/sessions/level_session_schema.coffee @@ -118,21 +118,16 @@ _.extend LevelSessionSchema.properties, meanStrength: type: 'number' - default: 25 standardDeviation: type:'number' - default: 25/3 minimum: 0 totalScore: type: 'number' - default: 10 submitted: type: 'boolean' - default: false - index:true submitDate: c.date title: 'Submitted' @@ -150,11 +145,9 @@ _.extend LevelSessionSchema.properties, numberOfWinsAndTies: type: 'number' - default: 0 numberOfLosses: type: 'number' - default: 0 scoreHistory: type: 'array'