From 667ea35d0c4d0d39c79325326773824643b8d4ac Mon Sep 17 00:00:00 2001 From: Phoenix Eliot Date: Fri, 16 Sep 2016 18:18:03 -0700 Subject: [PATCH] The front page loads! No translated text though. --- app/app.js | 3 +++ app/core/Router.coffee | 2 +- app/templates/play/modal/buy-gems-modal.jade | 2 +- vendor/scripts/keymaster.js | 5 +---- webpack.config.js | 3 ++- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/app.js b/app/app.js index 4bc53b808..0c1036e0c 100644 --- a/app/app.js +++ b/app/app.js @@ -17,6 +17,9 @@ window.TreemaUtils = require('../bower_components/treema/treema-utils.js'); window.moment = require('moment'); window.$.i18n = require('../bower_components/i18next/i18next.js'); require('../vendor/scripts/idle.js').createjs; +window.key = require('../vendor/scripts/keymaster.js'); +require('../vendor/scripts/jquery.noty.packaged.min.js'); +require('bootstrap/dist/js/bootstrap'); require('./core/Router.coffee'); diff --git a/app/core/Router.coffee b/app/core/Router.coffee index 8750dbb77..afe07b68a 100644 --- a/app/core/Router.coffee +++ b/app/core/Router.coffee @@ -204,7 +204,7 @@ module.exports = class CocoRouter extends Backbone.Router window.currentView.onLeaveMessage = _.noop # to stop repeat confirm calls path = 'play/CampaignView' if window.serverConfig.picoCTF and not /^(views)?\/?play/.test(path) - path = "views/#{path}" if not _.string.startsWith(path, 'views/') + # path = "views/#{path}" if not _.string.startsWith(path, 'views/') ViewClass = @tryToLoadModule path if not ViewClass and application.moduleLoader.load(path) @listenToOnce application.moduleLoader, 'load-complete', -> diff --git a/app/templates/play/modal/buy-gems-modal.jade b/app/templates/play/modal/buy-gems-modal.jade index e5c603a28..7f10ba8f3 100644 --- a/app/templates/play/modal/buy-gems-modal.jade +++ b/app/templates/play/modal/buy-gems-modal.jade @@ -9,7 +9,7 @@ else if (me.get('preferredLanguage',true) || 'en-US').split('-')[0] == 'nl' - img(src="/images/pages/play/modal/lang-nl/buy-gems-background-NL.png")#buy-gems-background) + img(src="/images/pages/play/modal/lang-nl/buy-gems-background-NL.png")#buy-gems-background else img(src="/images/pages/play/modal/buy-gems-background.png")#buy-gems-background h1(data-i18n="play.buy_gems") diff --git a/vendor/scripts/keymaster.js b/vendor/scripts/keymaster.js index 1a5d6ab9b..429a4c865 100644 --- a/vendor/scripts/keymaster.js +++ b/vendor/scripts/keymaster.js @@ -2,7 +2,6 @@ // (c) 2011-2013 Thomas Fuchs // keymaster.js may be freely distributed under the MIT license. -;(function(global){ var k, _handlers = {}, _mods = { 16: false, 18: false, 17: false, 91: false }, @@ -96,7 +95,7 @@ // see if it's in the current scope - // Changed this for CodeCombat + // Changed this for CodeCombat //if(handler.scope == scope || handler.scope == 'all'){ if (true) { // check if modifiers match if any @@ -295,5 +294,3 @@ global.key.unbind = unbindKey; if(typeof module !== 'undefined') module.exports = key; - -})(this); \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 287d302fa..d087fb536 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -19,7 +19,8 @@ module.exports = { plugins: [ new webpack.ContextReplacementPlugin(/./, function(context){ if (context.resource === path.resolve('./app/views')) { - context.regExp = /home/i + console.log(context.regExp); + context.regExp = /^.*Home.*$/i; } console.log(arguments); }),