Skip to content

Commit 58eca38

Browse files
authored
Merge pull request #63 from nm-t/master
[FEAT] Added minor styling to keyboard
2 parents 6fa704d + 9ce4f45 commit 58eca38

15 files changed

+44
-15
lines changed

css.css css/css.css

File renamed without changes.
File renamed without changes.

problems.css css/problems.css

File renamed without changes.

test.css css/test.css

File renamed without changes.

tutorial.css css/tutorial.css

File renamed without changes.

virtual_keyboard.css css/virtual_keyboard.css

+18
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
}
2222

2323
.keyboard_wrapper {
24+
user-select: none;
25+
-moz-user-select: none;
26+
-webkit-user-select: none;
27+
-ms-user-select: none;
28+
font-family: sans-serif;
29+
font-size: 14px;
2430
margin-left: 78px;
2531
width: 730px;
2632
}
@@ -75,6 +81,18 @@
7581
box-shadow: 2px 2px 2px black;
7682
}
7783

84+
.keyButton.medium {
85+
width: 62px;
86+
}
87+
88+
.keyButton.large {
89+
width: 88px;
90+
}
91+
92+
.keyButton.space {
93+
width: 355px;
94+
}
95+
7896
.keyButton.pressed_down {
7997
box-shadow: none;
8098
background-color: #555 !important;

development.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset='utf-8' />
66
<title>Open Vim</title>
7-
<link rel="stylesheet" type="text/css" href="development.css?version={VERSION}" />
7+
<link rel="stylesheet" type="text/css" href="css/development.css?version={VERSION}" />
88

99
<script type="text/javascript">
1010
var _gaq = _gaq || [];

js/tutorial/init_tutorial.js

+13
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ function init_tutorial() {
6464
}
6565
});
6666

67+
updateModifierKeys();
68+
6769
var tutorial = createTutorial($(this), interpreter, messager, doc);
6870
register_VIM_TUTORIAL_SECTIONS(interpreter, messager,
6971
tutorial.createSection, tutorial.registerSection, tutorial.showCommandOneByOne, doc);
@@ -75,3 +77,14 @@ function init_tutorial() {
7577
});
7678
});
7779
}
80+
81+
function updateModifierKeys() {
82+
addSizeClass('caps', 'medium');
83+
addSizeClass('Enter', 'medium');
84+
addSizeClass('shift', 'large');
85+
addSizeClass('Space', 'space');
86+
}
87+
88+
function addSizeClass(key, size){
89+
$(".keyButton:contains('" + key + "')").addClass(size);
90+
}

js/virtual_keyboard.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function create_VIM_VIRTUAL_KEYBOARD() {
2626
two('9', ')'), two('0', '=')];
2727
var tabRow = ['tab', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', {key: 'Backspace', label: '<='}];
2828
var capslockRow = ['caps', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', '*', 'Enter'];
29-
var shiftRow = ['shift', two('>', '<'), 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.'];
29+
var shiftRow = ['shift', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', two('>', '<')];
3030
var bottomRow = ['ctrl', 'alt', 'Space'];
3131

3232
function createKeyButton(key) {
@@ -38,16 +38,14 @@ function create_VIM_VIRTUAL_KEYBOARD() {
3838
else if(key.primary !== undefined) {
3939
var $key = $('<div />', { 'text': (key.primary + " " + key.secondary), 'class': 'keyButton' });
4040
$key.data('keyboard', key.primary);
41-
return $key;
4241
} else if(key.key !== undefined) {
4342
var $key = $('<div />', { 'text': key.label, 'class': 'keyButton' });
4443
$key.data('keyboard', key.key);
45-
return $key;
4644
} else {
4745
var $key = $('<div />', { 'text': key, 'class': 'keyButton' });
4846
$key.data('keyboard', key);
49-
return $key;
5047
}
48+
return $key;
5149
}
5250

5351
function createRow(row) {

problems.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<html lang='en' xmlns='http://www.w3.org/1999/xhtml'>
44
<head>
55
<meta charset='utf-8' />
6-
<link rel="stylesheet" type="text/css" href="css.css?version={VERSION}" />
7-
<link rel="stylesheet" type="text/css" href="problems.css?version={VERSION}" />
6+
<link rel="stylesheet" type="text/css" href="css/css.css?version={VERSION}" />
7+
<link rel="stylesheet" type="text/css" href="css/problems.css?version={VERSION}" />
88

99
<title>Interactive Vim tutorial - problems</title>
1010

sandbox.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<html lang='en' xmlns='http://www.w3.org/1999/xhtml'>
44
<head>
55
<meta charset='utf-8' />
6-
<link rel="stylesheet" type="text/css" href="css.css?version={VERSION}" />
6+
<link rel="stylesheet" type="text/css" href="css/css.css?version={VERSION}" />
77
<title>Interactive Vim tutorial - sandbox</title>
88

99
<!-- GENERAL (mostly) -->

tests.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<html lang='en' xmlns='http://www.w3.org/1999/xhtml'>
44
<head>
55
<meta charset='utf-8' />
6-
<link rel="stylesheet" type="text/css" href="css.css?version={VERSION}" />
7-
<link rel="stylesheet" type="text/css" href="test.css?version={VERSION}" />
6+
<link rel="stylesheet" type="text/css" href="css/css.css?version={VERSION}" />
7+
<link rel="stylesheet" type="text/css" href="css/test.css?version={VERSION}" />
88
<title>Interactive Vim tutorial - testing</title>
99

1010
<!-- GENERAL (mostly) -->

toproduction.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
cp -R -v *.css *.html *.gif js production
1+
cp -R -v *.html *.gif css js production
22
./setversion.sh

tutorial.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<html lang='en' xmlns='http://www.w3.org/1999/xhtml'>
44
<head>
55
<meta charset='utf-8' />
6-
<link rel="stylesheet" type="text/css" href="css.css?version={VERSION}" />
7-
<link rel="stylesheet" type="text/css" href="tutorial.css?version={VERSION}" />
8-
<link rel="stylesheet" type="text/css" href="virtual_keyboard.css?version={VERSION}" />
6+
<link rel="stylesheet" type="text/css" href="css/css.css?version={VERSION}" />
7+
<link rel="stylesheet" type="text/css" href="css/tutorial.css?version={VERSION}" />
8+
<link rel="stylesheet" type="text/css" href="css/virtual_keyboard.css?version={VERSION}" />
99

1010
<title>Interactive Vim tutorial</title>
1111

twosandboxes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<html lang='en' xmlns='http://www.w3.org/1999/xhtml'>
44
<head>
55
<meta charset='utf-8' />
6-
<link rel="stylesheet" type="text/css" href="css.css?version={VERSION}" />
6+
<link rel="stylesheet" type="text/css" href="css/css.css?version={VERSION}" />
77
<title>Interactive Vim tutorial - two sandboxes</title>
88

99
<!-- GENERAL (mostly) -->

0 commit comments

Comments
 (0)