Skip to content

Commit

Permalink
Bug #6, fix to survey-embed Javascript/LESS; browser-compat [iet:10…
Browse files Browse the repository at this point in the history
…276684]

* Plus, add `os.hostname()` to build timestamp
  • Loading branch information
nfreear committed Dec 5, 2017
1 parent d774feb commit e899422
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
4 changes: 3 additions & 1 deletion bin/_ver.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
*/

const replace = require('replace');
const os = require('os');
// const INDEX_JS = path('/../js/index.js');
const DIST_JS = path('/../dist.js');
const DIST_CSS = path('/../style/ouop-styles.css');
const TS = new Date().toISOString().replace(/\.\d+Z/, 'Z'); // Strip milli-seconds!
const TS = (new Date()).toISOString().replace(/\.\d+Z/, 'Z')
+ ' (%s)'.replace(/%s/, os.hostname()); // Strip milli-seconds!

console.warn('BUILD_TIME :', TS);

Expand Down
5 changes: 2 additions & 3 deletions js/src/browser-compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ module.exports = function ($, resp) {
var no_compat_regex = resp.config.no_compat_regex || / (MSIE |Trident\/|Edge\/)\d+/;
var $notify = $('#user-notifications');
var str = resp.strings;
var url = str.no_ua_compat_url || 'https://browsehappy.com/';
var no_compat_msg = str.no_ua_compat_msg || 'Sorry! This browser isn\'t supported by this TeSLA study. Would you like to try <a href="%s">a different browser</a>?';
var no_compat_msg = str.no_ua_compat_msg || 'Sorry! Your browser isn\'t supported by this TeSLA study. Would you like to try <a href="%s">a different browser</a>?';
var m_agent = agent.match(no_compat_regex);

if (m_agent) {
no_compat_msg = no_compat_msg.replace(/%s/, url);
no_compat_msg = no_compat_msg.replace(/%s/, str.no_ua_compat_url);

$notify.prepend('<div class="alert alert-danger ouop-no-ua-compat-msg">%s</div>'.replace(/%s/, no_compat_msg));
}
Expand Down
3 changes: 2 additions & 1 deletion js/src/survey-embed-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function embed_pilot_surveys ($, resp) {
var survey_urls = resp.survey_urls;
var survey_url = url.match(/-pre-survey-/) ? survey_urls.pre : survey_urls.post;
var m_height = url.match(/height=(\d+\w+);?/);
var height = 'height: ' + (m_height ? m_height[ 1 ] : '1050px;');
var height = m_height ? ('height: '+ m_height[ 1 ]) : '';

survey_url = survey_url.replace(/\{?OUCU\}?/, resp.profile.ouop_oucu).replace(/\{COURSE\}/gi, resp.course_code);

Expand All @@ -57,6 +57,7 @@ function embed_pilot_surveys ($, resp) {
})); // .replace(/%s/, survey_url).replace(/%h/, height).replace(/%d/, idx)

var $iframe = $('#ifr-' + idx).addClass('ouop-pilot-survey-ifr');
$('body').addClass('ouop-has-pilot-survey-ifr');

C.warn('ouop: pilot-survey-embeds', idx, survey_url, $iframe);
});
Expand Down
2 changes: 1 addition & 1 deletion lang/en/auth_ouopenid.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<p>Please <a href="{$a}">complete the short and important post-activity questionnaire</a>.</p>
<p>Thank you! Your participation is very much appreciated.</p>';
$string[ 'no_ua_compat_msg' ] =
'Sorry! This browser isn\'t supported by this TeSLA study.
'Sorry! Your browser isn\'t supported by this TeSLA study.
Would you like to try <a href="%s">a different browser</a>?';
$string[ 'no_ua_compat_url' ] = 'https://browsehappy.com/';

Expand Down
17 changes: 17 additions & 0 deletions style/ouop-styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,31 @@ div[ data-region = drawer ] {
// }

.ouop-pilot-survey-ifr {
min-height: 1600px; // Was: 1050px;
min-width: 560px;
max-width: 820px;
}

.ouop-has-pilot-survey-ifr {

#region-main .generalbox.p-y-1 {
margin-bottom: 0;
padding-bottom: 0 !important;
}

#page-footer {
display: none;
}
}

iframe.ouop-consent-doc {
height: 52em;
}

#rogion-main .modified {
font-size: small;
}

@media (max-width: 767px) {

#page {
Expand Down

0 comments on commit e899422

Please sign in to comment.