comparison js/core.js @ 3095:20de79c56ad7

JSHinted Dev_main
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Fri, 12 Jan 2018 16:39:39 +0000
parents 30ba1b9ed867
children cd34732a2e39
comparison
equal deleted inserted replaced
3094:95e946ee225b 3095:20de79c56ad7
2725 this.holder.style.width = boxwidth + "px"; 2725 this.holder.style.width = boxwidth + "px";
2726 this.textArea.style.width = boxwidth - 6 + "px"; 2726 this.textArea.style.width = boxwidth - 6 + "px";
2727 }; 2727 };
2728 this.resize(); 2728 this.resize();
2729 this.check = function () { 2729 this.check = function () {
2730 if (this.specification.mandatory && this.textArea.value.length == 0) { 2730 if (this.specification.mandatory && this.textArea.value.length === 0) {
2731 return false; 2731 return false;
2732 } 2732 }
2733 return true; 2733 return true;
2734 } 2734 };
2735 }; 2735 };
2736 2736
2737 this.radioBox = function (commentQuestion) { 2737 this.radioBox = function (commentQuestion) {
2738 this.specification = commentQuestion; 2738 this.specification = commentQuestion;
2739 // Create document objects to hold the comment boxes 2739 // Create document objects to hold the comment boxes
2808 }; 2808 };
2809 this.check = function () { 2809 this.check = function () {
2810 var anyChecked = this.options.some(function (a) { 2810 var anyChecked = this.options.some(function (a) {
2811 return a.checked; 2811 return a.checked;
2812 }); 2812 });
2813 if (this.specification.mandatory && anyChecked == false) { 2813 if (this.specification.mandatory && anyChecked === false) {
2814 return false; 2814 return false;
2815 } 2815 }
2816 return true; 2816 return true;
2817 } 2817 };
2818 this.resize(); 2818 this.resize();
2819 }; 2819 };
2820 2820
2821 this.checkboxBox = function (commentQuestion) { 2821 this.checkboxBox = function (commentQuestion) {
2822 this.specification = commentQuestion; 2822 this.specification = commentQuestion;
2883 }; 2883 };
2884 this.check = function () { 2884 this.check = function () {
2885 var anyChecked = this.options.some(function (a) { 2885 var anyChecked = this.options.some(function (a) {
2886 return a.checked; 2886 return a.checked;
2887 }); 2887 });
2888 if (this.specification.mandatory && anyChecked == false) { 2888 if (this.specification.mandatory && anyChecked === false) {
2889 return false; 2889 return false;
2890 } 2890 }
2891 return true; 2891 return true;
2892 }; 2892 };
2893 this.resize(); 2893 this.resize();
2947 this.holder.style.width = boxwidth + "px"; 2947 this.holder.style.width = boxwidth + "px";
2948 this.slider.style.width = boxwidth - 24 + "px"; 2948 this.slider.style.width = boxwidth - 24 + "px";
2949 }; 2949 };
2950 this.check = function () { 2950 this.check = function () {
2951 return true; 2951 return true;
2952 } 2952 };
2953 this.resize(); 2953 this.resize();
2954 }; 2954 };
2955 2955
2956 this.createCommentQuestion = function (element) { 2956 this.createCommentQuestion = function (element) {
2957 var node; 2957 var node;
2972 this.commentQuestions = []; 2972 this.commentQuestions = [];
2973 }; 2973 };
2974 2974
2975 this.checkCommentQuestions = function () { 2975 this.checkCommentQuestions = function () {
2976 var errored = this.commentQuestions.reduce(function (a, cq) { 2976 var errored = this.commentQuestions.reduce(function (a, cq) {
2977 if (cq.check() == false) { 2977 if (cq.check() === false) {
2978 a.push(cq); 2978 a.push(cq);
2979 } 2979 }
2980 return a; 2980 return a;
2981 }, []); 2981 }, []);
2982 if (errored.length == 0) { 2982 if (errored.length === 0) {
2983 return true; 2983 return true;
2984 } 2984 }
2985 interfaceContext.lightbox.post("Message", "Not all the mandatory comment boxes below have been filled."); 2985 interfaceContext.lightbox.post("Message", "Not all the mandatory comment boxes below have been filled.");
2986 } 2986 };
2987 2987
2988 this.outsideReferenceDOM = function (audioObject, index, inject) { 2988 this.outsideReferenceDOM = function (audioObject, index, inject) {
2989 this.parent = audioObject; 2989 this.parent = audioObject;
2990 this.outsideReferenceHolder = document.createElement('button'); 2990 this.outsideReferenceHolder = document.createElement('button');
2991 this.outsideReferenceHolder.className = 'outside-reference'; 2991 this.outsideReferenceHolder.className = 'outside-reference';