Edit File by line
/home/barbar84/www/wp-conte.../plugins/wp-file-.../lib/codemirr.../mode/http
File: http.js
// CodeMirror, copyright (c) by Marijn Haverbeke and others
[0] Fix | Delete
// Distributed under an MIT license: http://codemirror.net/LICENSE
[1] Fix | Delete
[2] Fix | Delete
(function(mod) {
[3] Fix | Delete
if (typeof exports == "object" && typeof module == "object") // CommonJS
[4] Fix | Delete
mod(require("../../lib/codemirror"));
[5] Fix | Delete
else if (typeof define == "function" && define.amd) // AMD
[6] Fix | Delete
define(["../../lib/codemirror"], mod);
[7] Fix | Delete
else // Plain browser env
[8] Fix | Delete
mod(CodeMirror);
[9] Fix | Delete
})(function(CodeMirror) {
[10] Fix | Delete
"use strict";
[11] Fix | Delete
[12] Fix | Delete
CodeMirror.defineMode("http", function() {
[13] Fix | Delete
function failFirstLine(stream, state) {
[14] Fix | Delete
stream.skipToEnd();
[15] Fix | Delete
state.cur = header;
[16] Fix | Delete
return "error";
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
function start(stream, state) {
[20] Fix | Delete
if (stream.match(/^HTTP\/\d\.\d/)) {
[21] Fix | Delete
state.cur = responseStatusCode;
[22] Fix | Delete
return "keyword";
[23] Fix | Delete
} else if (stream.match(/^[A-Z]+/) && /[ \t]/.test(stream.peek())) {
[24] Fix | Delete
state.cur = requestPath;
[25] Fix | Delete
return "keyword";
[26] Fix | Delete
} else {
[27] Fix | Delete
return failFirstLine(stream, state);
[28] Fix | Delete
}
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
function responseStatusCode(stream, state) {
[32] Fix | Delete
var code = stream.match(/^\d+/);
[33] Fix | Delete
if (!code) return failFirstLine(stream, state);
[34] Fix | Delete
[35] Fix | Delete
state.cur = responseStatusText;
[36] Fix | Delete
var status = Number(code[0]);
[37] Fix | Delete
if (status >= 100 && status < 200) {
[38] Fix | Delete
return "positive informational";
[39] Fix | Delete
} else if (status >= 200 && status < 300) {
[40] Fix | Delete
return "positive success";
[41] Fix | Delete
} else if (status >= 300 && status < 400) {
[42] Fix | Delete
return "positive redirect";
[43] Fix | Delete
} else if (status >= 400 && status < 500) {
[44] Fix | Delete
return "negative client-error";
[45] Fix | Delete
} else if (status >= 500 && status < 600) {
[46] Fix | Delete
return "negative server-error";
[47] Fix | Delete
} else {
[48] Fix | Delete
return "error";
[49] Fix | Delete
}
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
function responseStatusText(stream, state) {
[53] Fix | Delete
stream.skipToEnd();
[54] Fix | Delete
state.cur = header;
[55] Fix | Delete
return null;
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
function requestPath(stream, state) {
[59] Fix | Delete
stream.eatWhile(/\S/);
[60] Fix | Delete
state.cur = requestProtocol;
[61] Fix | Delete
return "string-2";
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
function requestProtocol(stream, state) {
[65] Fix | Delete
if (stream.match(/^HTTP\/\d\.\d$/)) {
[66] Fix | Delete
state.cur = header;
[67] Fix | Delete
return "keyword";
[68] Fix | Delete
} else {
[69] Fix | Delete
return failFirstLine(stream, state);
[70] Fix | Delete
}
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
function header(stream) {
[74] Fix | Delete
if (stream.sol() && !stream.eat(/[ \t]/)) {
[75] Fix | Delete
if (stream.match(/^.*?:/)) {
[76] Fix | Delete
return "atom";
[77] Fix | Delete
} else {
[78] Fix | Delete
stream.skipToEnd();
[79] Fix | Delete
return "error";
[80] Fix | Delete
}
[81] Fix | Delete
} else {
[82] Fix | Delete
stream.skipToEnd();
[83] Fix | Delete
return "string";
[84] Fix | Delete
}
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
function body(stream) {
[88] Fix | Delete
stream.skipToEnd();
[89] Fix | Delete
return null;
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
return {
[93] Fix | Delete
token: function(stream, state) {
[94] Fix | Delete
var cur = state.cur;
[95] Fix | Delete
if (cur != header && cur != body && stream.eatSpace()) return null;
[96] Fix | Delete
return cur(stream, state);
[97] Fix | Delete
},
[98] Fix | Delete
[99] Fix | Delete
blankLine: function(state) {
[100] Fix | Delete
state.cur = body;
[101] Fix | Delete
},
[102] Fix | Delete
[103] Fix | Delete
startState: function() {
[104] Fix | Delete
return {cur: start};
[105] Fix | Delete
}
[106] Fix | Delete
};
[107] Fix | Delete
});
[108] Fix | Delete
[109] Fix | Delete
CodeMirror.defineMIME("message/http", "http");
[110] Fix | Delete
[111] Fix | Delete
});
[112] Fix | Delete
[113] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function