Skip to content

Commit

Permalink
Merge pull request #2934 from WPO-Foundation/custommetricplaceholder
Browse files Browse the repository at this point in the history
A placeholder to remind folks of the [metric name]
  • Loading branch information
stoyan authored Jun 26, 2023
2 parents 7885d09 + e3e44f2 commit 24851c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions www/assets/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ async function initCodeField(source, language = "js") {
const codeArea = new CodeFlask(codeEl, {
language,
});
codeArea.elTextarea.placeholder = originalTextarea.placeholder.replace(/\\n/g, '\n');
codeArea.onUpdate((code) => (hidden.value = code));
window.codeFlasks[source] = codeArea;
}
Expand Down
2 changes: 1 addition & 1 deletion www/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ function enableDisableLHSimple(){
document.addEventListener('DOMContentLoaded', () => initFileReader('custom_metrics_file', 'custom'));
</script>
</p>
<textarea name="custom" class="large" id="custom" cols="0" rows="0"></textarea>
<textarea name="custom" class="large" id="custom" cols="0" rows="0" placeholder="[metricname]\nreturn code;"></textarea>
</div>
<div class="notification-container">
<div class="notification">
Expand Down

0 comments on commit 24851c3

Please sign in to comment.