Index: lams_tool_scribe/web/pages/learning/scribe.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r2d2c869032858b474398c651f8c45371410ba0d2 --- lams_tool_scribe/web/pages/learning/scribe.jsp (.../scribe.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_scribe/web/pages/learning/scribe.jsp (.../scribe.jsp) (revision 2d2c869032858b474398c651f8c45371410ba0d2) @@ -1,197 +1,225 @@ + + + <%@ include file="/common/taglibs.jsp"%> - - - - - - - - - + + + + + + + + + + + + - // check and ping every 3 minutes - scribeWebsocketPingTimeout = setTimeout(scribeWebsocketPingFunc, 3*60*1000); - // initial set up does not send ping - if (!skipPing) { - scribeWebsocket.send("ping"); - } - }; - // set up timer for the first time - scribeWebsocketPingFunc(true); - - scribeWebsocket.onclose = function(e){ - // react only on abnormal close - if (e.code === 1006) { - location.reload(); - } - }; - - // run when the server pushes new reports and vote statistics - scribeWebsocket.onmessage = function(e) { - // create JSON object - var input = JSON.parse(e.data), - agreeButton = $('#agreeButton'); + + - // only changed reports will be sent - if (input.reports) { - $.each(input.reports, function() { - $('#reportText-' + this.uid).html(this.text); - }); - } + - // can the user vote - if (!reportSubmitted || input.approved) { - agreeButton.hide(); - } else { - agreeButton.show(); - } +
+ +
- // update vote statistics - var label = agreementPercentageLabel.replace('{0}', input.numberOfVotes) - .replace('{1}', input.numberOfLearners); - $('#agreementPercentageLabel').text(label); - $('#agreementPercentage').text('(' + input.votePercentage + '%)'); - $('#agreementPercentageBar').attr('aria-valuenow', input.votePercentage) - .css('width',input.votePercentage + '%'); - } - - function submitApproval() { - var data = { - type : 'vote' - }; - scribeWebsocket.send(JSON.stringify(data)); +
+ <%@include file="/pages/parts/voteDisplay.jsp"%> +
- $('#agreeButton').hide(); - } - - function submitReport() { - var reports = [], - data = { - type : 'submitReport' - }; - // get each report part (heading) text - $('textarea[id^="report-"]').each(function(){ - reports.push({ - 'uid' : $(this).attr('id').split('-')[1], - 'text' : $(this).val() - }); - }); - data.reports = reports; - scribeWebsocket.send(JSON.stringify(data)); +

+ + +

+ +
+
+
+
+ +
+
- reportSubmitted = true; - } - - function confirmForceComplete() { - return confirm(""); - } - - - - -
- -
- -
- <%@include file="/pages/parts/voteDisplay.jsp"%> -
- -

- - -

- -
-
-
-
- -
-
- -
- - - - - - +
+ + + + + + +
+ + + + +
- - - -
+ + + +
+
+ +
+
+
+ + +
+ + + + + + + +
+ + + +
+
+ +
+ +
-
-
+ + + +
+ + + - -
-
- -
-
-
- - -
- - - - - - - -
- - - -
-
- -
- - -
- - - - \ No newline at end of file