MCPcopy
hub / github.com/dirk1983/deepseek / autoresize

Function autoresize

js/chat.js:100–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98}
99
100function autoresize() {
101 var textarea = $('#kw-target');
102 var width = textarea.width();
103 var content = (textarea.val() + "a").replace(/\\n/g, '<br>');
104 var div = $('<div>').css({
105 'position': 'absolute',
106 'top': '-99999px',
107 'border': '1px solid red',
108 'width': width,
109 'font-size': '15px',
110 'line-height': '20px',
111 'white-space': 'pre-wrap'
112 }).html(content).appendTo('body');
113 var height = div.height();
114 var rows = Math.ceil(height / 20);
115 div.remove();
116 textarea.attr('rows', rows);
117 $("#article-wrapper").height(parseInt($(window).height()) - parseInt($("#fixed-block").height()) - parseInt($(".layout-header").height()) - 80);
118}
119
120$(document).ready(function () {
121 initcode();

Callers 4

insertPresetTextFunction · 0.85
chat.jsFile · 0.85
drawFunction · 0.85
streamingFunction · 0.85

Calls 1

$Function · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…