##// END OF EJS Templates
Finishing display system work....
Finishing display system work. * Added image/jpeg MIME type to notebook format, the core display logic and the notebook. * Finished HTML, SVG, Image, Math, Javascript, JSON classes.

File last commit:

r4379:0c51946a
r4528:08ef328c
Show More
pager.js
95 lines | 2.4 KiB | application/javascript | JavascriptLexer
Brian E. Granger
Refactoring pager into its own class.
r4357
//============================================================================
// Pager
//============================================================================
var IPython = (function (IPython) {
var utils = IPython.utils;
Brian E. Granger
Left panel is now working.
r4363 var Pager = function (pager_selector, pager_splitter_selector) {
Brian E. Granger
Refactoring pager into its own class.
r4357 this.pager_element = $(pager_selector);
Brian E. Granger
Left panel is now working.
r4363 this.pager_splitter_element = $(pager_splitter_selector);
Brian E. Granger
Pager is working again.
r4361 this.expanded = true;
Brian E. Granger
Work on save widget, kernel status widget and notebook section.
r4372 this.percentage_height = 0.40;
Brian E. Granger
Refactoring pager into its own class.
r4357 this.style();
this.bind_events();
};
Pager.prototype.style = function () {
Brian E. Granger
Left panel is now working.
r4363 this.pager_splitter_element.addClass('border-box-sizing ui-widget ui-state-default');
Brian E. Granger
Pager is working again.
r4361 this.pager_element.addClass('border-box-sizing ui-widget');
Brian E. Granger
Refactoring pager into its own class.
r4357 };
Pager.prototype.bind_events = function () {
var that = this;
Brian E. Granger
Pager is working again.
r4361
this.pager_element.bind('collapse_pager', function () {
that.pager_element.hide('fast');
});
this.pager_element.bind('expand_pager', function () {
that.pager_element.show('fast');
Brian E. Granger
Refactoring pager into its own class.
r4357 });
Brian E. Granger
Left panel is now working.
r4363 this.pager_splitter_element.hover(
Brian E. Granger
Refactoring pager into its own class.
r4357 function () {
Brian E. Granger
Left panel is now working.
r4363 that.pager_splitter_element.addClass('ui-state-hover');
Brian E. Granger
Refactoring pager into its own class.
r4357 },
function () {
Brian E. Granger
Left panel is now working.
r4363 that.pager_splitter_element.removeClass('ui-state-hover');
Brian E. Granger
Refactoring pager into its own class.
r4357 }
);
Brian E. Granger
Pager is working again.
r4361
Brian E. Granger
Left panel is now working.
r4363 this.pager_splitter_element.click(function () {
Brian E. Granger
Pager is working again.
r4361 that.toggle();
});
Brian E. Granger
Left panel is now working.
r4363
Brian E. Granger
Refactoring pager into its own class.
r4357 };
Pager.prototype.collapse = function () {
Brian E. Granger
Pager is working again.
r4361 if (this.expanded === true) {
this.pager_element.add($('div#notebook')).trigger('collapse_pager');
this.expanded = false;
};
Brian E. Granger
Refactoring pager into its own class.
r4357 };
Pager.prototype.expand = function () {
Brian E. Granger
Pager is working again.
r4361 if (this.expanded !== true) {
this.pager_element.add($('div#notebook')).trigger('expand_pager');
this.expanded = true;
};
};
Pager.prototype.toggle = function () {
if (this.expanded === true) {
this.collapse();
} else {
this.expand();
};
Brian E. Granger
Refactoring pager into its own class.
r4357 };
Pager.prototype.clear = function (text) {
this.pager_element.empty();
};
Pager.prototype.append_text = function (text) {
Brian E. Granger
Updating font-sizing to use the YUI protocol.
r4379 var toinsert = $("<div/>").addClass("output_area output_stream");
toinsert.append($('<pre/>').html(utils.fixConsole(text)));
Brian E. Granger
Refactoring pager into its own class.
r4357 this.pager_element.append(toinsert);
};
IPython.Pager = Pager;
return IPython;
}(IPython));