From 688c4d5aa22877905ec1102423f5f5a75ee2bfc8 Mon Sep 17 00:00:00 2001 From: "Omar S." Date: Mon, 29 Dec 2014 12:40:38 -0500 Subject: [PATCH 1/6] Updated mongo and node --- .../coco-dev-setup/batch/config/downloads.coco | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/windows/coco-dev-setup/batch/config/downloads.coco b/scripts/windows/coco-dev-setup/batch/config/downloads.coco index f8906cbb4..6e7c3beeb 100755 --- a/scripts/windows/coco-dev-setup/batch/config/downloads.coco +++ b/scripts/windows/coco-dev-setup/batch/config/downloads.coco @@ -2,13 +2,13 @@ - http://nodejs.org/dist/v0.10.25/node-v0.10.25-x86.msi + http://nodejs.org/dist/v0.10.35/node-v0.10.35-x86.msi http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353.exe?direct http://s3.amazonaws.com/CodeCombatLargeFiles/python-32.msi http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x86.exe - http://nodejs.org/dist/v0.10.25/x64/node-v0.10.25-x64.msi + http://nodejs.org/dist/v0.10.35/x64/node-v0.10.35-x64.msi http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353-x64.exe?direct http://s3.amazonaws.com/CodeCombatLargeFiles/python-64.msi http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe @@ -20,26 +20,26 @@ - https://fastdl.mongodb.org/win32/mongodb-win32-i386-2.6.0.zip + https://fastdl.mongodb.org/win32/mongodb-win32-i386-2.8.0-rc4.zip - https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.0.zip + https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.8.0-rc4.zip - https://fastdl.mongodb.org/win32/mongodb-win32-i386-2.6.0.zip + https://fastdl.mongodb.org/win32/mongodb-win32-i386-2.8.0-rc4.zip - https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.0.zip + https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.8.0-rc4.zip - https://fastdl.mongodb.org/win32/mongodb-win32-i386-2.6.0.zip + https://fastdl.mongodb.org/win32/mongodb-win32-i386-2.8.0-rc4.zip - https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2.6.0.zip + https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.8.0-rc4.zip From 2b4a02790492e4aa4ae454a296381e95239880e9 Mon Sep 17 00:00:00 2001 From: "Omar S." Date: Mon, 29 Dec 2014 13:28:24 -0500 Subject: [PATCH 2/6] Create es.coco --- .../coco-dev-setup/batch/localization/es.coco | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 scripts/windows/coco-dev-setup/batch/localization/es.coco diff --git a/scripts/windows/coco-dev-setup/batch/localization/es.coco b/scripts/windows/coco-dev-setup/batch/localization/es.coco new file mode 100644 index 000000000..e74ce9400 --- /dev/null +++ b/scripts/windows/coco-dev-setup/batch/localization/es.coco @@ -0,0 +1,108 @@ + + + + Espanol + Espanol + Algunas sugerencias antes de comenzar la instalación: + Presiona cualquier tecla para salir... + + + Has elegido Español como tu idioma. + De ahora en adelante te enviaremos nuestro feedback en Español. + + + Para continuar con la instalación del ambiente de desarrollo + tendrás que leer y estar de acuerdo con la licencia: + ¿Has leído toda la licencia y estás de acuerdo con ella? + Esta instalación no se puede completar sin un acuerdo. + La instalación y configuración del ambiente de CodeCombat ha sido cancelada. + + + + -bit computadora detectada. + El sistema operativo + ha sido detectado. + No soportamos Windows XP, instalación cancelada. + + + ¿Ya has instalado todo el software necesario para instalar CodeCombat? + Te recomendamos que respondas negativamente si no estás seguro. + Saltando la instalación del software... + CodeCombat no pudo ser desarrollo sin third-party software. + Por eso necesitas instalar este software, + para comenzar a contribuir a nuestra comunidad. + Cancela la instalación si ya tienes la aplicación. + Asegúrate de seleccionar la opción que agrega la aplicación al Windows Path, si la opción está disponible. + ¿Ya tienes la última versión + instalada? + está descargando... + está instalando... + está descomprimiendo... + está limpiando... + Por favor especifica la ruta completa donde MongoDB debe ser isntalado + + + + + CodeCombat es opensource, como ya sabes. + Todo nuestro código puede ser encontrada online en GitHub. + Tú puedes instalar Git por tu cuenta. + Pero te recomendamos que nos permitas hacerlo nosotros. + + + ¿Quieres instalar Git por tu cuenta? + Asegurate de haber configurado tu repositorio correctamente. + No cierres estaventana por favor.. + Cuando estés listo, presiona cualquier tecla para continuar... + + + Por favor escriba la ruta completa de tu repositorio de CodeCombat de Git: + Por favor escriba la ruta completa donde quieres que se instale el ambiente de desarrollo de CodeCombat + Estainstalación necesita Git Bash. + Git bash está instalada por default en 'C:\Program Files (x86)\Git'. + Git bash está instalada por default en 'C:\Program Files\Git'. + Por favor escriba la ruta completa donde git bash está instalada o presione enter si está en el lugar default + Quieres revisar el repositorio via ssh? + + + Deberías haber hecho fork a CodeCombat at tu propia cuenta de GitHub... + Por favor ingrese su información de github para configurar el repositorio local. + Usuario: + Contraseña: + Gracias... Configurando tu repositorio local ahora mismo... + + + + ¡La instalación de tu ambiente local exitosa! + Ahora puedes cerrar esta instalación. + Después de esto, deberías abrir la configuración para configurar automáticamente tu ambiente... + + + Instalando bower, brunch, nodemon y sendwithus... + Instalando bower packages... + Instalando sass... + Instalando npm... + Iniciando brunch.... + Configurando una base de datos de MongoDB para ti... + Descargando la última version de la base de datos de CodeCombat... + + ¡No cerrar! + + + ¿Esa ruta ya existe, quieres sobreescribirla? + Esa ruta no existe. Intente de nuevo... + + + La configuración fue exitosa. + Muchas gracias por tu contribución y nos veremos pronto. + ¿Quieres leer el README para más información? + + + Puedes iniciar el ambiente + en un instance + 1) Da doble clickk + y el ambiente de desarrollo iniciará. + 2) Ahora abre 'localhost:3000' en tu browser preferido. + ¡Listo! Ya estás preparado para trabajar en CodeCombat + + From 44b9655639b29a73677ec9aabf62efbde6abaf4e Mon Sep 17 00:00:00 2001 From: "Omar S." Date: Mon, 29 Dec 2014 13:38:18 -0500 Subject: [PATCH 3/6] Update languages.coco --- .../windows/coco-dev-setup/batch/localization/languages.coco | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/windows/coco-dev-setup/batch/localization/languages.coco b/scripts/windows/coco-dev-setup/batch/localization/languages.coco index 2f3e2fe0d..d8e468267 100755 --- a/scripts/windows/coco-dev-setup/batch/localization/languages.coco +++ b/scripts/windows/coco-dev-setup/batch/localization/languages.coco @@ -3,4 +3,5 @@ ru nl de zh-HANT -zh-HANS \ No newline at end of file +zh-HANS +es From b4a39c9b04a1df060fcddf59b7c9ed5f4987ef2c Mon Sep 17 00:00:00 2001 From: "Omar S." Date: Mon, 29 Dec 2014 14:58:26 -0500 Subject: [PATCH 4/6] Update install-mongodb.ps1 I changed the link, but the link is just for 64 bit systems...I don't know if it will work with 32 bit systems --- scripts/windows/install-mongodb.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/windows/install-mongodb.ps1 b/scripts/windows/install-mongodb.ps1 index 503872e99..e667e0ee8 100755 --- a/scripts/windows/install-mongodb.ps1 +++ b/scripts/windows/install-mongodb.ps1 @@ -2,9 +2,9 @@ Set-ExecutionPolicy RemoteSigned $mongoDbPath = "C:\MongoDB" $mongoDbConfigPath = "$mongoDbPath\mongod.cfg" -$url = "http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.4.9.zip" +$url = "http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.8.0-rc4.zip" $zipFile = "$mongoDbPath\mongo.zip" -$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-2.4.9" +$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-2.8.0-rc4.zip" if ((Test-Path -path $mongoDbPath) -eq $True) { @@ -36,4 +36,4 @@ Remove-Item $zipFile -recurse -force & $mongoDBPath\bin\mongod.exe --config $mongoDbConfigPath --install -& net start mongodb \ No newline at end of file +& net start mongodb From 88bc7938fdc4aeb0ab898dd3c8bb6b04e250c4a9 Mon Sep 17 00:00:00 2001 From: "Omar S." Date: Mon, 29 Dec 2014 15:22:49 -0500 Subject: [PATCH 5/6] Updated the links of node for windows, linux and mac --- scripts/devSetup/node.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/devSetup/node.py b/scripts/devSetup/node.py index 8fb1265d8..d6915e8a0 100644 --- a/scripts/devSetup/node.py +++ b/scripts/devSetup/node.py @@ -137,9 +137,9 @@ class LinuxNodeDownloader(NodeDownloader): @property def download_url(self): if self.dependency.config.mem_width == 64: - return u"http://nodejs.org/dist/v0.10.24/node-v0.10.24-linux-x64.tar.gz" + return u"http://nodejs.org/dist/v0.10.35/node-v0.10.35-linux-x64.tar.gz" else: - return u"http://nodejs.org/dist/v0.10.24/node-v0.10.24-linux-x86.tar.gz" + return u"http://nodejs.org/dist/v0.10.35/node-v0.10.35-linux-x86.tar.gz" class WindowsNodeDownloader(NodeDownloader): @property @@ -147,16 +147,16 @@ class WindowsNodeDownloader(NodeDownloader): raise NotImplementedError(u"Needs MSI to be executed to install npm") #"http://nodejs.org/dist/v0.10.24/x64/node-v0.10.24-x64.msi" if self.dependency.config.mem_width == 64: - return u"http://nodejs.org/dist/v0.10.24/x64/node.exe" + return u"http://nodejs.org/dist/v0.10.35/x64/node.exe" else: - return u"http://nodejs.org/dist/v0.10.24/node.exe" + return u"http://nodejs.org/dist/v0.10.35/node.exe" class MacNodeDownloader(NodeDownloader): @property def download_url(self): if self.dependency.config.mem_width == 64: - return u"http://nodejs.org/dist/v0.10.24/node-v0.10.24-darwin-x64.tar.gz" + return u"http://nodejs.org/dist/v0.10.35/node-v0.10.35-darwin-x64.tar.gz" else: - return u"http://nodejs.org/dist/v0.10.24/node-v0.10.24-darwin-x86.tar.gz" + return u"http://nodejs.org/dist/v0.10.35/node-v0.10.35-darwin-x86.tar.gz" From 1440584633ef0f6ebe9ef387adf9204eda009d20 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Mon, 29 Dec 2014 12:46:14 -0800 Subject: [PATCH 6/6] Added tasks to campaign editor; fixed/added campaign editor level click/double-click handling; improved campaign editor level Treema status view formatting. --- app/schemas/models/campaign.schema.coffee | 3 ++ .../editor/campaign/campaign-editor-view.sass | 13 +++---- .../editor/campaign/campaign-level-view.sass | 13 +++++++ .../editor/campaign/campaign-level-view.jade | 15 +++++++- .../editor/campaign/CampaignEditorView.coffee | 34 +++++++++++++++++-- .../editor/campaign/CampaignLevelView.coffee | 15 +++++--- app/views/play/CampaignView.coffee | 10 +++++- 7 files changed, 84 insertions(+), 19 deletions(-) create mode 100644 app/styles/editor/campaign/campaign-level-view.sass diff --git a/app/schemas/models/campaign.schema.coffee b/app/schemas/models/campaign.schema.coffee index f955be498..d99e19684 100644 --- a/app/schemas/models/campaign.schema.coffee +++ b/app/schemas/models/campaign.schema.coffee @@ -107,8 +107,11 @@ _.extend CampaignSchema.properties, { level: { type: 'string', links: [{rel: 'db', href: '/db/level/{($)}/version'}], format: 'latest-version-original-reference' } type: { enum: ['heroes', 'items', 'levels'] } }} + campaign: c.shortString title: 'Campaign', description: 'Which campaign this level is part of (like "desert").', format: 'hidden' # Automatically set by campaign editor. + tasks: c.array {title: 'Tasks', description: 'Tasks to be completed for this level.'}, c.task + #- normal properties position: c.point2d() } diff --git a/app/styles/editor/campaign/campaign-editor-view.sass b/app/styles/editor/campaign/campaign-editor-view.sass index cdee91359..8ce962a8d 100644 --- a/app/styles/editor/campaign/campaign-editor-view.sass +++ b/app/styles/editor/campaign/campaign-editor-view.sass @@ -10,6 +10,10 @@ .treema-root max-height: 100% overflow: scroll + + .completion + position: absolute + right: 0 #right-column position: absolute @@ -17,12 +21,3 @@ bottom: 0 right: 0 width: 75% - - #campaign-level-view - position: absolute - top: 0 - left: 0 - right: 0 - bottom: 0 - background-color: white - z-index: 3 \ No newline at end of file diff --git a/app/styles/editor/campaign/campaign-level-view.sass b/app/styles/editor/campaign/campaign-level-view.sass new file mode 100644 index 000000000..7e9f8e686 --- /dev/null +++ b/app/styles/editor/campaign/campaign-level-view.sass @@ -0,0 +1,13 @@ +#campaign-level-view + background-color: white + position: absolute + top: 0 + left: 0 + right: 0 + z-index: 3 + + .tasks + padding: 15px + + .button.close + font-size: 63px diff --git a/app/templates/editor/campaign/campaign-level-view.jade b/app/templates/editor/campaign/campaign-level-view.jade index fd2723d52..e9163581c 100644 --- a/app/templates/editor/campaign/campaign-level-view.jade +++ b/app/templates/editor/campaign/campaign-level-view.jade @@ -1,4 +1,17 @@ .jumbotron .button.close(type="button", aria-hidden="true") × - h1= level.get('name') + h1 + span.spr= level.get('name') + a(href="/editor/level/#{level.get('slug')}", target="_blank") (edit) p= level.get('description') + + h2 TODO: actually put useful stuff in here + +if level.get('tasks') + .tasks + h3 Tasks (read only) + ul.list-unstyled + for task in level.get('tasks') + li + input(type='checkbox', checked=task.complete) + span.spl= task.name diff --git a/app/views/editor/campaign/CampaignEditorView.coffee b/app/views/editor/campaign/CampaignEditorView.coffee index 387699ed6..d320b6d8c 100644 --- a/app/views/editor/campaign/CampaignEditorView.coffee +++ b/app/views/editor/campaign/CampaignEditorView.coffee @@ -164,6 +164,7 @@ module.exports = class CampaignEditorView extends RootView @listenTo @campaignView, 'level-moved', @onCampaignLevelMoved @listenTo @campaignView, 'adjacent-campaign-moved', @onAdjacentCampaignMoved @listenTo @campaignView, 'level-clicked', @onCampaignLevelClicked + @listenTo @campaignView, 'level-double-clicked', @onCampaignLevelDoubleClicked @insertSubView @campaignView onTreemaChanged: (e, nodes) => @@ -188,8 +189,7 @@ module.exports = class CampaignEditorView extends RootView path = node.getPath() return unless _.string.startsWith path, '/levels/' original = path.split('/')[2] - level = @supermodel.getModelByOriginal Level, original - @insertSubView new CampaignLevelView({}, level) + @openCampaignLevelView @supermodel.getModelByOriginal Level, original onCampaignLevelMoved: (e) -> path = "levels/#{e.levelOriginal}/position" @@ -204,6 +204,14 @@ module.exports = class CampaignEditorView extends RootView levelTreema.select() # levelTreema.open() + onCampaignLevelDoubleClicked: (levelOriginal) -> + @openCampaignLevelView @supermodel.getModelByOriginal Level, levelOriginal + + openCampaignLevelView: (level) -> + @insertSubView campaignLevelView = new CampaignLevelView({}, level) + @listenToOnce campaignLevelView, 'hidden', => @$el.find('#campaign-view').show() + @$el.find('#campaign-view').hide() + updateRewardsForLevel: (level, rewards) -> achievements = @supermodel.getModels(Achievement) achievements = (a for a in achievements when a.get('related') is level.get('original')) @@ -250,7 +258,27 @@ class LevelsNode extends TreemaObjectNode class LevelNode extends TreemaObjectNode valueClass: 'treema-level' buildValueForDisplay: (valEl, data) -> - @buildValueForDisplaySimply valEl, data.name + name = data.name + if data.requiresSubscription + name = "[P] " + name + + status = '' + el = 'strong' + if data.adminOnly + status += " (disabled)" + el = 'span' + else if data.adventurer + status += " (adventurer)" + + completion = '' + if data.tasks + completion = "#{(t for t in data.tasks when t.complete).length} / #{data.tasks.length}" + + valEl.append $("<#{el}>").addClass('treema-shortened').text name + if status + valEl.append $('').text status + if completion + valEl.append $('').text completion populateData: -> return if @data.name? diff --git a/app/views/editor/campaign/CampaignLevelView.coffee b/app/views/editor/campaign/CampaignLevelView.coffee index b27c02aeb..1accea6a4 100644 --- a/app/views/editor/campaign/CampaignLevelView.coffee +++ b/app/views/editor/campaign/CampaignLevelView.coffee @@ -1,19 +1,24 @@ CocoView = require 'views/core/CocoView' +Level = require 'models/Level' module.exports = class CampaignLevelView extends CocoView id: 'campaign-level-view' template: require 'templates/editor/campaign/campaign-level-view' - + events: 'click .close': 'onClickClose' - + constructor: (options, @level) -> super(options) - + @fullLevel = new Level _id: @level.id + @fullLevel.fetch() + @listenToOnce @fullLevel, 'sync', => @render?() + getRenderData: -> c = super() - c.level = @level + c.level = if @fullLevel.loaded then @fullLevel else @level c onClickClose: -> - @$el.addClass('hidden') \ No newline at end of file + @$el.addClass('hidden') + @trigger 'hidden' diff --git a/app/views/play/CampaignView.coffee b/app/views/play/CampaignView.coffee index 27cd0cea7..9e7d390dd 100644 --- a/app/views/play/CampaignView.coffee +++ b/app/views/play/CampaignView.coffee @@ -34,6 +34,7 @@ module.exports = class CampaignView extends RootView events: 'click .map-background': 'onClickMap' 'click .level a': 'onClickLevel' + 'dblclick .level a': 'onDoubleClickLevel' 'click .level-info-container .start-level': 'onClickStartLevel' 'mouseenter .level a': 'onMouseEnterLevel' 'mouseleave .level a': 'onMouseLeaveLevel' @@ -236,8 +237,9 @@ module.exports = class CampaignView extends RootView @$levelInfo?.hide() levelElement = $(e.target).parents('.level') levelSlug = levelElement.data('level-slug') + levelOriginal = levelElement.data('level-original') if @editorMode - return @trigger 'level-clicked', levelSlug + return @trigger 'level-clicked', levelOriginal level = _.find _.values(@campaign.get('levels')), slug: levelSlug if application.isIPadApp @$levelInfo = @$el.find(".level-info-container[data-level-slug=#{levelSlug}]").show() @@ -256,6 +258,12 @@ module.exports = class CampaignView extends RootView @startLevel levelElement window.tracker?.trackEvent 'Clicked Level', category: 'World Map', levelID: levelSlug, ['Google Analytics'] + onDoubleClickLevel: (e) -> + return unless @editorMode + levelElement = $(e.target).parents('.level') + levelOriginal = levelElement.data('level-original') + @trigger 'level-double-clicked', levelOriginal + onClickStartLevel: (e) -> levelElement = $(e.target).parents('.level-info-container') @startLevel levelElement