From 30bc6345e8866dc7b560ecbf7c63bf1783ab3e6d Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 27 Dec 2019 14:12:23 -0500 Subject: [PATCH 01/14] Adding default empty string for privileged IP's It doesn't appear necessary to specifies the privileged IP's in order to run this project locally. Defaulting to an empty string to prevent null point exception --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 111dec20..5ef20457 100644 --- a/server.js +++ b/server.js @@ -44,7 +44,7 @@ var html = ({ title, meta, link }, data, body) => { app.use((req, res, next) => { var actingUrl = req.url.replace(/\/(.*)\/$/, '/$1') - const internalIPs = process.env.PRIVILEGED_IP_LIST + const internalIPs = process.env.PRIVILEGED_IP_LIST || ''; var privilegedClientIP = internalIPs.split(' ').indexOf(req.ip) > -1 window.privilegedClientIP = privilegedClientIP // FIXME how to pass this other than as a global? From 9904b40ef9f8d97980b72b7efc72085b5cdb3f6d Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 27 Dec 2019 14:46:25 -0500 Subject: [PATCH 02/14] Adding sass build scripts. I don't see any scss -> css build steps. I feel like I must be overlooking something but this is an easy fix for now. --- package.json | 3 +++ sass/main.scss | 31 ++++++++++++++++++++++++++++++- sass/reset.scss | 16 +++++++++------- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index f777ea61..70484480 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,8 @@ "watch": "watchify index.js -p livereactload -o bundle.js -dv", "watchServer": "node-supervisor --watch server.js,src server.babel.js", "serve": "PORT=1314 node server.babel.js", + "build-css": "sass ./sass/main.scss ./css/main.css", + "build-css:watch": "sass --watch ./sass/main.scss ./css/main.css", "build": "NODE_ENV=production browserify index.js | uglifyjs -c -m | sed 's|http://localhost:4680|https://search.artsmia.org|'> bundle.js" }, "author": "", @@ -37,6 +39,7 @@ "watchify": "^3.9.0" }, "dependencies": { + "sass": "^1.24.0", "@mapbox/react-click-to-select": "^1.1.1", "babel-polyfill": "^6.23.0", "babel-preset-es2015": "^6.22.0", diff --git a/sass/main.scss b/sass/main.scss index 81caf560..65166552 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -44,6 +44,28 @@ a:hover { font-weight: 500; } +a.skip-main { + left:-999px; + position: fixed; + top:auto; + width:1px; + height:1px; + overflow:hidden; + z-index:-999; +} +a.skip-main:focus, a.skip-main:active { + background-color: white; + position:fixed; + left: 50%; + top: 5px; + width: 200px; + height: 23px; + margin: 10px -100px; + padding:5px; + text-align:center; + z-index:999; +} + #search { /*margin: 8px;*/ } @@ -80,12 +102,19 @@ header{ .quilt-wrap a:hover { overflow: visible !important; // z-index: 100; - + img { overflow: visible !important; } } +// The regular focus style with the dotted red outline doesn't look very good on the quilt images. A white solid border +// seems to be more visible and doesn't clash as much with the images. +.quilt-wrap a:focus { + outline: 0; + border: 2px solid white; +} + .logo-container{ background-image: url("../images/MIA_LOGO_MARK.svg"); background-repeat: no-repeat; diff --git a/sass/reset.scss b/sass/reset.scss index c299c744..99a1e40f 100644 --- a/sass/reset.scss +++ b/sass/reset.scss @@ -1,4 +1,10 @@ -/* reset & clearfix */ +/* reset & clearfix + +Modifications have been to Eric Meyer's Reset: + +1. Outline resets have been removed. This is more consistent with artsmia.org website and encourages better accessibility + +*/ .clearfix:after { visibility: hidden; @@ -25,7 +31,6 @@ table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; - outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; @@ -39,10 +44,7 @@ ol, ul { blockquote, q { quotes: none; } -/* remember to define focus styles! */ -:focus { - outline: 0; -} + /* remember to highlight inserts somehow! */ ins { text-decoration: none; @@ -62,4 +64,4 @@ html { } *, *:before, *:after { box-sizing: inherit; -} \ No newline at end of file +} From 47a7149f0947879d316e2f96a308f6894505eadf Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 27 Dec 2019 14:49:59 -0500 Subject: [PATCH 03/14] Adding label to search input --- .gitignore | 1 + index.html | 4 ++-- src/search.js | 17 ++++++++++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index bc0f10a6..c6649938 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ bundle.js node_modules css node_modules-2018-11-27 +.idea diff --git a/index.html b/index.html index ec4a7df2..461dde88 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ - + - + diff --git a/src/search.js b/src/search.js index eeea063c..598e1f4b 100644 --- a/src/search.js +++ b/src/search.js @@ -11,7 +11,6 @@ var SearchResults = require('./search-results') var Suggest = require('./suggest') var searchLanguageMap = require('./search-language') - var Search = React.createClass({ mixins: [Router.State, Router.Navigation], @@ -51,7 +50,14 @@ var Search = React.createClass({ const idealSearchBoxWidth = Math.max(17, this.state.terms && this.state.terms.length*1.1 || 0) const formProps = universal ? {action: "/search/", method: "get"} : {action: ''} const simpleSearchBox =
-
+ + +
+ /> +
const hideInput = this.props.hideInput && !this.state.activateSearch @@ -74,7 +81,7 @@ var Search = React.createClass({ pointerEvents: 'none', display: hideInput ? 'none' : 'inherit', padding: this.props.bumpSearchBox ? '0.5em' : '0', - position: 'relative', + position: 'relative', zIndex: 4, } @@ -111,7 +118,7 @@ var Search = React.createClass({ var hideSearch = embed return ( -