From f49a674566dc5dec5401d10fb513d110e37bf709 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Mon, 6 Feb 2017 03:41:28 +0000 Subject: [PATCH] tweaks for developing on this branch --- app/assets/javascripts/lib/cloudcarousel.js | 51 ++++++++----------- .../stylesheets/metacode-select.scss.erb | 42 --------------- app/policies/map_policy.rb | 2 +- webpack.config.js | 4 +- 4 files changed, 25 insertions(+), 74 deletions(-) delete mode 100644 app/assets/stylesheets/metacode-select.scss.erb diff --git a/app/assets/javascripts/lib/cloudcarousel.js b/app/assets/javascripts/lib/cloudcarousel.js index 52a26539..9f26592a 100644 --- a/app/assets/javascripts/lib/cloudcarousel.js +++ b/app/assets/javascripts/lib/cloudcarousel.js @@ -164,17 +164,16 @@ jQuery.browser = browser; // START METAMAPS CODE // Add code that makes tab and shift+tab scroll through metacodes $('.new_topic').bind('keydown',this,function(event){ - if (event.keyCode == 9 && event.shiftKey) { - $(container).show() - event.data.rotate(-1); - event.preventDefault(); - event.stopPropagation(); - } else if (event.keyCode == 9) { - $(container).show() - event.data.rotate(1); - event.preventDefault(); - event.stopPropagation(); - } + if (event.keyCode == 9) { + if (event.shiftKey) { + event.data.rotate(-1) + } else { + event.data.rotate(1) + } + event.preventDefault(); + event.stopPropagation(); + Metamaps.Create.newTopic.metacode = $(items[event.data.frontIndex].image).attr('data-id'); + } }); // END METAMAPS CODE @@ -182,14 +181,14 @@ jQuery.browser = browser; if (options.mouseWheel) { // START METAMAPS CODE - /*$('body').bind('mousewheel',this,function(event, delta) { - if (Metamaps.Create.newTopic.beingCreated && - !Metamaps.Create.isSwitchingSet && - !Metamaps.Create.newTopic.pinned) { - event.data.rotate(delta); - return false; - } - });*/ + $('body').bind('mousewheel',this,function(event, delta) { + if (Metamaps.Create.newTopic.beingCreated && + !Metamaps.Create.isSwitchingSet && + !Metamaps.Create.newTopic.pinned) { + event.data.rotate(delta); + return false; + } + }); // END METAMAPS CODE // ORIGINAL CODE // $(container).bind('mousewheel',this,function(event, delta) { @@ -256,11 +255,8 @@ jQuery.browser = browser; this.showFrontText = function() { if ( items[this.frontIndex] === undefined ) { return; } // Images might not have loaded yet. - // METAMAPS CODE - Metamaps.Create.newTopic.setMetacode($(items[this.frontIndex].image).attr('data-id')) - // NOT METAMAPS CODE - //$(options.titleBox).html( $(items[this.frontIndex].image).attr('title')); - //$(options.altBox).html( $(items[this.frontIndex].image).attr('alt')); + $(options.titleBox).html( $(items[this.frontIndex].image).attr('title')); + $(options.altBox).html( $(items[this.frontIndex].image).attr('alt')); }; this.go = function() @@ -273,10 +269,7 @@ jQuery.browser = browser; this.stop = function() { clearTimeout(this.controlTimer); - this.controlTimer = 0; - // METAMAPS CODE - $(container).hide() - // END METAMAPS CODE + this.controlTimer = 0; }; @@ -397,7 +390,7 @@ jQuery.browser = browser; } // If all images have valid widths and heights, we can stop checking. clearInterval(this.tt); - // METAMAPS COMMENT this.showFrontText(); + this.showFrontText(); this.autoRotate(); this.updateAll(); diff --git a/app/assets/stylesheets/metacode-select.scss.erb b/app/assets/stylesheets/metacode-select.scss.erb deleted file mode 100644 index 41b98c9c..00000000 --- a/app/assets/stylesheets/metacode-select.scss.erb +++ /dev/null @@ -1,42 +0,0 @@ -#metacodeSelector { - display: none; -} - -.metacodeSelect { - border-top: 1px solid #DDD; - padding: 0; - background: #FFF; - - .metacodeFilterInput { - width: 100px; - outline: none; - border: 0; - padding: 8px; - font-size: 14px; - line-height: 14px; - color: #424242; - font-family: 'din-medium', helvetica, sans-serif; - } - - .metacodeList { - list-style: none; - background: #FFF; - - li { - padding: 8px; - cursor: pointer; - - &:hover, &.keySelect { - background: #4CAF50; - } - } - - img { - width: 24px; - height: 24px; - display: inline-block; - vertical-align: middle; - padding-right: 6px; - } - } -} diff --git a/app/policies/map_policy.rb b/app/policies/map_policy.rb index fb9cfdca..924f0951 100644 --- a/app/policies/map_policy.rb +++ b/app/policies/map_policy.rb @@ -22,7 +22,7 @@ class MapPolicy < ApplicationPolicy end def conversation? - show? && %w(connorturland@gmail.com devin@callysto.com chessscholar@gmail.com solaureum@gmail.com ishanshapiro@gmail.com).include?(user.email) + show? && %w(admin@admin.com user@user.com connorturland@gmail.com devin@callysto.com chessscholar@gmail.com solaureum@gmail.com ishanshapiro@gmail.com).include?(user.email) end def create? diff --git a/webpack.config.js b/webpack.config.js index 13cf6a65..f468b1d1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -40,10 +40,10 @@ module.exports = { ] }, entry: { - 'metamaps.bundle': './frontend/src/index.js' + 'metamaps.secret.bundle': './frontend/src/index.js' }, output: { - path: './app/assets/javascripts/webpacked', + path: './app/assets/javascripts', filename: '[name].js', devtoolModuleFilenameTemplate: '[absolute-resource-path]' }