Skip to content

Commit

Permalink
REFACTORING: Coding interview fragments (#106)
Browse files Browse the repository at this point in the history
Removing MarkDown rendering for interviews helps to speed up the loading 
of long transcripts.
  • Loading branch information
christophe-lejeune committed Oct 20, 2021
1 parent b0298e1 commit b156198
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
1 change: 0 additions & 1 deletion app/_attachments/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ a.dropdown-item, .create-leave, a.dropdown-toggle,

.highlight {
background-color: yellow;
color: red;
-webkit-transition: 2s all ease-in-out;
-moz-transition: 2s all ease-in-out;
-o-transition: 2s all ease-in-out;
Expand Down
4 changes: 2 additions & 2 deletions app/l10n/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
"transcript": "Interview location"
},
"field": "What am I observing ?",
"transcript": "**Caracole** : What's up, doc?\\n \\n**Sov**: Elementary, my dear!",
"transcript": "Caracole: What's up, doc?\\n \\nSov: Elementary, my dear!",
"coding": "How is defined such an activity ? What process is at stake ?",
"operational": "Things not to forget to observe on the field",
"theoretical": "Research question or theoretical question(s) raised when coding the material",
Expand Down Expand Up @@ -434,7 +434,7 @@
"transcript": "Lieu de la rencontre"
},
"field": "Qu'avez-vous observé ?",
"transcript": "**Caracole** : Quoi de neuf, docteur ?\\n \\n**Sov** : Élementaire, mon cher !",
"transcript": "Caracole: Quoi de neuf, docteur ?\\n \\nSov: Élementaire, mon cher !",
"coding": "Comment se définit tel processus, tel vécu ou telle expérience ?",
"operational": "Que ne faut-il pas oublier de faire sur le terrain ?",
"theoretical": "Formulez (ou reformulez) la question de recherche ou les questions théoriques que suscite l'analyse du matériau. Identifiez la dimension à approfondir ou la situation à explorer",
Expand Down
1 change: 1 addition & 0 deletions app/templates/editable_memo.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ <h1> <img src="../style/{{type}}.svg"/> {{name}}</h1>
$('#groundings').find('.toggle').next().slideToggle('fast');
{{#authorized}}
$('#header > ul > li:first').after($('.editor-toolbar'));
if ("{{type}}" == 'interview') $('.editor-toolbar').remove ();
if (easymde.value() == $('#remote').text()) {
easymde.clearAutosavedValue();
} else {
Expand Down
3 changes: 2 additions & 1 deletion app/templates/editable_text.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ <h1>{{#attributes}}{{value}}{{/attributes}}</h1>
if (!data.body) {
var body = data.speeches.map(function(a) {
var turn = a.text;
if (a.actor) turn = '**'+a.actor.trim()+'** '+turn;
if (a.actor) turn = a.actor.trim()+': '+turn;
return turn;
});
data.body = body.join('\n \n');
data.diary = data.corpus;
delete data.corpus;
delete data.speeches;
data.type = "interview";
}
$.ajax({
Expand Down
11 changes: 9 additions & 2 deletions app/templates/memo.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,15 @@ <h1><img src="{{>relpath}}style/{{type}}.svg"/> {{name}}</h1>
converter.setFlavor('github');
renderComments(converter);
renderPreviews(converter);
if ("{{type}}" == 'interview') {
$('.post').children('font').wrapAll('<p></p>');;
}
$('.post').html(function(i, text) {
return converter.makeHtml(text.replace(/&gt;/g, '>').trim());
if ("{{type}}" == 'interview') {
return text.replace(/\n \n/g, '</font></p><p><font>');
} else {
return converter.makeHtml(text.replace(/&gt;/g, '>').trim());
}
});
if ($('#groundings li').length == 1) $("#groundings").find('legend').text("{{i18n.i_grounding}}");
if ($('#groundings li').length < 1) $("#groundings").addClass('hidden');
Expand Down Expand Up @@ -495,7 +502,7 @@ <h1><img src="{{>relpath}}style/{{type}}.svg"/> {{name}}</h1>
var posts = document.getElementsByClassName('post'),
selected = window.getSelection().anchorNode.parentNode.parentNode,
p = [].indexOf.call(posts[0].childNodes, selected);
if (p > -1) anchor = (p/2) + 1;
if (p > -1) anchor = p;
});

$('#create').on('click', function() {
Expand Down

0 comments on commit b156198

Please sign in to comment.