@@ -137,13 +137,13 @@ $script = '';
137
137
138
138
function addCommand()
139
139
{
140
- var e = $('#command');
141
- v = $.trim(e .val());
140
+ var el = $('#command');
141
+ v = $.trim(el .val());
142
142
if (v) {
143
143
commandLog.push(v);
144
144
}
145
145
var commandLogIndex = 0;
146
- e .val('');
146
+ el .val('');
147
147
}
148
148
149
149
function addContent(c)
@@ -154,40 +154,40 @@ $script = '';
154
154
}
155
155
156
156
var loading = false;
157
- $('#command').keydown(function(e ) {
158
- var e = $(this);
159
- if(e .which == 40) { //up
157
+ $('#command').keydown(function(event ) {
158
+ var el = $(this);
159
+ if(event .which == 40) { //up
160
160
commandLogIndex--;
161
161
if (commandLogIndex < 0) {
162
162
commandLogIndex = 0;
163
163
}
164
164
showCommand();
165
- } else if(e .which == 38) { //down
165
+ } else if(event .which == 38) { //down
166
166
showCommand();
167
167
commandLogIndex++;
168
168
if (commandLogIndex >= commandLog.length) {
169
169
commandLogIndex = commandLog.length-1;
170
170
}
171
- } else if(e .which == 13) { //enter
171
+ } else if(event .which == 13) { //enter
172
172
if (loading) return;
173
173
loading = true;
174
174
175
- if (!$.trim(e .val())) {
175
+ if (!$.trim(el .val())) {
176
176
addContent('<br/>');
177
177
loading = false;
178
178
return;
179
179
}
180
180
181
181
$.ajax({
182
182
url: ' " . $ block ->escapeUrl ($ block ->getUrl ('*/*/cli ' )) . "',
183
- data : {command:e .val(),current_password:$('#user_current_password').val()},
183
+ data : {command:el .val(),current_password:$('#user_current_password').val()},
184
184
type: 'POST',
185
185
dataType: 'json',
186
186
showLoader: true
187
187
}).done(function (data) {
188
188
loading = false;
189
189
if (data && data.message) {
190
- addContent('<strong>$ </strong>' + e .val() + '<br/>');
190
+ addContent('<strong>$ </strong>' + el .val() + '<br/>');
191
191
addContent(data.message);
192
192
} else {
193
193
alert(' " . $ block ->escapeHtml (__ ('Unexpected error. Please refresh the page or try later. ' )) . "');
0 commit comments