Skip to content

Commit 7d6a573

Browse files
authored
Start input type="text" migration (hestiacp#2947)
* Update text inputs on Edit Server form * Move text utility classes to utilities area * Update some text inputs in Add DNS Zone form * Update some text inputs in Add DNS Record form * Update some text inputs in Add Firewall Rule form * <input type="email"> * Remove "size" attribute from text inputs * Use helper class in Setup Webapp form * Remove unnecessary inline styles from Setup Webapp form * Class first after input type * Update text input in Add Access Key form * Consistent formatting of Add Access Key form * More <input type="email"> * Update text input in Add Web Domain form * Update "hint" text inputs * Update text inputs in Configure Server PHP form * Update text inputs in Configure Server MySQL form * Update text inputs in Configure Server NGINX form * Fix remaining <br><br> case * More consistent widths * More consistent inputs * More input consistency * Update text input on New IP List form * Update text input on Ban IP Address form * Update formatting and text inputs on Access Key form * Update text inputs on Edit Firewall Rule form * Misc tidy * Update text inputs on Edit DNS Zone form * Include .form-control in "focus first field of form" JS * Tidy some JS
1 parent 44e3131 commit 7d6a573

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+676
-990
lines changed

web/css/src/themes/default.css

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -198,22 +198,6 @@ a {
198198
color: #7c7c7c;
199199
}
200200

201-
.text-right {
202-
text-align: right;
203-
}
204-
205-
.text-center {
206-
text-align: center;
207-
}
208-
209-
.text-small {
210-
font-size: 0.85em;
211-
}
212-
213-
.text-italic {
214-
font-style: italic;
215-
}
216-
217201
.check-label {
218202
display: inline-block;
219203
cursor: pointer;
@@ -3891,10 +3875,30 @@ meter[value="4"]::-moz-meter-bar { background: green; }
38913875
display: none;
38923876
}
38933877

3878+
.text-right {
3879+
text-align: right !important;
3880+
}
3881+
3882+
.text-center {
3883+
text-align: center !important;
3884+
}
3885+
3886+
.text-small {
3887+
font-size: 0.85em !important;
3888+
}
3889+
3890+
.text-italic {
3891+
font-style: italic !important;
3892+
}
3893+
38943894
.u-mt15 {
38953895
margin-top: 15px !important;
38963896
}
38973897

3898+
.u-ml10 {
3899+
margin-left: 10px !important;
3900+
}
3901+
38983902
.u-mb20 {
38993903
margin-bottom: 20px !important;
39003904
}
@@ -3927,6 +3931,11 @@ meter[value="4"]::-moz-meter-bar { background: green; }
39273931
min-height: 300px !important;
39283932
}
39293933

3934+
.u-sideBySide {
3935+
display: flex !important;
3936+
align-items: center !important;
3937+
}
3938+
39303939
.u-console {
39313940
font-family: Inconsolata, "Lucida Console", Monaco, monospace !important;
39323941
white-space: pre !important;

web/css/themes/default.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/js/floating_layer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@
6060
jQuery(ref.container).bind('click.fl', function(evt)
6161
{
6262
jQuery(evt.target).hasClass(config.closeClass) ? flayer_destroy() : -1;
63-
if(!!config.outerClose)
63+
if(config.outerClose)
6464
jQuery(evt.target).hasClass('fl-cloud') ? flayer_destroy() : -1;
6565
});
6666

6767
// todo:
68-
!!config.outerClose ? jQuery(window).bind('keypress.fl', function(evt){evt.keyCode == 27 ? flayer_destroy() : -1;}) : -1;
68+
config.outerClose ? jQuery(window).bind('keypress.fl', function(evt){evt.keyCode == 27 ? flayer_destroy() : -1;}) : -1;
6969

7070
}
7171

@@ -121,7 +121,7 @@
121121
jQuery(window).unbind('scroll.fl');
122122
jQuery(window).unbind('resize.fl');
123123
jQuery(ref.container).unbind('click.fl');
124-
!!config.outerClose ? jQuery(window).unbind('keypress.fl') : -1;
124+
config.outerClose ? jQuery(window).unbind('keypress.fl') : -1;
125125
jQuery(config.returnParent).append(jQuery(elm).addClass('hidden'));
126126
jQuery(ref.container).remove();
127127
jQuery.browser.msie && jQuery.browser.version.substr(0,1)<7 ? show_selects() : -1;

