Skip to content

Commit 431b517

Browse files
committed
deployed shared sessions to everyone
1 parent 657dc7c commit 431b517

4 files changed

Lines changed: 97 additions & 97 deletions

File tree

‎v3/css/composingprograms.css‎

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -23,55 +23,3 @@ div.ExecutionVisualizer div.highlightedStackFrame {
2323
border-left: 2px solid #686f70;
2424
}
2525

26-
/* from http://rog.ie/blog/css-star-rater */
27-
.star-rating {
28-
font-size: 0;
29-
white-space: nowrap;
30-
display: inline-block;
31-
/* pgbovine - scale this appropriately with a 5:1 ratio */
32-
width: 100px;
33-
height: 20px;
34-
overflow: hidden;
35-
position: relative;
36-
background: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDIwIDIwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cG9seWdvbiBmaWxsPSIjREREREREIiBwb2ludHM9IjEwLDAgMTMuMDksNi41ODMgMjAsNy42MzkgMTUsMTIuNzY0IDE2LjE4LDIwIDEwLDE2LjU4MyAzLjgyLDIwIDUsMTIuNzY0IDAsNy42MzkgNi45MSw2LjU4MyAiLz48L3N2Zz4=');
37-
background-size: contain;
38-
}
39-
.star-rating i {
40-
opacity: 0;
41-
position: absolute;
42-
left: 0;
43-
top: 0;
44-
height: 100%;
45-
width: 20%;
46-
z-index: 1;
47-
background: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDIwIDIwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cG9seWdvbiBmaWxsPSIjRkZERjg4IiBwb2ludHM9IjEwLDAgMTMuMDksNi41ODMgMjAsNy42MzkgMTUsMTIuNzY0IDE2LjE4LDIwIDEwLDE2LjU4MyAzLjgyLDIwIDUsMTIuNzY0IDAsNy42MzkgNi45MSw2LjU4MyAiLz48L3N2Zz4=');
48-
background-size: contain;
49-
}
50-
.star-rating input {
51-
-moz-appearance: none;
52-
-webkit-appearance: none;
53-
opacity: 0;
54-
display: inline-block;
55-
width: 20%;
56-
height: 100%;
57-
margin: 0;
58-
padding: 0;
59-
z-index: 2;
60-
position: relative;
61-
}
62-
.star-rating input:hover + i,
63-
.star-rating input:checked + i {
64-
opacity: 1;
65-
}
66-
.star-rating i ~ i {
67-
width: 40%;
68-
}
69-
.star-rating i ~ i ~ i {
70-
width: 60%;
71-
}
72-
.star-rating i ~ i ~ i ~ i {
73-
width: 80%;
74-
}
75-
.star-rating i ~ i ~ i ~ i ~ i {
76-
width: 100%;
77-
}

