Path: blob/master/web-gui/buildyourownbotnet/assets/js/codemirror/mode/css/css.js
1294 views
CodeMirror.defineMode("css", function(config, parserConfig) {1"use strict";23if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");45var indentUnit = config.indentUnit,6tokenHooks = parserConfig.tokenHooks,7mediaTypes = parserConfig.mediaTypes || {},8mediaFeatures = parserConfig.mediaFeatures || {},9propertyKeywords = parserConfig.propertyKeywords || {},10colorKeywords = parserConfig.colorKeywords || {},11valueKeywords = parserConfig.valueKeywords || {},12fontProperties = parserConfig.fontProperties || {},13allowNested = parserConfig.allowNested;1415var type, override;16function ret(style, tp) { type = tp; return style; }1718// Tokenizers1920function tokenBase(stream, state) {21var ch = stream.next();22if (tokenHooks[ch]) {23var result = tokenHooks[ch](stream, state);24if (result !== false) return result;25}26if (ch == "@") {27stream.eatWhile(/[\w\\\-]/);28return ret("def", stream.current());29} else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) {30return ret(null, "compare");31} else if (ch == "\"" || ch == "'") {32state.tokenize = tokenString(ch);33return state.tokenize(stream, state);34} else if (ch == "#") {35stream.eatWhile(/[\w\\\-]/);36return ret("atom", "hash");37} else if (ch == "!") {38stream.match(/^\s*\w*/);39return ret("keyword", "important");40} else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) {41stream.eatWhile(/[\w.%]/);42return ret("number", "unit");43} else if (ch === "-") {44if (/[\d.]/.test(stream.peek())) {45stream.eatWhile(/[\w.%]/);46return ret("number", "unit");47} else if (stream.match(/^[^-]+-/)) {48return ret("meta", "meta");49}50} else if (/[,+>*\/]/.test(ch)) {51return ret(null, "select-op");52} else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {53return ret("qualifier", "qualifier");54} else if (/[:;{}\[\]\(\)]/.test(ch)) {55return ret(null, ch);56} else if (ch == "u" && stream.match("rl(")) {57stream.backUp(1);58state.tokenize = tokenParenthesized;59return ret("property", "word");60} else if (/[\w\\\-]/.test(ch)) {61stream.eatWhile(/[\w\\\-]/);62return ret("property", "word");63} else {64return ret(null, null);65}66}6768function tokenString(quote) {69return function(stream, state) {70var escaped = false, ch;71while ((ch = stream.next()) != null) {72if (ch == quote && !escaped) {73if (quote == ")") stream.backUp(1);74break;75}76escaped = !escaped && ch == "\\";77}78if (ch == quote || !escaped && quote != ")") state.tokenize = null;79return ret("string", "string");80};81}8283function tokenParenthesized(stream, state) {84stream.next(); // Must be '('85if (!stream.match(/\s*[\"\']/, false))86state.tokenize = tokenString(")");87else88state.tokenize = null;89return ret(null, "(");90}9192// Context management9394function Context(type, indent, prev) {95this.type = type;96this.indent = indent;97this.prev = prev;98}99100function pushContext(state, stream, type) {101state.context = new Context(type, stream.indentation() + indentUnit, state.context);102return type;103}104105function popContext(state) {106state.context = state.context.prev;107return state.context.type;108}109110function pass(type, stream, state) {111return states[state.context.type](type, stream, state);112}113function popAndPass(type, stream, state, n) {114for (var i = n || 1; i > 0; i--)115state.context = state.context.prev;116return pass(type, stream, state);117}118119// Parser120121function wordAsValue(stream) {122var word = stream.current().toLowerCase();123if (valueKeywords.hasOwnProperty(word))124override = "atom";125else if (colorKeywords.hasOwnProperty(word))126override = "keyword";127else128override = "variable";129}130131var states = {};132133states.top = function(type, stream, state) {134if (type == "{") {135return pushContext(state, stream, "block");136} else if (type == "}" && state.context.prev) {137return popContext(state);138} else if (type == "@media") {139return pushContext(state, stream, "media");140} else if (type == "@font-face") {141return "font_face_before";142} else if (type && type.charAt(0) == "@") {143return pushContext(state, stream, "at");144} else if (type == "hash") {145override = "builtin";146} else if (type == "word") {147override = "tag";148} else if (type == "variable-definition") {149return "maybeprop";150} else if (type == "interpolation") {151return pushContext(state, stream, "interpolation");152} else if (type == ":") {153return "pseudo";154} else if (allowNested && type == "(") {155return pushContext(state, stream, "params");156}157return state.context.type;158};159160states.block = function(type, stream, state) {161if (type == "word") {162if (propertyKeywords.hasOwnProperty(stream.current().toLowerCase())) {163override = "property";164return "maybeprop";165} else if (allowNested) {166override = stream.match(/^\s*:/, false) ? "property" : "tag";167return "block";168} else {169override += " error";170return "maybeprop";171}172} else if (type == "meta") {173return "block";174} else if (!allowNested && (type == "hash" || type == "qualifier")) {175override = "error";176return "block";177} else {178return states.top(type, stream, state);179}180};181182states.maybeprop = function(type, stream, state) {183if (type == ":") return pushContext(state, stream, "prop");184return pass(type, stream, state);185};186187states.prop = function(type, stream, state) {188if (type == ";") return popContext(state);189if (type == "{" && allowNested) return pushContext(state, stream, "propBlock");190if (type == "}" || type == "{") return popAndPass(type, stream, state);191if (type == "(") return pushContext(state, stream, "parens");192193if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {194override += " error";195} else if (type == "word") {196wordAsValue(stream);197} else if (type == "interpolation") {198return pushContext(state, stream, "interpolation");199}200return "prop";201};202203states.propBlock = function(type, _stream, state) {204if (type == "}") return popContext(state);205if (type == "word") { override = "property"; return "maybeprop"; }206return state.context.type;207};208209states.parens = function(type, stream, state) {210if (type == "{" || type == "}") return popAndPass(type, stream, state);211if (type == ")") return popContext(state);212return "parens";213};214215states.pseudo = function(type, stream, state) {216if (type == "word") {217override = "variable-3";218return state.context.type;219}220return pass(type, stream, state);221};222223states.media = function(type, stream, state) {224if (type == "(") return pushContext(state, stream, "media_parens");225if (type == "}") return popAndPass(type, stream, state);226if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");227228if (type == "word") {229var word = stream.current().toLowerCase();230if (word == "only" || word == "not" || word == "and")231override = "keyword";232else if (mediaTypes.hasOwnProperty(word))233override = "attribute";234else if (mediaFeatures.hasOwnProperty(word))235override = "property";236else237override = "error";238}239return state.context.type;240};241242states.media_parens = function(type, stream, state) {243if (type == ")") return popContext(state);244if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);245return states.media(type, stream, state);246};247248states.font_face_before = function(type, stream, state) {249if (type == "{")250return pushContext(state, stream, "font_face");251return pass(type, stream, state);252};253254states.font_face = function(type, stream, state) {255if (type == "}") return popContext(state);256if (type == "word") {257if (!fontProperties.hasOwnProperty(stream.current().toLowerCase()))258override = "error";259else260override = "property";261return "maybeprop";262}263return "font_face";264};265266states.at = function(type, stream, state) {267if (type == ";") return popContext(state);268if (type == "{" || type == "}") return popAndPass(type, stream, state);269if (type == "word") override = "tag";270else if (type == "hash") override = "builtin";271return "at";272};273274states.interpolation = function(type, stream, state) {275if (type == "}") return popContext(state);276if (type == "{" || type == ";") return popAndPass(type, stream, state);277if (type != "variable") override = "error";278return "interpolation";279};280281states.params = function(type, stream, state) {282if (type == ")") return popContext(state);283if (type == "{" || type == "}") return popAndPass(type, stream, state);284if (type == "word") wordAsValue(stream);285return "params";286};287288return {289startState: function(base) {290return {tokenize: null,291state: "top",292context: new Context("top", base || 0, null)};293},294295token: function(stream, state) {296if (!state.tokenize && stream.eatSpace()) return null;297var style = (state.tokenize || tokenBase)(stream, state);298if (style && typeof style == "object") {299type = style[1];300style = style[0];301}302override = style;303state.state = states[state.state](type, stream, state);304return override;305},306307indent: function(state, textAfter) {308var cx = state.context, ch = textAfter && textAfter.charAt(0);309var indent = cx.indent;310if (cx.prev &&311(ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "font_face") ||312ch == ")" && (cx.type == "parens" || cx.type == "params" || cx.type == "media_parens") ||313ch == "{" && (cx.type == "at" || cx.type == "media"))) {314indent = cx.indent - indentUnit;315cx = cx.prev;316}317return indent;318},319320electricChars: "}",321blockCommentStart: "/*",322blockCommentEnd: "*/",323fold: "brace"324};325});326327(function() {328function keySet(array) {329var keys = {};330for (var i = 0; i < array.length; ++i) {331keys[array[i]] = true;332}333return keys;334}335336var mediaTypes_ = [337"all", "aural", "braille", "handheld", "print", "projection", "screen",338"tty", "tv", "embossed"339], mediaTypes = keySet(mediaTypes_);340341var mediaFeatures_ = [342"width", "min-width", "max-width", "height", "min-height", "max-height",343"device-width", "min-device-width", "max-device-width", "device-height",344"min-device-height", "max-device-height", "aspect-ratio",345"min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",346"min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",347"max-color", "color-index", "min-color-index", "max-color-index",348"monochrome", "min-monochrome", "max-monochrome", "resolution",349"min-resolution", "max-resolution", "scan", "grid"350], mediaFeatures = keySet(mediaFeatures_);351352var propertyKeywords_ = [353"align-content", "align-items", "align-self", "alignment-adjust",354"alignment-baseline", "anchor-point", "animation", "animation-delay",355"animation-direction", "animation-duration", "animation-iteration-count",356"animation-name", "animation-play-state", "animation-timing-function",357"appearance", "azimuth", "backface-visibility", "background",358"background-attachment", "background-clip", "background-color",359"background-image", "background-origin", "background-position",360"background-repeat", "background-size", "baseline-shift", "binding",361"bleed", "bookmark-label", "bookmark-level", "bookmark-state",362"bookmark-target", "border", "border-bottom", "border-bottom-color",363"border-bottom-left-radius", "border-bottom-right-radius",364"border-bottom-style", "border-bottom-width", "border-collapse",365"border-color", "border-image", "border-image-outset",366"border-image-repeat", "border-image-slice", "border-image-source",367"border-image-width", "border-left", "border-left-color",368"border-left-style", "border-left-width", "border-radius", "border-right",369"border-right-color", "border-right-style", "border-right-width",370"border-spacing", "border-style", "border-top", "border-top-color",371"border-top-left-radius", "border-top-right-radius", "border-top-style",372"border-top-width", "border-width", "bottom", "box-decoration-break",373"box-shadow", "box-sizing", "break-after", "break-before", "break-inside",374"caption-side", "clear", "clip", "color", "color-profile", "column-count",375"column-fill", "column-gap", "column-rule", "column-rule-color",376"column-rule-style", "column-rule-width", "column-span", "column-width",377"columns", "content", "counter-increment", "counter-reset", "crop", "cue",378"cue-after", "cue-before", "cursor", "direction", "display",379"dominant-baseline", "drop-initial-after-adjust",380"drop-initial-after-align", "drop-initial-before-adjust",381"drop-initial-before-align", "drop-initial-size", "drop-initial-value",382"elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",383"flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",384"float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings",385"font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust",386"font-stretch", "font-style", "font-synthesis", "font-variant",387"font-variant-alternates", "font-variant-caps", "font-variant-east-asian",388"font-variant-ligatures", "font-variant-numeric", "font-variant-position",389"font-weight", "grid-cell", "grid-column", "grid-column-align",390"grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow",391"grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span",392"grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens",393"icon", "image-orientation", "image-rendering", "image-resolution",394"inline-box-align", "justify-content", "left", "letter-spacing",395"line-break", "line-height", "line-stacking", "line-stacking-ruby",396"line-stacking-shift", "line-stacking-strategy", "list-style",397"list-style-image", "list-style-position", "list-style-type", "margin",398"margin-bottom", "margin-left", "margin-right", "margin-top",399"marker-offset", "marks", "marquee-direction", "marquee-loop",400"marquee-play-count", "marquee-speed", "marquee-style", "max-height",401"max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",402"nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline",403"outline-color", "outline-offset", "outline-style", "outline-width",404"overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",405"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",406"page", "page-break-after", "page-break-before", "page-break-inside",407"page-policy", "pause", "pause-after", "pause-before", "perspective",408"perspective-origin", "pitch", "pitch-range", "play-during", "position",409"presentation-level", "punctuation-trim", "quotes", "region-break-after",410"region-break-before", "region-break-inside", "region-fragment",411"rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",412"right", "rotation", "rotation-point", "ruby-align", "ruby-overhang",413"ruby-position", "ruby-span", "shape-inside", "shape-outside", "size",414"speak", "speak-as", "speak-header",415"speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",416"tab-size", "table-layout", "target", "target-name", "target-new",417"target-position", "text-align", "text-align-last", "text-decoration",418"text-decoration-color", "text-decoration-line", "text-decoration-skip",419"text-decoration-style", "text-emphasis", "text-emphasis-color",420"text-emphasis-position", "text-emphasis-style", "text-height",421"text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow",422"text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position",423"text-wrap", "top", "transform", "transform-origin", "transform-style",424"transition", "transition-delay", "transition-duration",425"transition-property", "transition-timing-function", "unicode-bidi",426"vertical-align", "visibility", "voice-balance", "voice-duration",427"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",428"voice-volume", "volume", "white-space", "widows", "width", "word-break",429"word-spacing", "word-wrap", "z-index", "zoom",430// SVG-specific431"clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",432"flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",433"color-interpolation", "color-interpolation-filters", "color-profile",434"color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering",435"marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke",436"stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin",437"stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering",438"baseline-shift", "dominant-baseline", "glyph-orientation-horizontal",439"glyph-orientation-vertical", "kerning", "text-anchor", "writing-mode"440], propertyKeywords = keySet(propertyKeywords_);441442var colorKeywords_ = [443"aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",444"bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",445"burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",446"cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",447"darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",448"darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",449"darkslateblue", "darkslategray", "darkturquoise", "darkviolet",450"deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",451"floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",452"gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",453"hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",454"lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",455"lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",456"lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",457"lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",458"maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",459"mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",460"mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin",461"navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered",462"orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred",463"papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",464"purple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon",465"sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",466"slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",467"teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",468"whitesmoke", "yellow", "yellowgreen"469], colorKeywords = keySet(colorKeywords_);470471var valueKeywords_ = [472"above", "absolute", "activeborder", "activecaption", "afar",473"after-white-space", "ahead", "alias", "all", "all-scroll", "alternate",474"always", "amharic", "amharic-abegede", "antialiased", "appworkspace",475"arabic-indic", "armenian", "asterisks", "auto", "avoid", "avoid-column", "avoid-page",476"avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary",477"bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",478"both", "bottom", "break", "break-all", "break-word", "button", "button-bevel",479"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian",480"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",481"cell", "center", "checkbox", "circle", "cjk-earthly-branch",482"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",483"col-resize", "collapse", "column", "compact", "condensed", "contain", "content",484"content-box", "context-menu", "continuous", "copy", "cover", "crop",485"cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal",486"decimal-leading-zero", "default", "default-button", "destination-atop",487"destination-in", "destination-out", "destination-over", "devanagari",488"disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted",489"double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",490"element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",491"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",492"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",493"ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",494"ethiopic-halehame-gez", "ethiopic-halehame-om-et",495"ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",496"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et",497"ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed",498"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes",499"forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",500"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",501"help", "hidden", "hide", "higher", "highlight", "highlighttext",502"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",503"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",504"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",505"inline-block", "inline-table", "inset", "inside", "intrinsic", "invert",506"italic", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer",507"landscape", "lao", "large", "larger", "left", "level", "lighter",508"line-through", "linear", "lines", "list-item", "listbox", "listitem",509"local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",510"lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",511"lower-roman", "lowercase", "ltr", "malayalam", "match",512"media-controls-background", "media-current-time-display",513"media-fullscreen-button", "media-mute-button", "media-play-button",514"media-return-to-realtime-button", "media-rewind-button",515"media-seek-back-button", "media-seek-forward-button", "media-slider",516"media-sliderthumb", "media-time-remaining-display", "media-volume-slider",517"media-volume-slider-container", "media-volume-sliderthumb", "medium",518"menu", "menulist", "menulist-button", "menulist-text",519"menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",520"mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",521"narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",522"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",523"ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",524"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",525"outside", "outside-shape", "overlay", "overline", "padding", "padding-box",526"painted", "page", "paused", "persian", "plus-darker", "plus-lighter", "pointer",527"polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button",528"radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region",529"relative", "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba",530"ridge", "right", "round", "row-resize", "rtl", "run-in", "running",531"s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield",532"searchfield-cancel-button", "searchfield-decoration",533"searchfield-results-button", "searchfield-results-decoration",534"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",535"single", "skip-white-space", "slide", "slider-horizontal",536"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",537"small", "small-caps", "small-caption", "smaller", "solid", "somali",538"source-atop", "source-in", "source-out", "source-over", "space", "square",539"square-button", "start", "static", "status-bar", "stretch", "stroke",540"sub", "subpixel-antialiased", "super", "sw-resize", "table",541"table-caption", "table-cell", "table-column", "table-column-group",542"table-footer-group", "table-header-group", "table-row", "table-row-group",543"telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",544"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",545"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",546"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",547"transparent", "ultra-condensed", "ultra-expanded", "underline", "up",548"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",549"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",550"vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",551"visibleStroke", "visual", "w-resize", "wait", "wave", "wider",552"window", "windowframe", "windowtext", "x-large", "x-small", "xor",553"xx-large", "xx-small"554], valueKeywords = keySet(valueKeywords_);555556var fontProperties_ = [557"font-family", "src", "unicode-range", "font-variant", "font-feature-settings",558"font-stretch", "font-weight", "font-style"559], fontProperties = keySet(fontProperties_);560561var allWords = mediaTypes_.concat(mediaFeatures_).concat(propertyKeywords_).concat(colorKeywords_).concat(valueKeywords_);562CodeMirror.registerHelper("hintWords", "css", allWords);563564function tokenCComment(stream, state) {565var maybeEnd = false, ch;566while ((ch = stream.next()) != null) {567if (maybeEnd && ch == "/") {568state.tokenize = null;569break;570}571maybeEnd = (ch == "*");572}573return ["comment", "comment"];574}575576function tokenSGMLComment(stream, state) {577if (stream.skipTo("-->")) {578stream.match("-->");579state.tokenize = null;580} else {581stream.skipToEnd();582}583return ["comment", "comment"];584}585586CodeMirror.defineMIME("text/css", {587mediaTypes: mediaTypes,588mediaFeatures: mediaFeatures,589propertyKeywords: propertyKeywords,590colorKeywords: colorKeywords,591valueKeywords: valueKeywords,592fontProperties: fontProperties,593tokenHooks: {594"<": function(stream, state) {595if (!stream.match("!--")) return false;596state.tokenize = tokenSGMLComment;597return tokenSGMLComment(stream, state);598},599"/": function(stream, state) {600if (!stream.eat("*")) return false;601state.tokenize = tokenCComment;602return tokenCComment(stream, state);603}604},605name: "css"606});607608CodeMirror.defineMIME("text/x-scss", {609mediaTypes: mediaTypes,610mediaFeatures: mediaFeatures,611propertyKeywords: propertyKeywords,612colorKeywords: colorKeywords,613valueKeywords: valueKeywords,614fontProperties: fontProperties,615allowNested: true,616tokenHooks: {617"/": function(stream, state) {618if (stream.eat("/")) {619stream.skipToEnd();620return ["comment", "comment"];621} else if (stream.eat("*")) {622state.tokenize = tokenCComment;623return tokenCComment(stream, state);624} else {625return ["operator", "operator"];626}627},628":": function(stream) {629if (stream.match(/\s*{/))630return [null, "{"];631return false;632},633"$": function(stream) {634stream.match(/^[\w-]+/);635if (stream.match(/^\s*:/, false))636return ["variable-2", "variable-definition"];637return ["variable-2", "variable"];638},639"#": function(stream) {640if (!stream.eat("{")) return false;641return [null, "interpolation"];642}643},644name: "css",645helperType: "scss"646});647648CodeMirror.defineMIME("text/x-less", {649mediaTypes: mediaTypes,650mediaFeatures: mediaFeatures,651propertyKeywords: propertyKeywords,652colorKeywords: colorKeywords,653valueKeywords: valueKeywords,654fontProperties: fontProperties,655allowNested: true,656tokenHooks: {657"/": function(stream, state) {658if (stream.eat("/")) {659stream.skipToEnd();660return ["comment", "comment"];661} else if (stream.eat("*")) {662state.tokenize = tokenCComment;663return tokenCComment(stream, state);664} else {665return ["operator", "operator"];666}667},668"@": function(stream) {669if (stream.match(/^(charset|document|font-face|import|keyframes|media|namespace|page|supports)\b/, false)) return false;670stream.eatWhile(/[\w\\\-]/);671if (stream.match(/^\s*:/, false))672return ["variable-2", "variable-definition"];673return ["variable-2", "variable"];674},675"&": function() {676return ["atom", "atom"];677}678},679name: "css",680helperType: "less"681});682})();683684685