Show More
@@ -188,7 +188,17 b' div.input_prompt {' | |||
|
188 | 188 | color: blue; |
|
189 | 189 | } |
|
190 | 190 | |
|
191 |
|
|
|
191 | div.input_area { | |
|
192 | box-flex: 1; | |
|
193 | -webkit-box-flex: 1; | |
|
194 | -moz-box-flex: 1; | |
|
195 | box-sizing: border-box; | |
|
196 | -moz-box-sizing: border-box; | |
|
197 | -webkit-box-sizing: border-box; | |
|
198 | } | |
|
199 | ||
|
200 | textarea.input_textarea { | |
|
201 | width: 100%; | |
|
192 | 202 | text-align: left; |
|
193 | 203 | font-family: Monaco, Consolas, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; |
|
194 | 204 | font-size: inherit; |
@@ -199,13 +209,6 b' textarea.input_area {' | |||
|
199 | 209 | overflow: auto; |
|
200 | 210 | outline: none; |
|
201 | 211 | resize: none; |
|
202 | ||
|
203 | box-flex: 1; | |
|
204 | -webkit-box-flex: 1; | |
|
205 | -moz-box-flex: 1; | |
|
206 | box-sizing: border-box; | |
|
207 | -moz-box-sizing: border-box; | |
|
208 | -webkit-box-sizing: border-box; | |
|
209 | 212 | } |
|
210 | 213 | |
|
211 | 214 | div.output { |
@@ -546,21 +546,14 b' CodeCell.prototype = new Cell();' | |||
|
546 | 546 | |
|
547 | 547 | |
|
548 | 548 | CodeCell.prototype.create_element = function () { |
|
549 | var cell = $('<div></div>').addClass('cell code_cell') | |
|
550 |
var input = $('<div></div>').addClass('input') |
|
|
551 |
|
|
|
552 | ).append( | |
|
553 | $('<textarea/>').addClass('input_area'). | |
|
554 | attr('rows',1). | |
|
555 | attr('cols',80). | |
|
556 | attr('wrap','hard'). | |
|
557 | autoGrow() | |
|
558 | ); | |
|
559 | var output = $('<div></div>').addClass('output').append( | |
|
560 | $('<div/>').addClass('prompt output_prompt') | |
|
561 | ).append( | |
|
562 | $('<div/>').addClass('output_area') | |
|
563 | ); | |
|
549 | var cell = $('<div></div>').addClass('cell code_cell'); | |
|
550 | var input = $('<div></div>').addClass('input'); | |
|
551 | input.append($('<div/>').addClass('prompt input_prompt')); | |
|
552 | var input_textarea = $('<textarea/>').addClass('input_textarea').attr('rows',1).attr('wrap','hard').autoGrow(); | |
|
553 | input.append($('<div/>').addClass('input_area').append(input_textarea)); | |
|
554 | var output = $('<div></div>').addClass('output'); | |
|
555 | output.append($('<div/>').addClass('prompt output_prompt')); | |
|
556 | output.append($('<div/>').addClass('output_area')); | |
|
564 | 557 | cell.append(input).append(output); |
|
565 | 558 | this.element = cell; |
|
566 | 559 | this.collapse() |
@@ -635,11 +628,18 b' CodeCell.prototype.show_output_prompt = function () {' | |||
|
635 | 628 | this.element.find('div.output_prompt').show(); |
|
636 | 629 | }; |
|
637 | 630 | |
|
638 | ||
|
639 | 631 | CodeCell.prototype.get_code = function () { |
|
640 | 632 | return this.element.find("textarea.input_area").val(); |
|
641 | 633 | }; |
|
642 | 634 | |
|
635 | ||
|
636 | CodeCell.prototype.toJSON = function () { | |
|
637 | return { | |
|
638 | code : this.get_code(), | |
|
639 | cell_type : 'code', | |
|
640 | prompt_number : this.input_prompt_number | |
|
641 | }; | |
|
642 | }; | |
|
643 | 643 | //============================================================================ |
|
644 | 644 | // TextCell |
|
645 | 645 | //============================================================================ |
General Comments 0
You need to be logged in to leave comments.
Login now