Skip to content

Instantly share code, notes, and snippets.

@rickcnagy
Created June 18, 2014 18:19
Show Gist options
  • Save rickcnagy/64d96aee8b69db777c3e to your computer and use it in GitHub Desktop.
Save rickcnagy/64d96aee8b69db777c3e to your computer and use it in GitHub Desktop.
LanguageOn QS Embed JS
qsMatchLabels = ["Questions or Comments"]
var loadingForTextareaReplace = setInterval(function() {
if (typeof _qs$ !== "undefined" && _qs$(".qslabel").length) {
clearInterval(loadingForTextareaReplace);
qsTextAreas();
moveComments();
}
}, 10);
function qsTextAreas() {
for (var i = 0; i < qsMatchLabels.length; i++) {
var label = qsMatchLabels[i];
var input = _qs$(".qslabel:contains(" + label +")").next(".qsinput");
if (input.length) {
input.html(input.html().replace("input", "textarea"));
}
}
}
function moveComments() {
var comments = _qs$(".qslabel:contains(Comments)");
comments = comments.add(comments.next(".qsinput"));
comments.detach();
comments.insertAfter(_qs$(".qsspace:last"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment