mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-14 18:27:25 +08:00
Add .editorconfig file for consistent styling (#76)
This should take effect when editors with [EditorConfig](http://editorconfig.org/) support are used. Signed-off-by: Antonis Kalipetis <akalipetis@gmail.com>
This commit is contained in:
parent
1af2b3665f
commit
fd52a544d1
14
.editorconfig
Normal file
14
.editorconfig
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
# Tab indentation (no size specified)
|
||||||
|
[{Makefile,*.go}]
|
||||||
|
indent_style = tab
|
@ -1,4 +1,4 @@
|
|||||||
(function () {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var app = angular.module('DockerPlay', ['ngMaterial']);
|
var app = angular.module('DockerPlay', ['ngMaterial']);
|
||||||
@ -21,7 +21,7 @@
|
|||||||
$scope.ttl = '--:--:--';
|
$scope.ttl = '--:--:--';
|
||||||
$scope.connected = true;
|
$scope.connected = true;
|
||||||
|
|
||||||
angular.element($window).bind('resize', function(){
|
angular.element($window).bind('resize', function() {
|
||||||
if ($scope.selectedInstance) {
|
if ($scope.selectedInstance) {
|
||||||
$scope.resize($scope.selectedInstance.term.proposeGeometry());
|
$scope.resize($scope.selectedInstance.term.proposeGeometry());
|
||||||
}
|
}
|
||||||
@ -87,14 +87,14 @@
|
|||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
var socket = io({path: '/sessions/' + sessionId + '/ws'});
|
var socket = io({ path: '/sessions/' + sessionId + '/ws' });
|
||||||
|
|
||||||
socket.on('terminal out', function(name, data) {
|
socket.on('terminal out', function(name, data) {
|
||||||
var instance = $scope.idx[name];
|
var instance = $scope.idx[name];
|
||||||
|
|
||||||
if (!instance) {
|
if (!instance) {
|
||||||
// instance is new and was created from another client, we should add it
|
// instance is new and was created from another client, we should add it
|
||||||
$scope.upsertInstance({name: name});
|
$scope.upsertInstance({ name: name });
|
||||||
instance = $scope.idx[name];
|
instance = $scope.idx[name];
|
||||||
}
|
}
|
||||||
if (!instance.term) {
|
if (!instance.term) {
|
||||||
@ -113,7 +113,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on('new instance', function(name, ip, hostname) {
|
socket.on('new instance', function(name, ip, hostname) {
|
||||||
$scope.upsertInstance({name: name, ip: ip, hostname: hostname});
|
$scope.upsertInstance({ name: name, ip: ip, hostname: hostname });
|
||||||
$scope.$apply(function() {
|
$scope.$apply(function() {
|
||||||
if ($scope.instances.length == 1) {
|
if ($scope.instances.length == 1) {
|
||||||
$scope.showInstance($scope.instances[0]);
|
$scope.showInstance($scope.instances[0]);
|
||||||
@ -220,13 +220,13 @@
|
|||||||
return instance.term;
|
return instance.term;
|
||||||
}
|
}
|
||||||
|
|
||||||
var terminalContainer = document.getElementById('terminal-'+ instance.name);
|
var terminalContainer = document.getElementById('terminal-' + instance.name);
|
||||||
|
|
||||||
var term = new Terminal({
|
var term = new Terminal({
|
||||||
cursorBlink: false
|
cursorBlink: false
|
||||||
});
|
});
|
||||||
|
|
||||||
term.attachCustomKeydownHandler(function (e) {
|
term.attachCustomKeydownHandler(function(e) {
|
||||||
// Ctrl + Alt + C
|
// Ctrl + Alt + C
|
||||||
if (e.ctrlKey && e.altKey && (e.keyCode == 67)) {
|
if (e.ctrlKey && e.altKey && (e.keyCode == 67)) {
|
||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user