-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathtemplate.js
executable file
·579 lines (504 loc) · 23 KB
/
template.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
/*
*
* BootstrapForLimeSurvey
* A Responsive LimeSurvey Template Based On Bootstrap
* (c) 2013-2018 mofog (http://mofog.github.io/BootstrapForLimeSurvey)
*
*/
(function waitForBfls(){
setTimeout(function(){
if (!(typeof bfls === 'undefined')) {
bfls(document).ready(function(){
// Setup Dialogs
setupAlertDialog();
setupConfirmDialog();
//Fix LimeSurvey's CSS and JS
fixUi();
//Progressbar
setupProgressbar();
//Question index
setupQuestionIndex();
//Question groups
setupQuestionGroups();
//Answers
setupAnswers();
//Optimize one line semantic differentials
//Add this JavaScript code to the question that contains a semantic differential:
// <script type="text/javascript">
// bfls(document).ready(function(){
// bfls('#question{QID}').addClass('semanticDifferential');
// });
// </script>
optimizeSemanticDifferential();
//Optimize Likert Scales
//Add this JavaScript code to the question that contains a Likert scale:
// <script type="text/javascript">
// bfls(document).ready(function(){
// bfls('#question{QID}').addClass('likert');
// });
// </script>
optimizeLikert();
//Optimize NASA-TLX Scales
//Add this JavaScript code to the question that contains a NASA-TLX scale:
// <script type="text/javascript">
// bfls(document).ready(function(){
// bfls('#question{QID}').addClass('nasa-tlx');
// });
// </script>
optimizeNASATLX();
//Optimize Self-Assessment Manikin (SAM) Scales
//Add this JavaScript code to the question that contains a SAM scale:
// <script type="text/javascript">
// bfls(document).ready(function(){
// bfls('#question{QID}').addClass('sam');
// });
// </script>
optimizeSAM();
//Reset form
setupResetForm();
//Privacy info
setupPrivacyInfo();
//Save form
setupSaveForm();
//Load form
setupLoadForm();
//Registration form
setupRegistrationForm();
//Surveylist
setupSurveylist();
//Error messages, e.g., survey has expired
setupTokenMessage();
//Show page after everything has been rendered
bfls('.bflsMainContent').trigger('ready');
bfls('.bflsMainContent').show();
bfls('.bflsMainContent').trigger('show');
if (bfls('.errormandatory').length > 0) {
bfls('html, body').animate({
scrollTop: $(".errormandatory").parent().parent().parent().parent().offset().top - 50
}, 0);
} else {
bfls('html, body').animate({
scrollTop: 1
}, 0);
}
});
} else {
waitForBfls();
}
}, 100);
})();
function fixUi() {
value = bfls('#moveprevbtn').text();
disabled = (bfls('#moveprevbtn').attr('aria-disabled')=='true')?'disabled aria-disabled="true"':'aria-disabled=false';
bfls('#moveprevbtn').replaceWith('<button type="submit" id="moveprevbtn" value="moveprev" name="moveprev" accesskey="p" class="submit btn btn-default navbar-btn" role="button" '+ disabled +'>'+ value +'</button>');
value = bfls('#movenextbtn').text();
disabled = (bfls('#movenextbtn').attr('aria-disabled')=='true')?'disabled aria-disabled="true"':'aria-disabled=false';
bfls('#movenextbtn').replaceWith('<button type="submit" id="movenextbtn" value="movenext" name="movenext" accesskey="n" class="submit btn btn-default btn-primary navbar-btn" role="button" '+ disabled +'>'+ value +'</button>');
value = bfls('#movesubmitbtn').text();
disabled = (bfls('#movesubmitbtn').attr('aria-disabled')=='true')?'disabled aria-disabled="true"':'aria-disabled=false';
bfls('#movesubmitbtn').replaceWith('<button type="submit" id="movesubmitbtn" value="movesubmit" name="movesubmit" accesskey="l" class="submit btn btn-default btn-success navbar-btn" role="button" '+ disabled +'>'+ value +'</button>');
if (bfls(':button[value="movesubmit"][name="move"]').length > 0) {
value = bfls(':button[value="movesubmit"][name="move"]').eq(0).text();
disabled = (bfls(':button[value="movesubmit"][name="move"]').eq(0).attr('aria-disabled')=='true')?'disabled aria-disabled="true"':'aria-disabled=false';
bfls(':button[value="movesubmit"][name="move"]').replaceWith('<button type="submit" value="movesubmit" name="move" class="submit btn btn-default btn-success btn-block" role="button" '+ disabled +'>'+ value +'</button>');
}
value = bfls('#clearall').text();
disabled = (bfls('#clearall').attr('aria-disabled')=='true')?'disabled aria-disabled="true"':'aria-disabled=false';
bfls('#clearall').replaceWith('<button type="submit" id="clearall" value="clearall" name="clearall" class="clearall btn btn-default navbar-btn" role="button" data-confirmedby="confirm-clearall" '+ disabled +'>'+ value +'</button>');
value = bfls('#loadallbtn').text();
disabled = (bfls('#loadallbtn').attr('aria-disabled')=='true')?'disabled aria-disabled="true"':'aria-disabled=false';
bfls('#loadallbtn').replaceWith('<button type="submit" id="loadallbtn" value="loadall" name="loadall" class="saveall btn btn-default navbar-btn" role="button" '+ disabled +'>'+ value +'</button>');
value = bfls('#saveallbtn').text();
disabled = (bfls('#saveallbtn').attr('aria-disabled')=='true')?'disabled aria-disabled="true"':'aria-disabled=false';
bfls('#saveallbtn').replaceWith('<button type="submit" id="saveallbtn" value="saveall" name="saveall" class="saveall btn btn-default navbar-btn" role="button" '+ disabled +'>'+ value +'</button>');
bfls(':button').addClass('btn btn-default');
bfls('select').addClass('form-control');
bfls('textarea').addClass('form-control');
bfls('.languagechanger').addClass('navbar-btn');
bfls('.navbar-header.pull-left').css('padding-top', '0px');
bfls('.navbar-toggle').css('z-index', '9999');
bfls('.navbar :button').addClass('navbar-btn');
bfls('p.error').replaceWith('<p class="text-warning">'+bfls('p.error').html()+'</p>');
(function updateNavbar(n){
setTimeout(function(){
if (bfls('div.navbar').length > 0) {
function update() {
bfls('body').css('padding-top', bfls('div.navbar').height() + 20);
}
bfls(window).resize(function () {
update();
});
update();
} else {
if (n>0) updateNavbar(--n);
}
}, 10);
})(4);
}
function setupProgressbar() {
bfls('#progress-wrapper').hide();
(function updateProgressbar(n){
setTimeout(function(){
if (bfls('#progress-wrapper #progressbar').hasClass('ui-progressbar')) {
progressBarValue = bfls('#progress-wrapper #progressbar').attr('aria-valuenow');
bfls('.progress .progress-bar').attr('aria-valuenow', progressBarValue);
bfls('.progress .progress-bar').css('width', progressBarValue+'%');
bfls('.progress .progress-bar span.sr-only').html(progressBarValue+'% Complete');
if (progressBarValue > 0) {
bfls('.progress .progress-bar').append('<span>'+ progressBarValue +'%</span>');
}
bfls('.progress').show();
if (bfls('#index').length > 0) {
bfls('#index').css('padding-top', '40px');
}
} else {
if (n>0) updateProgressbar(--n);
}
}, 10);
})(4);
}
function setupQuestionIndex() {
if (bfls('#index').length > 0) {
bfls('#limesurvey').unwrap();
bfls('#limesurvey').children().wrapAll('<div class="col-md-8 content-col"></div>');
bfls('#limesurvey .content-col').after('<div class="col-md-4 index-col"></div>');
bfls('#index').appendTo('.index-col');
bfls('#index h2').replaceWith('<h1>'+ bfls('#index h2').html() +'</h1>');
bfls('#index .container').addClass('panel-body').removeClass('container').wrap('<div class="panel panel-default"></div>');
bfls('#index div div.row').removeClass('row');
bfls('#index div div ol li.row').removeClass('row');
bfls('#index div div ol li').addClass('text-success');
bfls('#index div div ol li.missing').removeClass('text-success').addClass('text-muted');
bfls('#index div div ol li.current').removeClass('text-success').removeClass('text-danger').addClass('text-primary');
bfls('#index .hdr').append('. ');
bfls('#index span').addClass('text-success');
bfls('#index .current span').removeClass('text-success').addClass('text-primary');
bfls('#index .current span').next().removeClass('text-success').addClass('text-primary');
bfls('#index input').hide();
// Prevent the user from jumping around in a survey if question index mode is set to "complete",
// since this appears to be buggy in LimeSurvey 2.05+.
// bfls('#index button').remove();
}
}
function setupQuestionGroups() {
bfls('.group :nth-child(n) span').css('font', '').css('font-family', '').css('font-variant', '').css('font-size', '').css('font-stretch', '');
if (bfls('.group .question-number').html()) {
bfls('.group .question-number').append('. ');
}
if (bfls('.group .question-code').html()) {
bfls('.group .question-code').addClass('badge');
}
}
function setupAnswers() {
bfls('.answer .tip').addClass('text-muted small');
bfls('.answer .answer ul').addClass('list-unstyled');
bfls('.answer .answer ul').each(function(index) {
if (bfls(this).closest('.ranking-answers').length == 0) {
// pgee70 contributed the following lines (https://github.com/mofog/BootstrapForLimeSurvey/issues/20)
var lis = bfls('li', this);
var li_count = bfls('li', this).length;
columns = 3; //default
if (li_count < 4) {
// columns = Math.floor(12/li_count);
columns = li_count;
} else if (bfls(this).hasClass('slider-list')) {
columns = 1;
}
var rows = [];
for (var i=0 ; i<Math.ceil(li_count/columns); i++) {
rows[i]=Array();
for (var j=0; j<columns; j++) {
rows[i][j] = lis[i * columns + j];
}
}
bfls('li', this).remove();
for (var i=0; i<rows.length; i++) {
if (bfls('.row-'+i, this).length == 0) {
bfls(this).append('<div class="row row-' + i + '"></div>');
}
for (var j=0; j<rows[i].length; j++) {
bfls('.row-'+i , this).append(rows[i][j]);
}
}
bfls('li',this).wrap('<div class="col-md-'+ Math.floor(12/columns) +'"></div>');
}
});
bfls('.answer .radio-list .radio-item').each(function(index) {
// andykirk contributed the following lines (https://github.com/mofog/BootstrapForLimeSurvey/pull/11/files)
bfls('.answer .radio-list .radio-item').eq(index).children('input').removeAttr('class');
bfls('.answer .radio-list .radio-item').eq(index).children('input').prependTo(bfls('.answer .radio-list .radio-item').eq(index).children('label:not([for$="othertext"])'));
bfls('.answer .radio-list .radio-item').eq(index).children('label').wrap('<div class="radio" style="padding-right: 20px;"></div>')
});
bfls('.answer .radio-list .radio-item div.radio label.hide').contents().filter(function(){
return this.nodeType == 3;
}).remove();
bfls('.answer .radio-list .radio-item div.radio label.hide input').unwrap();
bfls('.answer input[type="text"]').addClass('form-control');
bfls('.answer input[type="tel"]').addClass('form-control');
bfls('.answer input[type="number"]').addClass('form-control');
bfls('.answer table').wrap('<div class="table-responsive"></div>');
bfls('.answer table').addClass('table table-striped table-hover table-condensed');
bfls('.answer table thead tr td').replaceWith('<th> </th>');
bfls('.survey-question-help > img').replaceWith('<span class="glyphicon glyphicon-info-sign pull-left"> </span>');
bfls('.answer strong .errormandatory').unwrap();
bfls('.answer .errormandatory').addClass('text-danger');
bfls('.answer .text-danger br').remove();
/*
if (bfls('.answer .text-danger strong').length > 0) {
bfls('.answer .text-danger strong').each(function(index){
// This does not work, do not uncomment without adjustment.
bfls('.answer .text-danger').append(bfls('.answer .text-danger strong span').html());
bfls('.answer .text-danger strong').remove();
});
}
*/
/*
(function fixEmoticons(n){
setTimeout(function(){
if (bfls('.emoticon-2').length > 0) {
bfls('.emoticon-2').css('margin-top', '0px');
} else {
if (n>0) fixEmoticons(--n);
}
}, 500);
})(4);
(function fixSlider(n){
setTimeout(function(){
if (bfls('.slider-labels').length > 0) {
bfls('.slider-labels').css('margin-bottom', '15px');
bfls('.slider-labels').css('margin-left', '12px');
} else {
if (n>0) fixSlider(--n);
}
}, 500);
})(4);
(function updateDatepicker(n){
setTimeout(function(){
if (bfls('.ui-datepicker-trigger').length > 0) {
bfls('.ui-datepicker-trigger').hide();
} else {
if (n>0) updateDatepicker(--n);
}
}, 500);
})(4);
*/
if (bfls('.upload').length > 0) {
bfls('.upload').unwrap('<h2>');
bfls('.upload').addClass('btn btn-primary');
}
if (bfls('.subquestions-list').length > 0) {
bfls('.subquestions-list li').each(function(index){
bfls('.subquestions-list li').eq(index).children('input').appendTo(bfls('.subquestions-list li').eq(index).children('label'));
bfls('.subquestions-list li').eq(index).children('label[class!="slider-label"]').wrap('<div class="checkbox"></div>');
bfls('.subquestions-list li').eq(index).find('span.option input').prependTo(bfls('.subquestions-list li').eq(index).children('span.option').children('label'));
bfls('.subquestions-list li').eq(index).find('span.option label').wrap('<div class="checkbox"></div>');
});
}
bfls('.answer ul.slider-list li').each(function(index){
if (bfls('.answer ul.slider-list li').eq(index).children('.slider-label').length > 0) {
bfls('.answer ul.slider-list li').eq(index).children('div.multinum-slider').wrap('<div class="row multinum-slider"><div class="col-xs-8"></div></div>');
bfls('.answer ul.slider-list li').eq(index).children('.row.multinum-slider').prepend(bfls('.answer ul.slider-list li').eq(index).children('.slider_lefttext'));
bfls('.answer ul.slider-list li').eq(index).find('.row.multinum-slider .slider_lefttext').wrap('<div class="col-xs-2" style="padding-top: 15px; text-align: right;"></div>');
bfls('.answer ul.slider-list li').eq(index).children('.row.multinum-slider').append(bfls('.answer ul.slider-list li').eq(index).children('.slider_righttext'));
bfls('.answer ul.slider-list li').eq(index).find('.row.multinum-slider .slider_righttext').wrap('<div class="col-xs-2" style="padding-top: 15px; text-align: left;"></div>');
}
});
}
function setupResetForm() {
bfls('.clearall-results-restart a').addClass('btn btn-primary btn-lg');
bfls('.clearall-results-close a').addClass('btn btn-danger btn-lg');
}
function setupPrivacyInfo() {
bfls('div.privacy .panel-heading h3').html(bfls('div.privacy .panel-body span').html());
bfls('div.privacy .panel-body span').remove();
bfls('div.privacy .panel-body br').remove();
privacyTmp = bfls('div.privacy .panel-body').html();
bfls('div.privacy .panel-body').empty();
bfls('div.privacy .panel-body').append('<p>'+ privacyTmp +'</p>');
}
function setupSaveForm() {
bfls('.save-form input:text').addClass('form-control');
bfls('.save-form input:password').addClass('form-control');
bfls('.save-form #savebutton').addClass('btn btn-primary');
bfls('.save-form').after('<div class="save-form-bootstrap"></div>');
bfls('.save-form tr').each(function(index) {
labelTmp = bfls('.save-form tr').eq(index).children('td').eq(0).html().slice(0, -1);
fieldTmp = bfls('.save-form tr').eq(index).children('td').eq(1).html();
if (labelTmp.indexOf('<img') == -1 && fieldTmp) {
bfls('.save-form-bootstrap').append('<div class="form-group group'+ index +'"></div>');
bfls('.save-form-bootstrap .form-group.group'+index).append(labelTmp);
bfls('.save-form-bootstrap .form-group.group'+index).append(fieldTmp);
}
});
bfls('.save-form').remove();
}
function setupLoadForm() {
bfls('.load-form input:text').addClass('form-control');
bfls('.load-form input:password').addClass('form-control');
bfls('.load-form #loadbutton').addClass('btn btn-primary');
bfls('.load-form').after('<div class="load-form-bootstrap"></div>');
bfls('.load-form tr').each(function(index) {
labelTmp = bfls('.load-form tr').eq(index).children('td').eq(0).html().slice(0, -1);
fieldTmp = bfls('.load-form tr').eq(index).children('td').eq(1).html();
if (labelTmp.indexOf('<img') == -1 && fieldTmp) {
bfls('.load-form-bootstrap').append('<div class="form-group group'+ index +'"></div>');
bfls('.load-form-bootstrap .form-group.group'+index).append(labelTmp);
bfls('.load-form-bootstrap .form-group.group'+index).append(fieldTmp);
}
});
bfls('.load-form').remove();
}
function setupRegistrationForm() {
bfls('.register-form input:text').addClass('form-control');
bfls('.register-form input:password').addClass('form-control');
bfls('.register-form #registercontinue').addClass('btn btn-primary');
bfls('.register-form form').append('<div class="register-form-bootstrap"></div>');
bfls('.register-form tr').each(function(index) {
labelTmp = bfls('.register-form tr').eq(index).children('td').eq(0).html().slice(0, -1);
fieldTmp = bfls('.register-form tr').eq(index).children('td').eq(1).html();
if (labelTmp.indexOf('<img') == -1 && fieldTmp) {
bfls('.register-form-bootstrap').append('<div class="form-group group'+ index +'"></div>');
bfls('.register-form-bootstrap .form-group.group'+index).append(labelTmp);
bfls('.register-form-bootstrap .form-group.group'+index).append(fieldTmp);
}
});
bfls('.register-form table.register').remove();
}
function setupSurveylist() {
if (bfls('.survey-list-table .survey-contact').length > 0) {
bfls('.survey-list-table .survey-contact').html(bfls('.survey-list-table .survey-contact').html().replace('( ', '(').replace(' )', ')'));
}
}
function setupTokenMessage() {
if (bfls('p#tokenmessage').length > 0) {
bfls('p#tokenmessage').wrap('<div class="well"></div>');
bfls('p#tokenmessage span.error').replaceWith('<h1>'+ bfls('p#tokenmessage span.error').html() +'</h1>');
bfls('p#tokenmessage h1 + br').remove();
bfls('p#tokenmessage h1 + br').remove();
bfls('p#tokenmessage br + br').remove();
bfls('p#tokenmessage').html(bfls('p#tokenmessage').html().replace('( ', '(').replace(' )', ')'));
}
}
function setupAlertDialog() {
window.alert = function(message) {
console.log(message);
id = new Date().getTime();
bfls('body').append(' \
<div class="modal fade" id="alertModal'+ id +'"> \
<div class="modal-dialog"> \
<div class="modal-content"> \
<div class="modal-header"> \
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> \
<h4 class="modal-title">Info</h4> \
</div> \
<div class="modal-body"> \
<p>'+ message +'</p> \
</div> \
<div class="modal-footer"> \
<button type="button" class="btn btn-default" data-dismiss="modal">Okay</button> \
</div> \
</div><!-- /.modal-content --> \
</div><!-- /.modal-dialog --> \
</div><!-- /.modal --> \
');
bfls('#alertModal'+id).modal('show');
};
}
function setupConfirmDialog() {
window.confirm = function(message) {
console.log(message);
id = new Date().getTime();
bfls('body').append(' \
<div class="modal fade" id="alertModal'+ id +'"> \
<div class="modal-dialog"> \
<div class="modal-content"> \
<div class="modal-header"> \
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> \
<h4 class="modal-title">Mhh...</h4> \
</div> \
<div class="modal-body"> \
<p>'+ message +'</p> \
</div> \
<div class="modal-footer"> \
<button type="button" class="btn btn-default" data-dismiss="modal"> <span class="glyphicon glyphicon-thumbs-down"></span> </button> \
<button type="button" class="btn btn-primary" onclick="window.location=\''+ bfls('#sid').attr('value') +'/newtest/Y\';"> <span class="glyphicon glyphicon-thumbs-up"></span> </button> \
</div> \
</div><!-- /.modal-content --> \
</div><!-- /.modal-dialog --> \
</div><!-- /.modal --> \
');
bfls('#alertModal'+id).modal('show');
};
}
function optimizeSemanticDifferential() {
bfls('.semanticDifferential table').removeClass('table-hover');
bfls('.semanticDifferential table').each(function(index) {
if (bfls('.semanticDifferential table').eq(index).find('tbody tr').length == 1) {
bfls('.semanticDifferential table').eq(index).removeClass('table-striped');
}
});
bfls('.semanticDifferential table thead th').remove();
bfls('.semanticDifferential table th').css('border', '0px solid black');
bfls('.semanticDifferential table td').css('border', '0px solid black')
.css('vertical-align', 'middle');
bfls('.semanticDifferential div.radio').css('text-align', 'center')
.css('padding-left', '0px')
.css('padding-right', '0px');
bfls('.semanticDifferential input[type="radio"]').css('display', 'block').css('margin', '').css('margin', 'auto').css('float', 'none');
}
function optimizeLikert() {
function enable() {
bfls('.likert div.radio').css('text-align', 'center');
bfls('.likert input[type="radio"]').css('display', 'block').css('margin', '').css('margin', 'auto').css('float', 'none');
}
function disable() {
bfls('.likert div.radio').css('text-align', 'left');
bfls('.likert input[type="radio"]').css('display', 'inline').css('margin', '').css('margin-left', '-20px').css('float', 'left');
}
function update() {
if(isBreakpoint('sm') || isBreakpoint('xs')) {
disable();
} else {
enable();
}
}
function isBreakpoint( alias ) {
return bfls('.device-' + alias).is(':visible');
}
bfls(window).resize(function () {
update();
});
bfls('body').append('<div class="device-xs visible-xs"></div><div class="device-sm visible-sm"></div><div class="device-md visible-md"></div><div class="device-lg visible-lg"></div>');
update();
}
function optimizeNASATLX() {
bfls('.nasa-tlx .ui-slider').css('background', 'url('+BFLS_TEMPLATEURL+'images/nasa-tlx-background.png)')
.css('background-size', '100% 40px')
.css('height', '40px')
.css('border', '0px solid black')
.css('top', '-20px');
bfls('.nasa-tlx .ui-slider .ui-slider-handle').css('height', '40px')
.css('top', '0px')
.css('border', '0px solid black')
.css('background', 'red');
bfls('.nasa-tlx .ui-slider .slider-callout').css('visibility', 'hidden');
}
function optimizeSAM() {
bfls('.sam colgroup').remove();
bfls('.sam thead').remove();
bfls('.sam th.answertext').remove();
bfls('.sam table').removeClass('table-striped')
.removeClass('table-hover');
bfls('.sam table td').css('border', '0px solid black');
bfls('.sam thead img').remove();
bfls('.sam tbody div.radio').css('text-align', 'center');
bfls('.sam tbody div.radio').each(function(index) {
bfls('.sam tbody div.radio').eq(index).children('input').insertAfter(bfls('.sam tbody div.radio').eq(index).children('img'));
});
bfls('.sam tbody div.radio img').css('padding-bottom', '10px')
.css('width', '100%') //http://stackoverflow.com/questions/18846744/responsive-images-in-tables-bootstrap-3
.addClass('img-responsive');
bfls('.sam tbody input[type="radio"]').css('float', 'none')
.css('display', 'block')
.css('margin', 'auto');
}