Fix webpack task in Gulp and fit add-on

This commit is contained in:
Paris Kasidiaris
2017-12-16 11:29:12 +02:00
parent 80450450e9
commit da604ff69c
5 changed files with 15 additions and 6 deletions
+3 -1
View File
@@ -91,6 +91,7 @@ function createTerminal() {
scrollback: parseInt(optionElements.scrollback.value, 10),
tabStopWidth: parseInt(optionElements.tabstopwidth.value, 10)
});
window.term = term; // Expose `term` to window for debugging purposes
term.on('resize', function (size) {
if (!pid) {
return;
@@ -105,8 +106,9 @@ function createTerminal() {
socketURL = protocol + location.hostname + ((location.port) ? (':' + location.port) : '') + '/terminals/';
term.open(terminalContainer);
term.fit();
term.winptyCompatInit();
term.fit();
term.focus();
// fit is called within a setTimeout, cols and rows need this.
setTimeout(function () {
+1 -1
View File
@@ -196,7 +196,7 @@ gulp.task('sorcery-addons', ['browserify-addons'], function () {
gulp.task('webpack', ['build'], function() {
return gulp.src('demo/main.js')
.pipe(webpack())
.pipe(webpack(require('./webpack.config.js')))
.pipe(gulp.dest('demo/dist/'));
});
+1 -1
View File
@@ -84,7 +84,7 @@
"build": "gulp build",
"prepublish": "npm run build",
"coveralls": "gulp coveralls",
"webpack": "webpack"
"webpack": "gulp webpack"
},
"dependencies": {}
}
+7 -2
View File
@@ -50,6 +50,11 @@ export function fit(term) {
};
export function apply(terminalConstructor) {
terminalConstructor.prototype.proposeGeometry = proposeGeometry.bind(this, this);
terminalConstructor.prototype.fit = fit.bind(this, this);
terminalConstructor.prototype.proposeGeometry = function() {
return proposeGeometry(this);
}
terminalConstructor.prototype.fit = function() {
return fit(this);
}
}
+3 -1
View File
@@ -27,6 +27,8 @@
* via `detach()` and a re-`attach()`.)
*/
let Zmodem;
export function zmodemAttach(term, ws, opts) {
if (!opts) opts = {};
@@ -81,7 +83,7 @@ export function zmodemAttach(term, ws, opts) {
}
export function apply(terminalConstructor) {
let Zmodem = (typeof window == 'object') ? (<any>window).ZModem : {Browser: null}; // Nullify browser for tests
Zmodem = (typeof window == 'object') ? (<any>window).ZModem : {Browser: null}; // Nullify browser for tests
terminalConstructor.prototype.zmodemAttach = zmodemAttach.bind(this, this);
terminalConstructor.prototype.zmodemBrowser = Zmodem.Browser