From 6bcee59e516afccec80a2fdc2b4bd21d29276b73 Mon Sep 17 00:00:00 2001 From: Andrew Fox Date: Fri, 29 Jan 2016 11:10:33 -0800 Subject: [PATCH 1/4] correct errors in css code and refactor file to for consistency and standards compliance --- visitor_motivation_survey/vms.css | 208 ++++++++++++++++++++++++------ 1 file changed, 170 insertions(+), 38 deletions(-) diff --git a/visitor_motivation_survey/vms.css b/visitor_motivation_survey/vms.css index 0451e35..ba9ca6c 100755 --- a/visitor_motivation_survey/vms.css +++ b/visitor_motivation_survey/vms.css @@ -1,54 +1,186 @@ -.vms { background: gray; color: black; margin: 0; padding: .5em 1em; border-top: 2px solid black; font-size: 16px; line-height: 1.1; font-weight: bold; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; -webkit-text-size-adjust: 100% } -.vms.open { top: 0; border-top: none; overflow: scroll; -webkit-overflow-scrolling: touch; } - -.vms .margin {margin: auto; max-width: 924px; } -.vms a {color: white; text-decoration: none; !important} -.vms a:hover {color: #ccc; text-decoration: none; !important} -.vms a.active {color: #fff;} -.vms p {margin: 0; font-size: 1em !important;} -.vms ul {list-style: none; margin: 1em 0 0 0; padding: 0; } -.vms li { margin: 0 0 .5em 0; padding: none; } - -.vms .clickable {cursor: pointer;} - -.vms .xbutton { color: #fff; font-size: .66em; float: right; margin: .4em 0 0 0; cursor: pointer; line-height: 1; text-transform: uppercase;} -.vms .xbutton:hover { color: black; } -.vms .xbutton span { font-size: 1.25em; line-height: 0; margin-left: .25em; } -.vms .xbutton.shrink {display: none; } -.vms .xbutton.finish {display: none; } - -.vms .prompt { color: black;} -.vms .prompt span { color: white; display: block; } - -.vms .survey { display: none; overflow: hidden;} -.vms .survey p { margin-top: 1em; font-size: 1em} +.vms { + background: gray; + color: black; + margin: 0; + padding: .5em 1em; + border-top: 2px solid black; + font-size: 16px; + line-height: 1.1; + font-weight: bold; + position: fixed; + left: 0; + right: 0; + bottom: 0; + z-index: 100; + -webkit-text-size-adjust: 100%; +} +.vms.open { + top: 0; + border-top: none; + overflow: scroll; + -webkit-overflow-scrolling: touch; +} + +.vms .margin { + margin: auto; + max-width: 924px; +} + +.vms a { + color: white; + text-decoration: none !important; +} + +.vms a:hover { + color: #ccc; + text-decoration: none !important; +} + +.vms a.active { + color: #fff; +} + +.vms p { + margin: 0; + font-size: 1em !important; +} + +.vms ul { + list-style: none; + margin: 1em 0 0 0; + padding: 0; + +} + +.vms li { + margin: 0 0 .5em 0; + padding: 0; +} + +.vms .clickable { + cursor: pointer; +} + +.vms .xbutton { + color: #fff; + font-size: .66em; + float: right; + margin: .4em 0 0 0; + cursor: pointer; + line-height: 1; + text-transform: uppercase; +} + +.vms .xbutton:hover { + color: black; +} + +.vms .xbutton span { + font-size: 1.25em; + line-height: 0; + margin-left: .25em; +} + +.vms .xbutton.shrink { + display: none; +} + +.vms .xbutton.finish { + display: none; +} + +.vms .prompt { + color: black; +} + +.vms .prompt span { + color: white; display: block; +} + +.vms .survey { + display: none; + overflow: hidden; +} + +.vms .survey p { + margin-top: 1em; + font-size: 1em; +} -.vms .survey li a { color: #ccc !important } -.vms .survey li a:hover { color: #BBC428 !important } +.vms .survey li a { + color: #ccc !important; +} + +.vms .survey li a:hover { + color: #BBC428 !important; +} -.vms .survey .done {color: transparent; margin: 1em 0; } -.vms .survey .done.clickable {color: white; } +.vms .survey .done { + color: transparent; + margin: 1em 0; +} + +.vms .survey .done.clickable { + color: white; +} + +.vms .survey p.infobutton { + font-size: .9em; + margin-bottom: 0; +} -.vms .survey p.infobutton {font-size: .9em; margin-bottom: 0; } -.vms .survey p.infotext {display: none; font-size: .8em !important; margin: 0; } -.vms .survey p.infotext a { color: #ccc; } +.vms .survey p.infotext { + display: none; + font-size: .8em !important; + margin: 0; +} + +.vms .survey p.infotext a { + color: #ccc; +} -.vms .mquery { float: right; } +.vms .mquery { + float: right; +} @media screen and (min-width: 500px) { - .vms .prompt span { display: inline; } + + .vms .prompt span { + display: inline; + } + } @media screen and (min-width: 570px) { - .vms, .vms p { font-size: 18px; } + + .vms, .vms p { + font-size: 18px; + } + } @media screen and (min-width: 700px) { - .vms.open { top: auto; border-top: 2px solid black; overflow: auto; } - .vms li { margin-bottom: 0; } - .vms .mquery { float: left; } + .vms.open { + top: auto; + border-top: 2px solid black; + overflow: auto; + } + + .vms li { + margin-bottom: 0; + } + + .vms .mquery { + float: left; + } + } @media screen and (min-width: 800px) { - .vms, .vms p { font-size: 20px; } + + .vms, + .vms p { + font-size: 20px; + } + } From 4497826da12c3048f6a2dc5536428cc3e4c07dad Mon Sep 17 00:00:00 2001 From: Andrew Fox Date: Fri, 29 Jan 2016 14:49:16 -0800 Subject: [PATCH 2/4] add Drupal $site_name variable to template --- .../visitor_motivation_survey.module | 47 ++++++++----------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/visitor_motivation_survey/visitor_motivation_survey.module b/visitor_motivation_survey/visitor_motivation_survey.module index d75bb52..1c2c47d 100644 --- a/visitor_motivation_survey/visitor_motivation_survey.module +++ b/visitor_motivation_survey/visitor_motivation_survey.module @@ -33,34 +33,25 @@ function visitor_motivation_survey_help($path, $arg) { function visitor_motivation_survey_page_alter(&$page) { if (!path_is_admin(current_path())) { $page['content']['vms'] = array( - '#markup' => ' -
-
Not now ×
-
Close ×
-
Close ×
-
-
-
Answer one question. Improve our website.
-
-

Today, I’m visiting the [museum name] website:

- -

Done. Thank you!

-

What is this?

-

We’re always looking for ways to improve our site, so we want to know why you’re here and how we can help you find the information you need. For specific questions or comments about our website or this survey, please contact us. Thanks for your help!

-
-
-
-
-
- ', - '#weight' => 120 - ); + '#theme' => 'visitor_motivation_survey', + '#weight' => 120, + ); } +} + +/** +* Implements hook_theme(). +* +*/ +function visitor_motivation_survey_theme() { + return array( + 'visitor_motivation_survey' => array( + 'variables' => array( + 'site_name' => variable_get('site_name', 'drupal'), + ), + // Use a template file called visitor_motivation_survey.tpl.php + 'template' => 'visitor_motivation_survey', + ), + ); } From fc0a144212208da26e34458fc31883b137d0483e Mon Sep 17 00:00:00 2001 From: Andrew Fox Date: Fri, 29 Jan 2016 14:51:35 -0800 Subject: [PATCH 3/4] move markup to themeable template file --- .../visitor_motivation_survey.tpl.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 visitor_motivation_survey/visitor_motivation_survey.tpl.php diff --git a/visitor_motivation_survey/visitor_motivation_survey.tpl.php b/visitor_motivation_survey/visitor_motivation_survey.tpl.php new file mode 100644 index 0000000..a65baa6 --- /dev/null +++ b/visitor_motivation_survey/visitor_motivation_survey.tpl.php @@ -0,0 +1,32 @@ + + +
+
Not now ×
+
Close ×
+
Close ×
+
+
+
Answer one question. Improve our website.
+
+

Today, I’m visiting the website:

+ +

Done. Thank you!

+

What is this?

+

We’re always looking for ways to improve our site, so we want to know why you’re here and how we can help you find the information you need. For specific questions or comments about our website or this survey, please contact us. Thanks for your help!

+
+
+
+
+
From 2e1315f004437722cb33f3527d350fc227e5e289 Mon Sep 17 00:00:00 2001 From: Andrew Fox Date: Tue, 9 Feb 2016 16:05:22 -0800 Subject: [PATCH 4/4] add Drupal readme --- visitor_motivation_survey/js.cookie.js | 0 visitor_motivation_survey/readme.txt | 36 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) mode change 100755 => 100644 visitor_motivation_survey/js.cookie.js create mode 100644 visitor_motivation_survey/readme.txt diff --git a/visitor_motivation_survey/js.cookie.js b/visitor_motivation_survey/js.cookie.js old mode 100755 new mode 100644 diff --git a/visitor_motivation_survey/readme.txt b/visitor_motivation_survey/readme.txt new file mode 100644 index 0000000..69d8bf6 --- /dev/null +++ b/visitor_motivation_survey/readme.txt @@ -0,0 +1,36 @@ +-------------------------------------------------------------------------------- +Visitor Motivation Survey for Drupal 7.x +By Andrew Fox, Fine Arts Museums of San Francisco - afox@famsf.org +Based on work by Chris Brown at Yerba Buena Center for the Arts +-------------------------------------------------------------------------------- + +DESCRIPTION: +This module implements the Visitor Motivation Survey (VMS) for museum websites +by Marty Spellerberg (https://github.com/spellerberg/vms). + +-------------------------------------------------------------------------------- + +REQUIREMENTS: +jQuery Update module (https://www.drupal.org/project/jquery_update). +The survey requires jQuery 1.7 or higher. + +-------------------------------------------------------------------------------- + +INSTALLATION: +Put this module in your sites/all/modules directory and enable it at +admin/modules. + +-------------------------------------------------------------------------------- + +CONFIGURATION: +Right now there are no configuration options for this module. It pulls the +Drupal site name ($site_name) into the template and uses it to customize the +survey content. If you wish to further customize this, you can copy the +visitor_motivation_survey.tpl.php file into your theme and edit it there. You +can also override the module css (located in vms.css) in your theme css. + +-------------------------------------------------------------------------------- + +NOTE: +You must be participating in the VMS program for this survey to have any +meaningful use for your website!