chili.js

来自「jQuery即学即用」· JavaScript 代码 · 共 41 行

JS
41
字号
/*===============================================================================Chili is the jQuery code highlighter plugin...............................................................................                                               Copyright 2007 / Andrea Ercolino-------------------------------------------------------------------------------LICENSE: http://www.opensource.org/licenses/mit-license.phpWEBSITE: http://noteslog.com/chili/===============================================================================*/ChiliBook.recipeLoading = false;ChiliBook.recipes[ "html.js" ] = {    steps: {          mlcom : { exp: /\<!--(?:.|\n)*?--\>/ }        , tag   : { exp: /(?:\<\!?[\w:]+)|(?:\>)|(?:\<\/[\w:]+\>)|(?:\/\>)/ }        , php   : { exp: /(?:\<\?php\s)|(?:\<\?)|(?:\?\>)/ }        , aname : { exp: /\s+?[\w-]+:?\w+(?=\s*=)/ }        , avalue: { exp: /(=\s*)(([\"\'])(?:(?:[^\3\\]*?(?:\3\3|\\.))*?[^\3\\]*?)\3)/        , replacement: '$1<span class="$0">$2</span>' }        , entity: { exp: /&[\w#]+?;/ }    }};ChiliBook.recipes[ "javascript.js" ] = {  steps: {      mlcom   : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }    , com     : { exp: /\/\/.*/ }    , regexp  : { exp: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/ }    , string  : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }    , numbers : { exp: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/ }    , paren   : { exp: /({|})/ }    , reserved: { exp: /\b(function|this)\b/ }    , keywords: { exp: /\b(arguments|break|case|catch|continue|default|delete|do|else|false|for|if|in|instanceof|new|null|return|switch|true|try|typeof|var|void|while|with)\b/ }    , global  : { exp: /\b(toString|valueOf|window|self|element|prototype|constructor|document|escape|unescape|parseInt|parseFloat|setTimeout|clearTimeout|setInterval|clearInterval|NaN|isNaN|Infinity)\b/ }  }};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?