mirror of
https://github.com/go-gitea/gitea.git
synced 2024-08-28 23:27:27 +02:00
* Cleaning up public/ and documenting js/css libs. This commit mostly addresses #1484 by moving vendor'ed plugins into a vendor/ directory and documenting their upstream source and license in vendor/librejs.html. This also proves gitea is using only open source js/css libraries which helps toward reaching #1524. * Removing unused css file. The version of this file in use is located at: vendor/plugins/highlight/github.css * Cleaned up librejs.html and added javascript header A SafeJS function was added to templates/helper.go to allow keeping comments inside of javascript. A javascript comment was added in the header of templates/base/head.tmpl to mark all non-inline source as free. The librejs.html file was updated to meet the current librejs spec. I have now verified that the librejs plugin detects most of the scripts included in gitea and suspect the non-free detections are the result of a bug in the plugin. I believe this commit is enough to meet the C0.0 requirement of #1534. * Updating SafeJS function per lint suggestion * Added VERSIONS file, per request
76 lines
3.6 KiB
JavaScript
76 lines
3.6 KiB
JavaScript
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
|
|
(function() {
|
|
var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-xu");
|
|
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "xu"); }
|
|
|
|
MT("empty chart",
|
|
"[keyword msc][bracket {]",
|
|
"[base ]",
|
|
"[bracket }]"
|
|
);
|
|
|
|
MT("comments",
|
|
"[comment // a single line comment]",
|
|
"[comment # another single line comment /* and */ ignored here]",
|
|
"[comment /* A multi-line comment even though it contains]",
|
|
"[comment msc keywords and \"quoted text\"*/]");
|
|
|
|
MT("strings",
|
|
"[string \"// a string\"]",
|
|
"[string \"a string running over]",
|
|
"[string two lines\"]",
|
|
"[string \"with \\\"escaped quote\"]"
|
|
);
|
|
|
|
MT("xù/ msgenny keywords classify as 'keyword'",
|
|
"[keyword watermark]",
|
|
"[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]"
|
|
);
|
|
|
|
MT("mscgen options classify as keyword",
|
|
"[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
|
|
);
|
|
|
|
MT("mscgen arcs classify as keyword",
|
|
"[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
|
|
"[keyword |||...---]", "[keyword ..--==::]",
|
|
"[keyword ->]", "[keyword <-]", "[keyword <->]",
|
|
"[keyword =>]", "[keyword <=]", "[keyword <=>]",
|
|
"[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
|
|
"[keyword >>]", "[keyword <<]", "[keyword <<>>]",
|
|
"[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
|
|
"[keyword :>]", "[keyword <:]", "[keyword <:>]"
|
|
);
|
|
|
|
MT("within an attribute list, attributes classify as attribute",
|
|
"[bracket [[][attribute label]",
|
|
"[attribute id]","[attribute url]","[attribute idurl]",
|
|
"[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]",
|
|
"[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]",
|
|
"[attribute arcskip][bracket ]]]"
|
|
);
|
|
|
|
MT("outside an attribute list, attributes classify as base",
|
|
"[base label]",
|
|
"[base id]","[base url]","[base idurl]",
|
|
"[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]",
|
|
"[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]",
|
|
"[base arcskip]"
|
|
);
|
|
|
|
MT("a typical program",
|
|
"[comment # typical mscgen program]",
|
|
"[keyword msc][base ][bracket {]",
|
|
"[keyword wordwraparcs][operator =][string \"true\"][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]",
|
|
"[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]",
|
|
"[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]",
|
|
"[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]",
|
|
"[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]",
|
|
"[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]",
|
|
"[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]",
|
|
"[bracket }]"
|
|
);
|
|
})();
|