web/js/hotkeys.js

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ shortcut = {
2424

2525
var ele = opt.target;
2626
if(typeof opt.target == 'string') ele = document.getElementById(opt.target);
27-
var ths = this;
2827
shortcut_combination = shortcut_combination.toLowerCase();
2928

3029
//The function to be called at keypress
3130
var func = function(e) {
3231
e = e || window.event;
33-
32+
3433
if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields
3534
var element;
3635
if(e.target) element=e.target;
@@ -39,19 +38,19 @@ shortcut = {
3938

4039
if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return;
4140
}
42-
41+
4342
//Find Which key is pressed
4443
if (e.keyCode) code = e.keyCode;
4544
else if (e.which) code = e.which;
4645
var character = String.fromCharCode(code).toLowerCase();
47-
46+
4847
if(code == 188) character=","; //If the user presses , when the type is onkeydown
4948
if(code == 190) character="."; //If the user presses , when the type is onkeydown
5049

5150
var keys = shortcut_combination.split("+");
5251
//Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked
5352
var kp = 0;
54-
53+
5554
//Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken
5655
var shift_nums = {
5756
"`":"~",
@@ -83,7 +82,7 @@ shortcut = {
8382
'return':13,
8483
'enter':13,
8584
'backspace':8,
86-
85+
8786
'scrolllock':145,
8887
'scroll_lock':145,
8988
'scroll':145,
@@ -93,28 +92,28 @@ shortcut = {
9392
'numlock':144,
9493
'num_lock':144,
9594
'num':144,
96-
95+
9796
'pause':19,
9897
'break':19,
99-
98+
10099
'insert':45,
101100
'home':36,
102101
'delete':46,
103102
'end':35,
104-
103+
105104
'pageup':33,
106105
'page_up':33,
107106
'pu':33,
108-
107+
109108
'pagedown':34,
110109
'page_down':34,
111110
'pd':34,
112-
111+
113112
'left':37,
114113
'up':38,
115114
'right':39,
116115
'down':40,
117-
116+
118117
'f1':112,
119118
'f2':113,
120119
'f3':114,
@@ -128,19 +127,19 @@ shortcut = {
128127
'f11':122,
129128
'f12':123
130129
}
131-
132-
var modifiers = {
130+
131+
var modifiers = {
133132
shift: { wanted:false, pressed:false},
134133
ctrl : { wanted:false, pressed:false},
135134
alt : { wanted:false, pressed:false},
136135
meta : { wanted:false, pressed:false} //Meta is Mac specific
137136
};
138-
137+
139138
if(e.ctrlKey) modifiers.ctrl.pressed = true;
140139
if(e.shiftKey) modifiers.shift.pressed = true;
141140
if(e.altKey) modifiers.alt.pressed = true;
142141
if(e.metaKey) modifiers.meta.pressed = true;
143-
142+
144143
for(var i=0; k=keys[i],i<keys.length; i++) {
145144
//Modifiers
146145
if(k == 'ctrl' || k == 'control') {
@@ -159,33 +158,33 @@ shortcut = {
159158
modifiers.meta.wanted = true;
160159
} else if(k.length > 1) { //If it is a special key
161160
if(special_keys[k] == code) kp++;
162-
161+
163162
} else if(opt['keycode']) {
164163
if(opt['keycode'] == code) kp++;
165164

166165
} else { //The special keys did not match
167166
if(character == k) kp++;
168167
else {
169168
if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase
170-
character = shift_nums[character];
169+
character = shift_nums[character];
171170
if(character == k) kp++;
172171
}
173172
}
174173
}
175174
}
176-
177-
if(kp == keys.length &&
175+
176+
if(kp == keys.length &&
178177
modifiers.ctrl.pressed == modifiers.ctrl.wanted &&
179178
modifiers.shift.pressed == modifiers.shift.wanted &&
180179
modifiers.alt.pressed == modifiers.alt.wanted &&
181180
modifiers.meta.pressed == modifiers.meta.wanted) {
182181
callback(e);
183-
182+
184183
if(!opt['propagate']) { //Stop the event
185184
//e.cancelBubble is supported by IE - this will kill the bubbling process.
186185
e.cancelBubble = true;
187186
e.returnValue = false;
188-
187+
189188
//e.stopPropagation works in Firefox.
190189
if (e.stopPropagation) {
191190
e.stopPropagation();
@@ -196,8 +195,8 @@ shortcut = {
196195
}
197196
}
198197
this.all_shortcuts[shortcut_combination] = {
199-
'callback':func,
200-
'target':ele,
198+
'callback':func,
199+
'target':ele,
201200
'event': opt['type']
202201
};
203202
//Attach the function with the event

web/js/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ $(document).ready(function(){
557557

558558
// focusing on the first input at form
559559
if( location.href.indexOf('lead=') == -1 && !$('.ui-dialog').is(':visible') ){
560-
$('#vstobjects .vst-input:not([disabled]), #vstobjects .form-select:not([disabled])').first().focus();
560+
$('#vstobjects .vst-input:not([disabled]), #vstobjects .form-control:not([disabled]), #vstobjects .form-select:not([disabled])').first().focus();
561561
}
562562

563563
$('.l-profile__notifications').click(function(){

web/js/pages/list_ssl.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function saveTextToBlob ( file, element ){
2-
text = document.getElementById(element).value;
3-
var textFileAsBlob = new Blob([text], {type:'text/plain'});
2+
var text = document.getElementById(element).value;
3+
var textFileAsBlob = new Blob([text], {type:'text/plain'});
44
var downloadLink = document.createElement("a");
55
downloadLink.download = file;
66
downloadLink.innerHTML = "Download File";
@@ -27,4 +27,4 @@ function saveTextToBlob ( file, element ){
2727
function destroyClickedElement(event)
2828
{
2929
document.body.removeChild(event.target);
30-
}
30+
}

web/js/templates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ App.Templates.html = {
1414
],
1515
notification_empty: [
1616
'<li class="empty"><span><i class="fas fa-bell-slash status-icon dim" style="font-size: 4rem;"></i><br><br>\
17-
'+App.Constants.NOTIFICATIONS_EMPTY+'\</span></li>'
17+
'+App.Constants.NOTIFICATIONS_EMPTY+'</span></li>'
1818
]
1919
},
2020
};

web/locale/hestiacp.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ msgid "Secret Key"
14091409
msgstr ""
14101410

14111411
#: ../../web/templates/pages/list_access_key.html:71
1412-
msgid "Warning! Last chance to save secrect access key!"
1412+
msgid "Warning! Last chance to save secret access key!"
14131413
msgstr ""
14141414

14151415
#: ../../web/templates/pages/list_stats.html:6

0 commit comments

Comments
 (0)