Show More
@@ -122,6 +122,10 b' div#pager_splitter {' | |||||
122 | height: 8px; |
|
122 | height: 8px; | |
123 | } |
|
123 | } | |
124 |
|
124 | |||
|
125 | #pager_container { | |||
|
126 | position : relative; | |||
|
127 | } | |||
|
128 | ||||
125 | div#pager { |
|
129 | div#pager { | |
126 | padding: 15px; |
|
130 | padding: 15px; | |
127 | overflow: auto; |
|
131 | overflow: auto; |
@@ -15,6 +15,7 b' var IPython = (function (IPython) {' | |||||
15 |
|
15 | |||
16 | var Pager = function (pager_selector, pager_splitter_selector) { |
|
16 | var Pager = function (pager_selector, pager_splitter_selector) { | |
17 | this.pager_element = $(pager_selector); |
|
17 | this.pager_element = $(pager_selector); | |
|
18 | this.pager_button_area = $('#pager_button_area'); | |||
18 | var that = this; |
|
19 | var that = this; | |
19 | this.percentage_height = 0.40; |
|
20 | this.percentage_height = 0.40; | |
20 | this.pager_splitter_element = $(pager_splitter_selector) |
|
21 | this.pager_splitter_element = $(pager_splitter_selector) | |
@@ -39,9 +40,24 b' var IPython = (function (IPython) {' | |||||
39 | }); |
|
40 | }); | |
40 | this.expanded = false; |
|
41 | this.expanded = false; | |
41 | this.style(); |
|
42 | this.style(); | |
|
43 | this.create_button_area(); | |||
42 | this.bind_events(); |
|
44 | this.bind_events(); | |
43 | }; |
|
45 | }; | |
44 |
|
46 | |||
|
47 | Pager.prototype.create_button_area = function(){ | |||
|
48 | var that = this; | |||
|
49 | this.pager_button_area.append( | |||
|
50 | $('<a>').attr('role', "button") | |||
|
51 | .attr('title',"open the pager in an external window") | |||
|
52 | .addClass('ui-button') | |||
|
53 | .click(function(){that.detach()}) | |||
|
54 | .attr('style','position: absolute; right: 10px;') | |||
|
55 | .append( | |||
|
56 | $('<span>').addClass("ui-icon ui-icon-extlink") | |||
|
57 | ) | |||
|
58 | ) | |||
|
59 | }; | |||
|
60 | ||||
45 | Pager.prototype.style = function () { |
|
61 | Pager.prototype.style = function () { | |
46 | this.pager_splitter_element.addClass('border-box-sizing ui-widget ui-state-default'); |
|
62 | this.pager_splitter_element.addClass('border-box-sizing ui-widget ui-state-default'); | |
47 | this.pager_element.addClass('border-box-sizing ui-widget'); |
|
63 | this.pager_element.addClass('border-box-sizing ui-widget'); | |
@@ -114,6 +130,26 b' var IPython = (function (IPython) {' | |||||
114 | this.pager_element.empty(); |
|
130 | this.pager_element.empty(); | |
115 | }; |
|
131 | }; | |
116 |
|
132 | |||
|
133 | Pager.prototype.detach = function(){ | |||
|
134 | var w = window.open("","_blank") | |||
|
135 | $(w.document.head) | |||
|
136 | .append( | |||
|
137 | $('<link>') | |||
|
138 | .attr('rel',"stylesheet") | |||
|
139 | .attr('href',"/static/css/notebook.css") | |||
|
140 | .attr('type',"text/css") | |||
|
141 | ) | |||
|
142 | .append( | |||
|
143 | $('<title>').text("IPython Pager") | |||
|
144 | ); | |||
|
145 | var pager_body = $(w.document.body) | |||
|
146 | pager_body.attr('style','overflow:scroll'); | |||
|
147 | ||||
|
148 | pager_body.append(this.pager_element.children()) | |||
|
149 | w.document.close(); | |||
|
150 | this.collapse(); | |||
|
151 | ||||
|
152 | } | |||
117 |
|
153 | |||
118 | Pager.prototype.append_text = function (text) { |
|
154 | Pager.prototype.append_text = function (text) { | |
119 | var toinsert = $("<div/>").addClass("output_area output_stream"); |
|
155 | var toinsert = $("<div/>").addClass("output_area output_stream"); |
@@ -200,8 +200,12 b' data-notebook-id={{notebook_id}}' | |||||
200 | <div id="notebook_panel"> |
|
200 | <div id="notebook_panel"> | |
201 | <div id="notebook"></div> |
|
201 | <div id="notebook"></div> | |
202 | <div id="pager_splitter"></div> |
|
202 | <div id="pager_splitter"></div> | |
|
203 | <div id="pager_container"> | |||
|
204 | <div id='pager_button_area'> | |||
|
205 | </div> | |||
203 | <div id="pager"></div> |
|
206 | <div id="pager"></div> | |
204 | </div> |
|
207 | </div> | |
|
208 | </div> | |||
205 |
|
209 | |||
206 | </div> |
|
210 | </div> | |
207 | <div id='tooltip' class='tooltip ui-corner-all' style='display:none'></div> |
|
211 | <div id='tooltip' class='tooltip ui-corner-all' style='display:none'></div> |
General Comments 0
You need to be logged in to leave comments.
Login now