‎v3/css/opt-frontend.css‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,57 @@ button.surveyBtn {
107107

108108
/* necessary for CodeMirror error line highlighting to work! */
109109
.CodeMirror .errorLine { background: #ffff3f !important; }
110+
111+
112+
/* from http://rog.ie/blog/css-star-rater */
113+
.star-rating {
114+
font-size: 0;
115+
white-space: nowrap;
116+
display: inline-block;
117+
/* pgbovine - scale this appropriately with a 5:1 ratio */
118+
width: 100px;
119+
height: 20px;
120+
overflow: hidden;
121+
position: relative;
122+
background: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDIwIDIwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cG9seWdvbiBmaWxsPSIjREREREREIiBwb2ludHM9IjEwLDAgMTMuMDksNi41ODMgMjAsNy42MzkgMTUsMTIuNzY0IDE2LjE4LDIwIDEwLDE2LjU4MyAzLjgyLDIwIDUsMTIuNzY0IDAsNy42MzkgNi45MSw2LjU4MyAiLz48L3N2Zz4=');
123+
background-size: contain;
124+
}
125+
.star-rating i {
126+
opacity: 0;
127+
position: absolute;
128+
left: 0;
129+
top: 0;
130+
height: 100%;
131+
width: 20%;
132+
z-index: 1;
133+
background: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDIwIDIwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cG9seWdvbiBmaWxsPSIjRkZERjg4IiBwb2ludHM9IjEwLDAgMTMuMDksNi41ODMgMjAsNy42MzkgMTUsMTIuNzY0IDE2LjE4LDIwIDEwLDE2LjU4MyAzLjgyLDIwIDUsMTIuNzY0IDAsNy42MzkgNi45MSw2LjU4MyAiLz48L3N2Zz4=');
134+
background-size: contain;
135+
}
136+
.star-rating input {
137+
-moz-appearance: none;
138+
-webkit-appearance: none;
139+
opacity: 0;
140+
display: inline-block;
141+
width: 20%;
142+
height: 100%;
143+
margin: 0;
144+
padding: 0;
145+
z-index: 2;
146+
position: relative;
147+
}
148+
.star-rating input:hover + i,
149+
.star-rating input:checked + i {
150+
opacity: 1;
151+
}
152+
.star-rating i ~ i {
153+
width: 40%;
154+
}
155+
.star-rating i ~ i ~ i {
156+
width: 60%;
157+
}
158+
.star-rating i ~ i ~ i ~ i {
159+
width: 80%;
160+
}
161+
.star-rating i ~ i ~ i ~ i ~ i {
162+
width: 100%;
163+
}

‎v3/js/composingprograms.js‎

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -42,53 +42,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4242
var originFrontendJsFile = 'composingprograms.js';
4343

4444

45-
var postSessionSurvey = '\n\
46-
<div id="postSessionSurveyDiv" style="border: 1px solid #BE554E; padding: 5px; margin-top: 5px; line-height: 175%;">\n\
47-
<span style="font-size: 8pt; color: #666;">Support our research by giving anonymous feedback before ending your session.</span><br/>\n\
48-
How useful was this particular session? (click star to rate)\n\
49-
<span class="star-rating togetherjsIgnore">\n\
50-
<input type="radio" class="togetherjsIgnore" name="rating" value="1"/><i></i>\n\
51-
<input type="radio" class="togetherjsIgnore" name="rating" value="2"/><i></i>\n\
52-
<input type="radio" class="togetherjsIgnore" name="rating" value="3"/><i></i>\n\
53-
<input type="radio" class="togetherjsIgnore" name="rating" value="4"/><i></i>\n\
54-
<input type="radio" class="togetherjsIgnore" name="rating" value="5"/><i></i>\n\
55-
</span>\n\
56-
<br/>\
57-
What did you just learn? <input type="text" id="sharedSessionWhatLearned" class="surveyQ togetherjsIgnore" size=60 maxlength=140/>\n\
58-
<button id="submitSessionSurveyBtn" type="button" style="font-size: 8pt;">Submit</button>\n\
59-
<span id="sharedSessionWhatLearnedThanks" style="color: #e93f34; font-weight: bold; font-size: 10pt; display: none;">Thanks!</span>\n\
60-
</div>'
61-
62-
6345
function TogetherjsReadyHandler() {
6446
populateTogetherJsShareUrl();
65-
66-
$("#togetherjsStatus").append(postSessionSurvey);
67-
68-
$('.star-rating :radio').change(function() {
69-
if (TogetherJS.running) {
70-
TogetherJS.send({type: "surveyHowUsefulStars",
71-
stars: Number(this.value)});
72-
}
73-
});
74-
75-
$('#submitSessionSurveyBtn').click(function() {
76-
var resp = $('#sharedSessionWhatLearned').val();
77-
if (TogetherJS.running && resp) {
78-
TogetherJS.send({type: "surveyFreetextQuestion",
79-
question: "What did you just learn?",
80-
answer: $('#sharedSessionWhatLearned').val()});
81-
82-
$("#sharedSessionWhatLearned").val('');
83-
$("#sharedSessionWhatLearnedThanks").show();
84-
$.doTimeout('sharedSessionWhatLearnedThanksFadeOut', 1000, function() {
85-
$("#sharedSessionWhatLearnedThanks").fadeOut(2000);
86-
});
87-
88-
89-
}
90-
});
91-
9247
updateChatName();
9348
}
9449

‎v3/js/opt-frontend-common.js‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,30 @@ function populateTogetherJsShareUrl() {
433433
');
434434
$("#togetherjsURL").val(urlToShare).attr('size', urlToShare.length + 20);
435435
$("#syncBtn").click(requestSync);
436+
437+
// append post shared session survey
438+
$("#togetherjsStatus").append(postSessionSurvey);
439+
$('.star-rating :radio').change(function() {
440+
if (TogetherJS.running) {
441+
TogetherJS.send({type: "surveyHowUsefulStars",
442+
stars: Number(this.value)});
443+
}
444+
});
445+
446+
$('#submitSessionSurveyBtn').click(function() {
447+
var resp = $('#sharedSessionWhatLearned').val();
448+
if (TogetherJS.running && resp) {
449+
TogetherJS.send({type: "surveyFreetextQuestion",
450+
question: "What did you just learn?",
451+
answer: $('#sharedSessionWhatLearned').val()});
452+
453+
$("#sharedSessionWhatLearned").val('');
454+
$("#sharedSessionWhatLearnedThanks").show();
455+
$.doTimeout('sharedSessionWhatLearnedThanksFadeOut', 1000, function() {
456+
$("#sharedSessionWhatLearnedThanks").fadeOut(2000);
457+
});
458+
}
459+
});
436460
}
437461

438462
// END - shared session stuff
@@ -1049,3 +1073,22 @@ function getSurveyObject() {
10491073

10501074
return ret;
10511075
}
1076+
1077+
1078+
// survey for shared sessions, deployed on 2014-06-06
1079+
var postSessionSurvey = '\n\
1080+
<div id="postSessionSurveyDiv" style="border: 1px solid #BE554E; padding: 5px; margin-top: 5px; line-height: 175%;">\n\
1081+
<span style="font-size: 8pt; color: #666;">Support our research by giving anonymous feedback before ending your session.</span><br/>\n\
1082+
How useful was this particular session? (click star to rate)\n\
1083+
<span class="star-rating togetherjsIgnore">\n\
1084+
<input type="radio" class="togetherjsIgnore" name="rating" value="1"/><i></i>\n\
1085+
<input type="radio" class="togetherjsIgnore" name="rating" value="2"/><i></i>\n\
1086+
<input type="radio" class="togetherjsIgnore" name="rating" value="3"/><i></i>\n\
1087+
<input type="radio" class="togetherjsIgnore" name="rating" value="4"/><i></i>\n\
1088+
<input type="radio" class="togetherjsIgnore" name="rating" value="5"/><i></i>\n\
1089+
</span>\n\
1090+
<br/>\
1091+
What did you just learn? <input type="text" id="sharedSessionWhatLearned" class="surveyQ togetherjsIgnore" size=60 maxlength=140/>\n\
1092+
<button id="submitSessionSurveyBtn" type="button" style="font-size: 8pt;">Submit</button>\n\
1093+
<span id="sharedSessionWhatLearnedThanks" style="color: #e93f34; font-weight: bold; font-size: 10pt; display: none;">Thanks!</span>\n\
1094+
</div>'

0 commit comments

Comments
 (0)