anyword-hint.js
11 years ago
anyword-hint.min.js
11 years ago
css-hint.js
11 years ago
css-hint.min.js
11 years ago
html-hint.js
11 years ago
html-hint.min.js
11 years ago
javascript-hint.js
11 years ago
javascript-hint.min.js
11 years ago
show-hint.css
11 years ago
show-hint.js
11 years ago
show-hint.min.js
11 years ago
sql-hint.js
11 years ago
sql-hint.min.js
11 years ago
xml-hint.js
11 years ago
xml-hint.min.js
11 years ago
css-hint.min.js
11 lines
| 1 | |
| 2 | (function(mod){if(typeof exports=="object"&&typeof module=="object") |
| 3 | mod(require("../../lib/codemirror"),require("../../mode/css/css"));else if(typeof define=="function"&&define.amd) |
| 4 | define(["../../lib/codemirror","../../mode/css/css"],mod);else |
| 5 | mod(CodeMirror);})(function(CodeMirror){"use strict";var pseudoClasses={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};CodeMirror.registerHelper("hint","css",function(cm){var cur=cm.getCursor(),token=cm.getTokenAt(cur);var inner=CodeMirror.innerMode(cm.getMode(),token.state);if(inner.mode.name!="css")return;if(token.type=="keyword"&&"!important".indexOf(token.string)==0) |
| 6 | return{list:["!important"],from:CodeMirror.Pos(cur.line,token.start),to:CodeMirror.Pos(cur.line,token.end)};var start=token.start,end=cur.ch,word=token.string.slice(0,end-start);if(/[^\w$_-]/.test(word)){word="";start=end=cur.ch;} |
| 7 | var spec=CodeMirror.resolveMode("text/css");var result=[];function add(keywords){for(var name in keywords) |
| 8 | if(!word||name.lastIndexOf(word,0)==0) |
| 9 | result.push(name);} |
| 10 | var st=inner.state.state;if(st=="pseudo"||token.type=="variable-3"){add(pseudoClasses);}else if(st=="block"||st=="maybeprop"){add(spec.propertyKeywords);}else if(st=="prop"||st=="parens"||st=="at"||st=="params"){add(spec.valueKeywords);add(spec.colorKeywords);}else if(st=="media"||st=="media_parens"){add(spec.mediaTypes);add(spec.mediaFeatures);} |
| 11 | if(result.length)return{list:result,from:CodeMirror.Pos(cur.line,start),to:CodeMirror.Pos(cur.line,end)};});}); |