PluginProbe ʕ •ᴥ•ʔ
SiteOrigin CSS / 1.0.2
SiteOrigin CSS v1.0.2
1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.10 1.5.11 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0
so-css / lib / codemirror / addon / hint / javascript-hint.min.js
so-css / lib / codemirror / addon / hint Last commit date
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
javascript-hint.min.js
26 lines
1
2 (function(mod){if(typeof exports=="object"&&typeof module=="object")
3 mod(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)
4 define(["../../lib/codemirror"],mod);else
5 mod(CodeMirror);})(function(CodeMirror){var Pos=CodeMirror.Pos;function forEach(arr,f){for(var i=0,e=arr.length;i<e;++i)f(arr[i]);}
6 function arrayContains(arr,item){if(!Array.prototype.indexOf){var i=arr.length;while(i--){if(arr[i]===item){return true;}}
7 return false;}
8 return arr.indexOf(item)!=-1;}
9 function scriptHint(editor,keywords,getToken,options){var cur=editor.getCursor(),token=getToken(editor,cur);if(/\b(?:string|comment)\b/.test(token.type))return;token.state=CodeMirror.innerMode(editor.getMode(),token.state).state;if(!/^[\w$_]*$/.test(token.string)){token={start:cur.ch,end:cur.ch,string:"",state:token.state,type:token.string=="."?"property":null};}else if(token.end>cur.ch){token.end=cur.ch;token.string=token.string.slice(0,cur.ch-token.start);}
10 var tprop=token;while(tprop.type=="property"){tprop=getToken(editor,Pos(cur.line,tprop.start));if(tprop.string!=".")return;tprop=getToken(editor,Pos(cur.line,tprop.start));if(!context)var context=[];context.push(tprop);}
11 return{list:getCompletions(token,context,keywords,options),from:Pos(cur.line,token.start),to:Pos(cur.line,token.end)};}
12 function javascriptHint(editor,options){return scriptHint(editor,javascriptKeywords,function(e,cur){return e.getTokenAt(cur);},options);};CodeMirror.registerHelper("hint","javascript",javascriptHint);function getCoffeeScriptToken(editor,cur){var token=editor.getTokenAt(cur);if(cur.ch==token.start+1&&token.string.charAt(0)=='.'){token.end=token.start;token.string='.';token.type="property";}
13 else if(/^\.[\w$_]*$/.test(token.string)){token.type="property";token.start++;token.string=token.string.replace(/\./,'');}
14 return token;}
15 function coffeescriptHint(editor,options){return scriptHint(editor,coffeescriptKeywords,getCoffeeScriptToken,options);}
16 CodeMirror.registerHelper("hint","coffeescript",coffeescriptHint);var stringProps=("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight "+"toUpperCase toLowerCase split concat match replace search").split(" ");var arrayProps=("length concat join splice push pop shift unshift slice reverse sort indexOf "+"lastIndexOf every some filter forEach map reduce reduceRight ").split(" ");var funcProps="prototype apply call bind".split(" ");var javascriptKeywords=("break case catch continue debugger default delete do else false finally for function "+"if in instanceof new null return switch throw true try typeof var void while with").split(" ");var coffeescriptKeywords=("and break catch class continue delete do else extends false finally for "+"if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" ");function getCompletions(token,context,keywords,options){var found=[],start=token.string,global=options&&options.globalScope||window;function maybeAdd(str){if(str.lastIndexOf(start,0)==0&&!arrayContains(found,str))found.push(str);}
17 function gatherCompletions(obj){if(typeof obj=="string")forEach(stringProps,maybeAdd);else if(obj instanceof Array)forEach(arrayProps,maybeAdd);else if(obj instanceof Function)forEach(funcProps,maybeAdd);for(var name in obj)maybeAdd(name);}
18 if(context&&context.length){var obj=context.pop(),base;if(obj.type&&obj.type.indexOf("variable")===0){if(options&&options.additionalContext)
19 base=options.additionalContext[obj.string];if(!options||options.useGlobalScope!==false)
20 base=base||global[obj.string];}else if(obj.type=="string"){base="";}else if(obj.type=="atom"){base=1;}else if(obj.type=="function"){if(global.jQuery!=null&&(obj.string=='$'||obj.string=='jQuery')&&(typeof global.jQuery=='function'))
21 base=global.jQuery();else if(global._!=null&&(obj.string=='_')&&(typeof global._=='function'))
22 base=global._();}
23 while(base!=null&&context.length)
24 base=base[context.pop().string];if(base!=null)gatherCompletions(base);}else{for(var v=token.state.localVars;v;v=v.next)maybeAdd(v.name);for(var v=token.state.globalVars;v;v=v.next)maybeAdd(v.name);if(!options||options.useGlobalScope!==false)
25 gatherCompletions(global);forEach(keywords,maybeAdd);}
26 return found;}});