Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
haoqu.ma
/
gotty
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 27b64361
authored
Aug 22, 2017
by
Iwasaki Yudai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename TermXterm and TermHterm to Xterm and Hterm
1 parent
70aaf330
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
40 deletions
js/dist/bundle.js
js/dist/bundle.js.map
js/dist/hterm.d.ts
js/dist/xterm.d.ts
js/src/hterm.ts
js/src/main.ts
js/src/xterm.ts
js/dist/bundle.js
View file @
27b6436
...
@@ -2479,8 +2479,8 @@ exports.getRawByteCoords = getRawByteCoords;
...
@@ -2479,8 +2479,8 @@ exports.getRawByteCoords = getRawByteCoords;
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
var
bare
=
__webpack_require__
(
14
);
var
bare
=
__webpack_require__
(
14
);
var
Term
Hterm
=
(
function
()
{
var
Hterm
=
(
function
()
{
function
Term
Hterm
(
elem
)
{
function
Hterm
(
elem
)
{
this
.
elem
=
elem
;
this
.
elem
=
elem
;
bare
.
hterm
.
defaultStorage
=
new
bare
.
lib
.
Storage
.
Memory
();
bare
.
hterm
.
defaultStorage
=
new
bare
.
lib
.
Storage
.
Memory
();
this
.
term
=
new
bare
.
hterm
.
Terminal
();
this
.
term
=
new
bare
.
hterm
.
Terminal
();
...
@@ -2490,17 +2490,17 @@ var TermHterm = (function () {
...
@@ -2490,17 +2490,17 @@ var TermHterm = (function () {
this
.
term
.
installKeyboard
();
this
.
term
.
installKeyboard
();
}
}
;
;
Term
Hterm
.
prototype
.
info
=
function
()
{
Hterm
.
prototype
.
info
=
function
()
{
return
{
columns
:
this
.
columns
,
rows
:
this
.
rows
};
return
{
columns
:
this
.
columns
,
rows
:
this
.
rows
};
};
};
;
;
Term
Hterm
.
prototype
.
output
=
function
(
data
)
{
Hterm
.
prototype
.
output
=
function
(
data
)
{
if
(
this
.
term
.
io
!=
null
)
{
if
(
this
.
term
.
io
!=
null
)
{
this
.
term
.
io
.
writeUTF16
(
data
);
this
.
term
.
io
.
writeUTF16
(
data
);
}
}
};
};
;
;
Term
Hterm
.
prototype
.
showMessage
=
function
(
message
,
timeout
)
{
Hterm
.
prototype
.
showMessage
=
function
(
message
,
timeout
)
{
this
.
message
=
message
;
this
.
message
=
message
;
if
(
timeout
>
0
)
{
if
(
timeout
>
0
)
{
this
.
term
.
io
.
showOverlay
(
message
,
timeout
);
this
.
term
.
io
.
showOverlay
(
message
,
timeout
);
...
@@ -2510,22 +2510,22 @@ var TermHterm = (function () {
...
@@ -2510,22 +2510,22 @@ var TermHterm = (function () {
}
}
};
};
;
;
Term
Hterm
.
prototype
.
removeMessage
=
function
()
{
Hterm
.
prototype
.
removeMessage
=
function
()
{
// there is no hideOverlay(), so show the same message with 0 sec
// there is no hideOverlay(), so show the same message with 0 sec
this
.
term
.
io
.
showOverlay
(
this
.
message
,
0
);
this
.
term
.
io
.
showOverlay
(
this
.
message
,
0
);
};
};
Term
Hterm
.
prototype
.
setWindowTitle
=
function
(
title
)
{
Hterm
.
prototype
.
setWindowTitle
=
function
(
title
)
{
this
.
term
.
setWindowTitle
(
title
);
this
.
term
.
setWindowTitle
(
title
);
};
};
;
;
Term
Hterm
.
prototype
.
setPreferences
=
function
(
value
)
{
Hterm
.
prototype
.
setPreferences
=
function
(
value
)
{
var
_this
=
this
;
var
_this
=
this
;
Object
.
keys
(
value
).
forEach
(
function
(
key
)
{
Object
.
keys
(
value
).
forEach
(
function
(
key
)
{
_this
.
term
.
getPrefs
().
set
(
key
,
value
[
key
]);
_this
.
term
.
getPrefs
().
set
(
key
,
value
[
key
]);
});
});
};
};
;
;
Term
Hterm
.
prototype
.
onInput
=
function
(
callback
)
{
Hterm
.
prototype
.
onInput
=
function
(
callback
)
{
this
.
io
.
onVTKeystroke
=
function
(
data
)
{
this
.
io
.
onVTKeystroke
=
function
(
data
)
{
callback
(
data
);
callback
(
data
);
};
};
...
@@ -2534,7 +2534,7 @@ var TermHterm = (function () {
...
@@ -2534,7 +2534,7 @@ var TermHterm = (function () {
};
};
};
};
;
;
Term
Hterm
.
prototype
.
onResize
=
function
(
callback
)
{
Hterm
.
prototype
.
onResize
=
function
(
callback
)
{
var
_this
=
this
;
var
_this
=
this
;
this
.
io
.
onTerminalResize
=
function
(
columns
,
rows
)
{
this
.
io
.
onTerminalResize
=
function
(
columns
,
rows
)
{
_this
.
columns
=
columns
;
_this
.
columns
=
columns
;
...
@@ -2543,22 +2543,22 @@ var TermHterm = (function () {
...
@@ -2543,22 +2543,22 @@ var TermHterm = (function () {
};
};
};
};
;
;
Term
Hterm
.
prototype
.
deactivate
=
function
()
{
Hterm
.
prototype
.
deactivate
=
function
()
{
this
.
io
.
onVTKeystroke
=
null
;
this
.
io
.
onVTKeystroke
=
null
;
this
.
io
.
sendString
=
null
;
this
.
io
.
sendString
=
null
;
this
.
io
.
onTerminalResize
=
null
;
this
.
io
.
onTerminalResize
=
null
;
this
.
term
.
uninstallKeyboard
();
this
.
term
.
uninstallKeyboard
();
};
};
Term
Hterm
.
prototype
.
reset
=
function
()
{
Hterm
.
prototype
.
reset
=
function
()
{
this
.
removeMessage
();
this
.
removeMessage
();
this
.
term
.
installKeyboard
();
this
.
term
.
installKeyboard
();
};
};
Term
Hterm
.
prototype
.
close
=
function
()
{
Hterm
.
prototype
.
close
=
function
()
{
this
.
term
.
uninstallKeyboard
();
this
.
term
.
uninstallKeyboard
();
};
};
return
Term
Hterm
;
return
Hterm
;
}());
}());
exports
.
TermHterm
=
Term
Hterm
;
exports
.
Hterm
=
Hterm
;
/***/
}),
/***/
}),
...
@@ -2741,8 +2741,8 @@ exports.WebTTY = WebTTY;
...
@@ -2741,8 +2741,8 @@ exports.WebTTY = WebTTY;
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
var
bare
=
__webpack_require__
(
0
);
var
bare
=
__webpack_require__
(
0
);
bare
.
loadAddon
(
"fit"
);
bare
.
loadAddon
(
"fit"
);
var
Term
Xterm
=
(
function
()
{
var
Xterm
=
(
function
()
{
function
Term
Xterm
(
elem
)
{
function
Xterm
(
elem
)
{
var
_this
=
this
;
var
_this
=
this
;
this
.
elem
=
elem
;
this
.
elem
=
elem
;
this
.
term
=
new
bare
();
this
.
term
=
new
bare
();
...
@@ -2761,15 +2761,15 @@ var TermXterm = (function () {
...
@@ -2761,15 +2761,15 @@ var TermXterm = (function () {
this
.
term
.
open
(
elem
,
true
);
this
.
term
.
open
(
elem
,
true
);
}
}
;
;
Term
Xterm
.
prototype
.
info
=
function
()
{
Xterm
.
prototype
.
info
=
function
()
{
return
{
columns
:
this
.
term
.
cols
,
rows
:
this
.
term
.
rows
};
return
{
columns
:
this
.
term
.
cols
,
rows
:
this
.
term
.
rows
};
};
};
;
;
Term
Xterm
.
prototype
.
output
=
function
(
data
)
{
Xterm
.
prototype
.
output
=
function
(
data
)
{
this
.
term
.
write
(
data
);
this
.
term
.
write
(
data
);
};
};
;
;
Term
Xterm
.
prototype
.
showMessage
=
function
(
message
,
timeout
)
{
Xterm
.
prototype
.
showMessage
=
function
(
message
,
timeout
)
{
var
_this
=
this
;
var
_this
=
this
;
this
.
message
.
textContent
=
message
;
this
.
message
.
textContent
=
message
;
this
.
elem
.
appendChild
(
this
.
message
);
this
.
elem
.
appendChild
(
this
.
message
);
...
@@ -2783,46 +2783,46 @@ var TermXterm = (function () {
...
@@ -2783,46 +2783,46 @@ var TermXterm = (function () {
}
}
};
};
;
;
Term
Xterm
.
prototype
.
removeMessage
=
function
()
{
Xterm
.
prototype
.
removeMessage
=
function
()
{
if
(
this
.
message
.
parentNode
==
this
.
elem
)
{
if
(
this
.
message
.
parentNode
==
this
.
elem
)
{
this
.
elem
.
removeChild
(
this
.
message
);
this
.
elem
.
removeChild
(
this
.
message
);
}
}
};
};
Term
Xterm
.
prototype
.
setWindowTitle
=
function
(
title
)
{
Xterm
.
prototype
.
setWindowTitle
=
function
(
title
)
{
document
.
title
=
title
;
document
.
title
=
title
;
};
};
;
;
Term
Xterm
.
prototype
.
setPreferences
=
function
(
value
)
{
Xterm
.
prototype
.
setPreferences
=
function
(
value
)
{
};
};
;
;
Term
Xterm
.
prototype
.
onInput
=
function
(
callback
)
{
Xterm
.
prototype
.
onInput
=
function
(
callback
)
{
this
.
term
.
on
(
"data"
,
function
(
data
)
{
this
.
term
.
on
(
"data"
,
function
(
data
)
{
callback
(
data
);
callback
(
data
);
});
});
};
};
;
;
Term
Xterm
.
prototype
.
onResize
=
function
(
callback
)
{
Xterm
.
prototype
.
onResize
=
function
(
callback
)
{
this
.
term
.
on
(
"resize"
,
function
(
data
)
{
this
.
term
.
on
(
"resize"
,
function
(
data
)
{
callback
(
data
.
cols
,
data
.
rows
);
callback
(
data
.
cols
,
data
.
rows
);
});
});
};
};
;
;
Term
Xterm
.
prototype
.
deactivate
=
function
()
{
Xterm
.
prototype
.
deactivate
=
function
()
{
this
.
term
.
off
(
"data"
);
this
.
term
.
off
(
"data"
);
this
.
term
.
off
(
"resize"
);
this
.
term
.
off
(
"resize"
);
this
.
term
.
blur
();
this
.
term
.
blur
();
};
};
Term
Xterm
.
prototype
.
reset
=
function
()
{
Xterm
.
prototype
.
reset
=
function
()
{
this
.
removeMessage
();
this
.
removeMessage
();
this
.
term
.
clear
();
this
.
term
.
clear
();
};
};
Term
Xterm
.
prototype
.
close
=
function
()
{
Xterm
.
prototype
.
close
=
function
()
{
window
.
removeEventListener
(
"resize"
,
this
.
resizeListener
);
window
.
removeEventListener
(
"resize"
,
this
.
resizeListener
);
this
.
term
.
destroy
();
this
.
term
.
destroy
();
};
};
return
Term
Xterm
;
return
Xterm
;
}());
}());
exports
.
TermXterm
=
Term
Xterm
;
exports
.
Xterm
=
Xterm
;
/***/
}),
/***/
}),
...
@@ -20831,10 +20831,10 @@ var elem = document.getElementById("terminal");
...
@@ -20831,10 +20831,10 @@ var elem = document.getElementById("terminal");
if
(
elem
!==
null
)
{
if
(
elem
!==
null
)
{
var
term
;
var
term
;
if
(
gotty_term
==
"hterm"
)
{
if
(
gotty_term
==
"hterm"
)
{
term
=
new
hterm_1
.
Term
Hterm
(
elem
);
term
=
new
hterm_1
.
Hterm
(
elem
);
}
}
else
{
else
{
term
=
new
xterm_1
.
Term
Xterm
(
elem
);
term
=
new
xterm_1
.
Xterm
(
elem
);
}
}
var
httpsEnabled
=
window
.
location
.
protocol
==
"https:"
;
var
httpsEnabled
=
window
.
location
.
protocol
==
"https:"
;
var
url
=
(
httpsEnabled
?
'wss://'
:
'ws://'
)
+
window
.
location
.
host
+
window
.
location
.
pathname
+
'ws'
;
var
url
=
(
httpsEnabled
?
'wss://'
:
'ws://'
)
+
window
.
location
.
host
+
window
.
location
.
pathname
+
'ws'
;
...
...
js/dist/bundle.js.map
View file @
27b6436
This diff could not be displayed because it is too large.
js/dist/hterm.d.ts
View file @
27b6436
import
*
as
bare
from
"libapps"
;
import
*
as
bare
from
"libapps"
;
export
declare
class
Term
Hterm
{
export
declare
class
Hterm
{
elem
:
HTMLElement
;
elem
:
HTMLElement
;
term
:
bare
.
Terminal
;
term
:
bare
.
Terminal
;
io
:
bare
.
IO
;
io
:
bare
.
IO
;
...
...
js/dist/xterm.d.ts
View file @
27b6436
import
*
as
bare
from
"xterm"
;
import
*
as
bare
from
"xterm"
;
export
declare
class
Term
Xterm
{
export
declare
class
Xterm
{
elem
:
HTMLElement
;
elem
:
HTMLElement
;
message
:
HTMLElement
;
message
:
HTMLElement
;
messageTimeout
:
number
;
messageTimeout
:
number
;
...
...
js/src/hterm.ts
View file @
27b6436
import
*
as
bare
from
"libapps"
;
import
*
as
bare
from
"libapps"
;
export
class
Term
Hterm
{
export
class
Hterm
{
elem
:
HTMLElement
;
elem
:
HTMLElement
;
term
:
bare
.
Terminal
;
term
:
bare
.
Terminal
;
...
...
js/src/main.ts
View file @
27b6436
import
{
Term
Hterm
}
from
"./hterm"
;
import
{
Hterm
}
from
"./hterm"
;
import
{
Term
Xterm
}
from
"./xterm"
;
import
{
Xterm
}
from
"./xterm"
;
import
{
Terminal
,
WebTTY
,
protocols
}
from
"./webtty"
;
import
{
Terminal
,
WebTTY
,
protocols
}
from
"./webtty"
;
import
{
ConnectionFactory
}
from
"./websocket"
;
import
{
ConnectionFactory
}
from
"./websocket"
;
...
@@ -12,9 +12,9 @@ const elem = document.getElementById("terminal")
...
@@ -12,9 +12,9 @@ const elem = document.getElementById("terminal")
if
(
elem
!==
null
)
{
if
(
elem
!==
null
)
{
var
term
:
Terminal
;
var
term
:
Terminal
;
if
(
gotty_term
==
"hterm"
)
{
if
(
gotty_term
==
"hterm"
)
{
term
=
new
Term
Hterm
(
elem
);
term
=
new
Hterm
(
elem
);
}
else
{
}
else
{
term
=
new
Term
Xterm
(
elem
);
term
=
new
Xterm
(
elem
);
}
}
const
httpsEnabled
=
window
.
location
.
protocol
==
"https:"
;
const
httpsEnabled
=
window
.
location
.
protocol
==
"https:"
;
const
url
=
(
httpsEnabled
?
'wss://'
:
'ws://'
)
+
window
.
location
.
host
+
window
.
location
.
pathname
+
'ws'
;
const
url
=
(
httpsEnabled
?
'wss://'
:
'ws://'
)
+
window
.
location
.
host
+
window
.
location
.
pathname
+
'ws'
;
...
...
js/src/xterm.ts
View file @
27b6436
...
@@ -2,7 +2,7 @@ import * as bare from "xterm";
...
@@ -2,7 +2,7 @@ import * as bare from "xterm";
bare
.
loadAddon
(
"fit"
);
bare
.
loadAddon
(
"fit"
);
export
class
Term
Xterm
{
export
class
Xterm
{
elem
:
HTMLElement
;
elem
:
HTMLElement
;
message
:
HTMLElement
;
message
:
HTMLElement
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment