feat: Add comprehensive documentation suite and reorganize project structure
- Created complete documentation in docs/ directory - Added PROJECT_OVERVIEW.md with feature highlights and getting started guide - Added ARCHITECTURE.md with system design and technical details - Added SECURITY.md with comprehensive security implementation guide - Added DEVELOPMENT.md with development workflows and best practices - Added DEPLOYMENT.md with production deployment instructions - Added API.md with complete REST API documentation - Added CONTRIBUTING.md with contribution guidelines - Added CHANGELOG.md with version history and migration notes - Reorganized all documentation files into docs/ directory for better organization - Updated README.md with proper documentation links and quick navigation - Enhanced project structure with professional documentation standards
This commit is contained in:
77
f_scripts/shared/linkify/linkify-plugin-mention.js
Normal file
77
f_scripts/shared/linkify/linkify-plugin-mention.js
Normal file
@@ -0,0 +1,77 @@
|
||||
'use strict';
|
||||
|
||||
;(function (linkify) {
|
||||
var plugin = function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
Mention parser plugin for linkify
|
||||
*/
|
||||
|
||||
function mention(linkify) {
|
||||
var TT = linkify.scanner.TOKENS; // Text tokens
|
||||
var _linkify$parser = linkify.parser,
|
||||
MT = _linkify$parser.TOKENS,
|
||||
State = _linkify$parser.State; // Multi tokens, state
|
||||
|
||||
var MultiToken = MT.Base;
|
||||
var S_START = linkify.parser.start;
|
||||
|
||||
var TT_DOMAIN = TT.DOMAIN;
|
||||
var TT_LOCALHOST = TT.LOCALHOST;
|
||||
var TT_NUM = TT.NUM;
|
||||
var TT_SLASH = TT.SLASH;
|
||||
var TT_TLD = TT.TLD;
|
||||
var TT_UNDERSCORE = TT.UNDERSCORE;
|
||||
var TT_DOT = TT.DOT;
|
||||
|
||||
function MENTION(value) {
|
||||
this.v = value;
|
||||
}
|
||||
|
||||
linkify.inherits(MultiToken, MENTION, {
|
||||
type: 'mention',
|
||||
isLink: true,
|
||||
toHref: function toHref() {
|
||||
return '/' + this.toString().substr(1);
|
||||
}
|
||||
});
|
||||
|
||||
var S_AT = S_START.jump(TT.AT); // @
|
||||
var S_AT_SYMS = new State();
|
||||
var S_MENTION = new State(MENTION);
|
||||
var S_MENTION_DIVIDER = new State();
|
||||
var S_MENTION_DIVIDER_SYMS = new State();
|
||||
|
||||
// @_,
|
||||
S_AT.on(TT_UNDERSCORE, S_AT_SYMS);
|
||||
|
||||
// @_*
|
||||
S_AT_SYMS.on(TT_UNDERSCORE, S_AT_SYMS).on(TT_DOT, S_AT_SYMS);
|
||||
|
||||
// Valid mention (not made up entirely of symbols)
|
||||
S_AT.on(TT_DOMAIN, S_MENTION).on(TT_LOCALHOST, S_MENTION).on(TT_TLD, S_MENTION).on(TT_NUM, S_MENTION);
|
||||
|
||||
S_AT_SYMS.on(TT_DOMAIN, S_MENTION).on(TT_LOCALHOST, S_MENTION).on(TT_TLD, S_MENTION).on(TT_NUM, S_MENTION);
|
||||
|
||||
// More valid mentions
|
||||
S_MENTION.on(TT_DOMAIN, S_MENTION).on(TT_LOCALHOST, S_MENTION).on(TT_TLD, S_MENTION).on(TT_NUM, S_MENTION).on(TT_UNDERSCORE, S_MENTION);
|
||||
|
||||
// Mention with a divider
|
||||
S_MENTION.on(TT_SLASH, S_MENTION_DIVIDER).on(TT_DOT, S_MENTION_DIVIDER);
|
||||
|
||||
// Mention _ trailing stash plus syms
|
||||
S_MENTION_DIVIDER.on(TT_UNDERSCORE, S_MENTION_DIVIDER_SYMS);
|
||||
S_MENTION_DIVIDER_SYMS.on(TT_UNDERSCORE, S_MENTION_DIVIDER_SYMS);
|
||||
|
||||
// Once we get a word token, mentions can start up again
|
||||
S_MENTION_DIVIDER.on(TT_DOMAIN, S_MENTION).on(TT_LOCALHOST, S_MENTION).on(TT_TLD, S_MENTION).on(TT_NUM, S_MENTION);
|
||||
|
||||
S_MENTION_DIVIDER_SYMS.on(TT_DOMAIN, S_MENTION).on(TT_LOCALHOST, S_MENTION).on(TT_TLD, S_MENTION).on(TT_NUM, S_MENTION);
|
||||
}
|
||||
|
||||
return mention;
|
||||
}();
|
||||
|
||||
plugin(linkify);
|
||||
})(window.linkify);
|
||||
Reference in New Issue
Block a user