Source refactoring

This commit is contained in:
RainLoop Team 2015-05-03 00:22:32 +04:00
parent 09b04740e7
commit 104ac0806a
27 changed files with 204 additions and 715 deletions

View file

@ -28,6 +28,11 @@
*/
Globals.startMicrotime = (new window.Date()).getTime();
/**
* @type {boolean}
*/
Globals.community = RL_COMMUNITY;
/**
* @type {?}
*/

View file

@ -103,7 +103,7 @@
*/
HtmlEditor.prototype.clearSignatureSigns = function (sText)
{
return sText.replace(/(\u0002|\u0003|\u200C|\u200D)/g, '');
return sText.replace(/(\u200C|<x-signature>|<\/x-signature>)/g, '');
};
/**

View file

@ -861,10 +861,7 @@
;
sText = sHtml
// specials for signature
.replace(/\u0002\u0002/g, '\u200C\u200C')
.replace(/\u0003\u0003/g, '\u200D\u200D')
.replace(/<x-signature>([\s\S]*)<\/x-signature>/gm, '\u200C$1\u200C')
.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gmi, convertPre)
.replace(/[\s]+/gm, ' ')
.replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue)
@ -1012,16 +1009,12 @@
sPlain = aText.join("\n");
sPlain = sPlain
// specials for signature
.replace(/\u200C\u200C/g, '\u0002\u0002')
.replace(/\u200D\u200D/g, '\u0003\u0003')
// .replace(/~~~\/blockquote~~~\n~~~blockquote~~~/g, '\n')
.replace(/&/g, '&amp;')
.replace(/>/g, '&gt;').replace(/</g, '&lt;')
.replace(/~~~blockquote~~~[\s]*/g, '<blockquote>')
.replace(/[\s]*~~~\/blockquote~~~/g, '</blockquote>')
.replace(/\u200C([\s\S]*)\u200C/g, '<x-signature>$1</x-signature>')
.replace(/\n/g, '<br />')
;