Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/codemirr.../mode/mbox
File: mbox.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
var rfc2822 = [
[13] Fix | Delete
"From", "Sender", "Reply-To", "To", "Cc", "Bcc", "Message-ID",
[14] Fix | Delete
"In-Reply-To", "References", "Resent-From", "Resent-Sender", "Resent-To",
[15] Fix | Delete
"Resent-Cc", "Resent-Bcc", "Resent-Message-ID", "Return-Path", "Received"
[16] Fix | Delete
];
[17] Fix | Delete
var rfc2822NoEmail = [
[18] Fix | Delete
"Date", "Subject", "Comments", "Keywords", "Resent-Date"
[19] Fix | Delete
];
[20] Fix | Delete
[21] Fix | Delete
CodeMirror.registerHelper("hintWords", "mbox", rfc2822.concat(rfc2822NoEmail));
[22] Fix | Delete
[23] Fix | Delete
var whitespace = /^[ \t]/;
[24] Fix | Delete
var separator = /^From /; // See RFC 4155
[25] Fix | Delete
var rfc2822Header = new RegExp("^(" + rfc2822.join("|") + "): ");
[26] Fix | Delete
var rfc2822HeaderNoEmail = new RegExp("^(" + rfc2822NoEmail.join("|") + "): ");
[27] Fix | Delete
var header = /^[^:]+:/; // Optional fields defined in RFC 2822
[28] Fix | Delete
var email = /^[^ ]+@[^ ]+/;
[29] Fix | Delete
var untilEmail = /^.*?(?=[^ ]+?@[^ ]+)/;
[30] Fix | Delete
var bracketedEmail = /^<.*?>/;
[31] Fix | Delete
var untilBracketedEmail = /^.*?(?=<.*>)/;
[32] Fix | Delete
[33] Fix | Delete
function styleForHeader(header) {
[34] Fix | Delete
if (header === "Subject") return "header";
[35] Fix | Delete
return "string";
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
function readToken(stream, state) {
[39] Fix | Delete
if (stream.sol()) {
[40] Fix | Delete
// From last line
[41] Fix | Delete
state.inSeparator = false;
[42] Fix | Delete
if (state.inHeader && stream.match(whitespace)) {
[43] Fix | Delete
// Header folding
[44] Fix | Delete
return null;
[45] Fix | Delete
} else {
[46] Fix | Delete
state.inHeader = false;
[47] Fix | Delete
state.header = null;
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
if (stream.match(separator)) {
[51] Fix | Delete
state.inHeaders = true;
[52] Fix | Delete
state.inSeparator = true;
[53] Fix | Delete
return "atom";
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
var match;
[57] Fix | Delete
var emailPermitted = false;
[58] Fix | Delete
if ((match = stream.match(rfc2822HeaderNoEmail)) ||
[59] Fix | Delete
(emailPermitted = true) && (match = stream.match(rfc2822Header))) {
[60] Fix | Delete
state.inHeaders = true;
[61] Fix | Delete
state.inHeader = true;
[62] Fix | Delete
state.emailPermitted = emailPermitted;
[63] Fix | Delete
state.header = match[1];
[64] Fix | Delete
return "atom";
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
// Use vim's heuristics: recognize custom headers only if the line is in a
[68] Fix | Delete
// block of legitimate headers.
[69] Fix | Delete
if (state.inHeaders && (match = stream.match(header))) {
[70] Fix | Delete
state.inHeader = true;
[71] Fix | Delete
state.emailPermitted = true;
[72] Fix | Delete
state.header = match[1];
[73] Fix | Delete
return "atom";
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
state.inHeaders = false;
[77] Fix | Delete
stream.skipToEnd();
[78] Fix | Delete
return null;
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
if (state.inSeparator) {
[82] Fix | Delete
if (stream.match(email)) return "link";
[83] Fix | Delete
if (stream.match(untilEmail)) return "atom";
[84] Fix | Delete
stream.skipToEnd();
[85] Fix | Delete
return "atom";
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
if (state.inHeader) {
[89] Fix | Delete
var style = styleForHeader(state.header);
[90] Fix | Delete
[91] Fix | Delete
if (state.emailPermitted) {
[92] Fix | Delete
if (stream.match(bracketedEmail)) return style + " link";
[93] Fix | Delete
if (stream.match(untilBracketedEmail)) return style;
[94] Fix | Delete
}
[95] Fix | Delete
stream.skipToEnd();
[96] Fix | Delete
return style;
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
stream.skipToEnd();
[100] Fix | Delete
return null;
[101] Fix | Delete
};
[102] Fix | Delete
[103] Fix | Delete
CodeMirror.defineMode("mbox", function() {
[104] Fix | Delete
return {
[105] Fix | Delete
startState: function() {
[106] Fix | Delete
return {
[107] Fix | Delete
// Is in a mbox separator
[108] Fix | Delete
inSeparator: false,
[109] Fix | Delete
// Is in a mail header
[110] Fix | Delete
inHeader: false,
[111] Fix | Delete
// If bracketed email is permitted. Only applicable when inHeader
[112] Fix | Delete
emailPermitted: false,
[113] Fix | Delete
// Name of current header
[114] Fix | Delete
header: null,
[115] Fix | Delete
// Is in a region of mail headers
[116] Fix | Delete
inHeaders: false
[117] Fix | Delete
};
[118] Fix | Delete
},
[119] Fix | Delete
token: readToken,
[120] Fix | Delete
blankLine: function(state) {
[121] Fix | Delete
state.inHeaders = state.inSeparator = state.inHeader = false;
[122] Fix | Delete
}
[123] Fix | Delete
};
[124] Fix | Delete
});
[125] Fix | Delete
[126] Fix | Delete
CodeMirror.defineMIME("application/mbox", "mbox");
[127] Fix | Delete
});
[128] Fix | Delete
[129] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function