Skip to content

Commit c5c61c2

Browse files
authored
Merge pull request hestiacp#2453 from jaapmarcus/fix-xxs-issues-javascript
replace html() with text
2 parents 5c4ce71 + 640f822 commit c5c61c2

File tree

10 files changed

+48
-49
lines changed

10 files changed

+48
-49
lines changed

web/js/app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ $.fn.scrollTo = function( target, options, callback ){
6363
* The mask defaults to dateFormat.masks.default.
6464
*/
6565

66-
6766
var dateFormat = function () {
6867
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
6968
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,

web/js/pages/add_db.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Updates database username dynamically, showing its prefix
44
App.Actions.DB.update_db_username_hint = function(elm, hint) {
55
if (hint.trim() == '') {
6-
$(elm).parent().find('.hint').html('');
6+
$(elm).parent().find('.hint').text('');
77
}
88
$(elm).parent().find('.hint').text(GLOBAL.DB_USER_PREFIX + hint);
99
}
@@ -13,7 +13,7 @@ App.Actions.DB.update_db_username_hint = function(elm, hint) {
1313
// Updates database name dynamically, showing its prefix
1414
App.Actions.DB.update_db_databasename_hint = function(elm, hint) {
1515
if (hint.trim() == '') {
16-
$(elm).parent().find('.hint').html('');
16+
$(elm).parent().find('.hint').text('');
1717
}
1818
$(elm).parent().find('.hint').text(GLOBAL.DB_DBNAME_PREFIX + hint);
1919
}

web/js/pages/add_dns_rec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
App.Actions.DB.update_dns_record_hint = function(elm, hint) {
55
// clean hint
66
if (hint.trim() == '') {
7-
$(elm).parent().find('.hint').html('');
7+
$(elm).parent().find('.hint').text('');
88
}
99

1010
// set domain name without rec in case of @ entries

web/js/pages/add_mail_acc.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ generate_mail_credentials = function() {
141141
var div = $('.mail-infoblock').clone();
142142
div.find('#mail_configuration').remove();
143143
var pass=div.find('#v_password').text();
144-
if (pass=="") div.find('#v_password').html(' ');
144+
if (pass=="") div.find('#v_password').text(' ');
145145
var output = div.text();
146146
output=output.replace(/(?:\r\n|\r|\n|\t)/g, "|");
147147
output=output.replace(/ /g, "");
@@ -188,29 +188,29 @@ $(document).ready(function() {
188188

189189
switch(opt.attr('v_type')){
190190
case 'hostname':
191-
$('#td_imap_hostname').html(opt.attr('domain'));
192-
$('#td_smtp_hostname').html(opt.attr('domain'));
191+
$('#td_imap_hostname').text(opt.attr('domain'));
192+
$('#td_smtp_hostname').text(opt.attr('domain'));
193193
break;
194194
case 'starttls':
195-
$('#td_imap_port').html('143');
196-
$('#td_imap_encryption').html('STARTTLS');
197-
$('#td_smtp_port').html('587');
198-
$('#td_smtp_encryption').html('STARTTLS');
195+
$('#td_imap_port').text('143');
196+
$('#td_imap_encryption').text('STARTTLS');
197+
$('#td_smtp_port').text('587');
198+
$('#td_smtp_encryption').text('STARTTLS');
199199
break;
200200
case 'ssl':
201-
$('#td_imap_port').html('993');
202-
$('#td_imap_encryption').html('SSL / TLS');
203-
$('#td_smtp_port').html('465');
204-
$('#td_smtp_encryption').html('SSL / TLS');
201+
$('#td_imap_port').text('993');
202+
$('#td_imap_encryption').text('SSL / TLS');
203+
$('#td_smtp_port').text('465');
204+
$('#td_smtp_encryption').text('SSL / TLS');
205205
break;
206206
case 'no_encryption':
207-
$('#td_imap_hostname').html(opt.attr('domain'));
208-
$('#td_smtp_hostname').html(opt.attr('domain'));
207+
$('#td_imap_hostname').text(opt.attr('domain'));
208+
$('#td_smtp_hostname').text(opt.attr('domain'));
209209

210-
$('#td_imap_port').html('143');
211-
$('#td_imap_encryption').html(opt.attr('no_encryption'));
212-
$('#td_smtp_port').html('25');
213-
$('#td_smtp_encryption').html(opt.attr('no_encryption'));
210+
$('#td_imap_port').text('143');
211+
$('#td_imap_encryption').text(opt.attr('no_encryption'));
212+
$('#td_smtp_port').text('25');
213+
$('#td_smtp_encryption').text(opt.attr('no_encryption'));
214214
break;
215215
}
216216
generate_mail_credentials();

web/js/pages/add_web.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var domain = $('select[name="v-custom-doc-domain"]').val();
44
var folder = $('input[name="v-custom-doc-folder"]').val();
55
console.log(domain, folder);
6-
$('.custom_docroot_hint').html(prepath+domain+'/public_html/'+folder);
6+
$('.custom_docroot_hint').text(prepath+domain+'/public_html/'+folder);
77
}
88
App.Listeners.DB.keypress_custom_folder = function() {
99
var ref = $('input[name="v-custom-doc-folder"]');
@@ -40,7 +40,7 @@ App.Listeners.DB.change_custom_doc();
4040

4141
App.Actions.WEB.update_ftp_username_hint = function(elm, hint) {
4242
if (hint.trim() == '') {
43-
$(elm).parent().find('.hint').html('');
43+
$(elm).parent().find('.hint').text('');
4444
}
4545

4646
hint = hint.replace(/[^\w\d]/gi, '');
@@ -88,7 +88,7 @@ App.Listeners.WEB.keypress_domain_name = function() {
8888

8989
App.Actions.WEB.update_ftp_path_hint = function(elm, hint) {
9090
if (hint.trim() == '') {
91-
$(elm).parent().find('.v-ftp-path-hint').html('');
91+
$(elm).parent().find('.v-ftp-path-hint').text('');
9292
}
9393

9494
if (hint[0] != '/') {

web/js/pages/edit_db.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Updates database username dynamically, showing its prefix
44
App.Actions.DB.update_db_username_hint = function(elm, hint) {
55
if (hint.trim() == '') {
6-
$(elm).parent().find('.hint').html('');
6+
$(elm).parent().find('.hint').text('');
77
}
88
$(elm).parent().find('.hint').text(GLOBAL.DB_USER_PREFIX + hint);
99
}
@@ -13,7 +13,7 @@ App.Actions.DB.update_db_username_hint = function(elm, hint) {
1313
// Updates database name dynamically, showing its prefix
1414
App.Actions.DB.update_db_databasename_hint = function(elm, hint) {
1515
if (hint.trim() == '') {
16-
$(elm).parent().find('.hint').html('');
16+
$(elm).parent().find('.hint').text('');
1717
}
1818
$(elm).parent().find('.hint').text(GLOBAL.DB_DBNAME_PREFIX + hint);
1919
}

web/js/pages/edit_dns_rec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
App.Actions.DB.update_dns_record_hint = function(elm, hint) {
55
// clean hint
66
if (hint.trim() == '') {
7-
$(elm).parent().find('.hint').html('');
7+
$(elm).parent().find('.hint').text('');
88
}
99

1010
// set domain name without rec in case of @ entries

web/js/pages/edit_mail_acc.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ generate_mail_credentials = function() {
119119
var div = $('.mail-infoblock').clone();
120120
div.find('#mail_configuration').remove();
121121
var pass=div.find('#v_password').text();
122-
if (pass=="") div.find('#v_password').html(' ');
122+
if (pass=="") div.find('#v_password').text(' ');
123123
var output = div.text();
124124
output=output.replace(/(?:\r\n|\r|\n|\t)/g, "|");
125125
output=output.replace(/ /g, "");
@@ -166,29 +166,29 @@ $(document).ready(function() {
166166

167167
switch(opt.attr('v_type')){
168168
case 'hostname':
169-
$('#td_imap_hostname').html(opt.attr('domain'));
170-
$('#td_smtp_hostname').html(opt.attr('domain'));
169+
$('#td_imap_hostname').text(opt.attr('domain'));
170+
$('#td_smtp_hostname').text(opt.attr('domain'));
171171
break;
172172
case 'starttls':
173-
$('#td_imap_port').html('143');
174-
$('#td_imap_encryption').html('STARTTLS');
175-
$('#td_smtp_port').html('587');
176-
$('#td_smtp_encryption').html('STARTTLS');
173+
$('#td_imap_port').text('143');
174+
$('#td_imap_encryption').text('STARTTLS');
175+
$('#td_smtp_port').text('587');
176+
$('#td_smtp_encryption').text('STARTTLS');
177177
break;
178178
case 'ssl':
179-
$('#td_imap_port').html('993');
180-
$('#td_imap_encryption').html('SSL / TLS');
181-
$('#td_smtp_port').html('465');
182-
$('#td_smtp_encryption').html('SSL / TLS');
179+
$('#td_imap_port').text('993');
180+
$('#td_imap_encryption').text('SSL / TLS');
181+
$('#td_smtp_port').text('465');
182+
$('#td_smtp_encryption').text('SSL / TLS');
183183
break;
184184
case 'no_encryption':
185-
$('#td_imap_hostname').html(opt.attr('domain'));
186-
$('#td_smtp_hostname').html(opt.attr('domain'));
185+
$('#td_imap_hostname').text(opt.attr('domain'));
186+
$('#td_smtp_hostname').text(opt.attr('domain'));
187187

188-
$('#td_imap_port').html('143');
189-
$('#td_imap_encryption').html(opt.attr('no_encryption'));
190-
$('#td_smtp_port').html('25');
191-
$('#td_smtp_encryption').html(opt.attr('no_encryption'));
188+
$('#td_imap_port').text('143');
189+
$('#td_imap_encryption').text(opt.attr('no_encryption'));
190+
$('#td_smtp_port').text('25');
191+
$('#td_smtp_encryption').text(opt.attr('no_encryption'));
192192
break;
193193
}
194194
generate_mail_credentials();

web/templates/pages/add_db.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<?php if (($user == 'admin') && (($_GET['accept'] === "true")) || ($user !== "admin")) {?>
6262
<tr>
6363
<td class="hint">
64-
<?=sprintf(_('Prefix %s will be automatically added to database name and database user'),'<b>'.$user.'_</b>'); ?>
64+
<?=sprintf(_('Prefix %s will be automatically added to database name and database user'),'<b>'.$user_plain.'_</b>'); ?>
6565
</td>
6666
</td>
6767
</tr>
@@ -227,6 +227,6 @@
227227
</div>
228228

229229
<script>
230-
GLOBAL.DB_USER_PREFIX = "<?=$user_plain;?>";
231-
GLOBAL.DB_DBNAME_PREFIX = "<?=$user_plain;?>";
230+
GLOBAL.DB_USER_PREFIX = "<?=$user_plain;?>_";
231+
GLOBAL.DB_DBNAME_PREFIX = "<?=$user_plain;?>_";
232232
</script>

web/templates/pages/edit_db.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@
126126
</div>
127127
<?php if ($v_type == 'pgsql'){ $user=strtolower($user); } ?>
128128
<script>
129-
GLOBAL.DB_USER_PREFIX = "<?=$user_plain;?>";
130-
GLOBAL.DB_DBNAME_PREFIX = "<?=$user_plain;?>";
129+
GLOBAL.DB_USER_PREFIX = "<?=$user_plain;?>_";
130+
GLOBAL.DB_DBNAME_PREFIX = "<?=$user_plain;?>_";
131131
</script>

0 commit comments

Comments
 (0)