From 48acc42421bc854815c30c85f2005a025e80fc42 Mon Sep 17 00:00:00 2001 From: jay <917647288@qq.com> Date: Sun, 14 Jul 2013 17:21:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B7=BB=E5=8A=A0cli?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=8C=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=85=BC=E5=AE=B93=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Context.sublime-menu | 5 +- Default (Linux).sublime-keymap | 4 - Default (Linux).sublime-mousemap | 3 +- Default (OSX).sublime-keymap | 4 - Default (Windows).sublime-keymap | 4 - Default (Windows).sublime-mousemap | 3 +- Main.sublime-menu | 115 +- README.md | 33 +- ThinkPHP-CLI.html | 419 +++++++ ThinkPHP-Queryer | 5 + ThinkPHP-Queryer.sql | 11 + Thinkphp.py | 520 +++------ Thinkphp.sublime-commands | 26 - Thinkphp.sublime-settings | 25 +- command.php | 80 +- manual/public/book.tpl | 48 - manual/public/css/book.css | 540 --------- manual/public/css/prettify.css | 47 - manual/public/js/jquery-1.7.1.min.js | 4 - manual/public/js/prettify.js | 1536 -------------------------- php.sublime-completions | 6 +- thinkphp_database_queryer | 7 +- tpl.sublime-completions | 28 +- 23 files changed, 705 insertions(+), 2768 deletions(-) delete mode 100644 Default (Linux).sublime-keymap delete mode 100644 Default (OSX).sublime-keymap delete mode 100644 Default (Windows).sublime-keymap create mode 100644 ThinkPHP-CLI.html create mode 100644 ThinkPHP-Queryer create mode 100644 ThinkPHP-Queryer.sql delete mode 100644 Thinkphp.sublime-commands delete mode 100644 manual/public/book.tpl delete mode 100644 manual/public/css/book.css delete mode 100644 manual/public/css/prettify.css delete mode 100644 manual/public/js/jquery-1.7.1.min.js delete mode 100644 manual/public/js/prettify.js diff --git a/Context.sublime-menu b/Context.sublime-menu index 8acd507..a7aaef6 100644 --- a/Context.sublime-menu +++ b/Context.sublime-menu @@ -1,5 +1,4 @@ [ - { "command": "search_word_thinkphp_manual", "caption": "Search ThinkPHP manual here" }, - { "command": "show_cloums_by_word", "caption": "show_cloums" }, - { "command": "goto_php_documentent", "caption": "goto_php_document" } + { "command": "query_database", "caption": "show_cloums" ,"args": {"cmd" :"show_cloum"}}, + { "command": "goto_php_document", "caption": "goto_php_document" } ] diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap deleted file mode 100644 index a23a7b9..0000000 --- a/Default (Linux).sublime-keymap +++ /dev/null @@ -1,4 +0,0 @@ -[ - { "keys": ["ctrl+super+m"], "command": "thinkphp" }, - { "keys": ["ctrl+super+u"], "command": "update_thinkphp_manual" } -] \ No newline at end of file diff --git a/Default (Linux).sublime-mousemap b/Default (Linux).sublime-mousemap index 1eae3c0..44e91a0 100644 --- a/Default (Linux).sublime-mousemap +++ b/Default (Linux).sublime-mousemap @@ -1,3 +1,4 @@ [ - { "button": "button1", "modifiers": ["alt"], "command": "goto_php_document"} + { "button": "button1", "modifiers": ["ctrl"], "command": "goto_definition" }, + { "button": "button1", "modifiers": ["alt"], "command": "goto_php_document" } ] diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap deleted file mode 100644 index a23a7b9..0000000 --- a/Default (OSX).sublime-keymap +++ /dev/null @@ -1,4 +0,0 @@ -[ - { "keys": ["ctrl+super+m"], "command": "thinkphp" }, - { "keys": ["ctrl+super+u"], "command": "update_thinkphp_manual" } -] \ No newline at end of file diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap deleted file mode 100644 index 98463d9..0000000 --- a/Default (Windows).sublime-keymap +++ /dev/null @@ -1,4 +0,0 @@ -[ - { "keys": ["ctrl+alt+m"], "command": "thinkphp" }, - { "keys": ["ctrl+alt+u"], "command": "update_thinkphp_manual" } -] \ No newline at end of file diff --git a/Default (Windows).sublime-mousemap b/Default (Windows).sublime-mousemap index 84fe00a..44e91a0 100644 --- a/Default (Windows).sublime-mousemap +++ b/Default (Windows).sublime-mousemap @@ -1,3 +1,4 @@ [ - { "button": "button1", "modifiers": ["ctrl"], "command": "goto_php_document" } + { "button": "button1", "modifiers": ["ctrl"], "command": "goto_definition" }, + { "button": "button1", "modifiers": ["alt"], "command": "goto_php_document" } ] diff --git a/Main.sublime-menu b/Main.sublime-menu index 4faad32..49170dd 100644 --- a/Main.sublime-menu +++ b/Main.sublime-menu @@ -4,86 +4,41 @@ "children": [ { - "caption": "ThinkPHP", - "children": - [ - { - "caption": "ThinkPHP delete opened folders' bom", - "id": "ThinkPHP del_bom", - "command": "del_workspace_boms" - }, - { - "caption": "ThinkPHP manual", - "id": "ThinkPHP manual", - "command": "thinkphp" - }, - { - "caption": "ThinkPHP manual: api", - "id": "ThinkPHP api manual", - "command": "view_thinkphp_api_manual" - }, - { - "caption": "ThinkPHP manual: search", - "id": "ThinkPHP manual: search", - "command": "search_thinkphp_manual" - }, - { - "caption": "ThinkPHP manual: build book", - "id": "ThinkPHP manual: build book", - "command": "update_thinkphp_manual" - }, - { "caption": "-" }, - { - "caption": "ThinkPHP choose database", - "id": "ThinkPHP choose database", - "command": "query_database", - "args": {"cmd" :"list_database"} - }, - { "caption": "-" }, - { "command": "open_file", - "args": {"file": "${packages}/Thinkphp/php.sublime-completions"}, - "caption": "Browse Complation - php", "mnemonic": "B" - }, - { - "command": "open_file", - "args": {"file": "${packages}/Thinkphp/tpl.sublime-completions"}, - "caption": "Browse Complation - tpl" - }, - { - "command": "open_file", - "args": {"file": "${packages}/Thinkphp/ThinkPHP.sublime-settings"}, - "caption": "Settings – Default" - }, - { - "command": "open_file", - "args": {"file": "${packages}/User/ThinkPHP.sublime-settings"}, - "caption": "Settings – User" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/ThinkPHP/Default (Windows).sublime-keymap", - "platform": "Windows" - }, - "caption": "Key Bindings – Default" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/ThinkPHP/Default (OSX).sublime-keymap", - "platform": "OSX" - }, - "caption": "Key Bindings – Default" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/ThinkPHP/Default (Linux).sublime-keymap", - "platform": "Linux" - }, - "caption": "Key Bindings – Default" - } - ] + "caption": "ThinkPHP manual: api", + "id": "ThinkPHP api manual", + "command": "view_thinkphp_api_manual" + }, + { + "caption": "ThinkPHP change database", + "id": "ThinkPHP change database", + "command": "query_database", + "args": {"cmd" :"change_database"} + }, + { + "caption": "ThinkPHP database queryer", + "id": "ThinkPHP database queryer", + "command": "query_database", + "args": {"cmd" :"query"} + }, + { + "caption": "ThinkPHP-CLI", + "id": "ThinkPHP executer", + "command": "thinkphp" + }, + { "caption": "-" }, + { + "command": "open_file", + "args": {"file": "${packages}/Thinkphp/ThinkPHP.sublime-settings"}, + "caption": "Settings – Default" + }, + { "command": "open_file", + "args": {"file": "${packages}/Thinkphp/php.sublime-completions"}, + "caption": "Browse Complation - php", "mnemonic": "B" + }, + { + "command": "open_file", + "args": {"file": "${packages}/Thinkphp/tpl.sublime-completions"}, + "caption": "Browse Complation - tpl" } ] } diff --git a/README.md b/README.md index 64057c9..3efe789 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,17 @@ ##Thinkphp是什么? -Sublime中的一个THinkphp框架的工具包,主要包括访问在线手册,生成本地手册页面,搜索官网手册和thinkphp snippet +Sublime中的一个THinkphp框架的工具包,主要包括thinkphp snippet、访问框架在线api、以及一些编程辅助功能。目前重构的插件去除了手册相关功能,同时支持Sublime text2和3版本。 ##Thinkphp有哪些功能? -* 在编辑器中获取最新手册列表,然后选择后打开本采集的离线手册页面 -* 在编辑器中输入关键词或选中词后右键搜索 -* 生成全部ThinkPHP官网手册的页面 * 访问官网框架在线api -* 辅助删除编辑器中打开目录所有文件的bom头 +* 辅助删除编辑器中打开目录所有文件的bom头(后期补上,移植到3的时候报错解决不了,等我想办法解决) * 通过sublime-completions提供代码完成功能 -* ctrl点击或者选中函数名后右键显示函数说明文档(英文) +* ctrl点击或者选中函数名后右键显示函数说明文档(英文) 手册目录 -![ThinkPHP manual](http://ww2.sinaimg.cn/large/50075709tw1dytu1g1xa1j.jpg) -改进后的菜单更集中 -![ThinkPHP manual menu](http://ww4.sinaimg.cn/large/50075709tw1dyzlv2uk6oj.jpg) -![ThinkPHP api manual](http://ww3.sinaimg.cn/large/50075709tw1dyzlvmdds7j.jpg) -删除bom头 -![ThinkPHP 打开目录的删除bom头命令结果](http://ww4.sinaimg.cn/large/50075709tw1dyzlvbi4daj.jpg) +![ThinkPHP manual](http://www.thinkphp.cn/Uploads/editor/2013-07-14/51e25dad0bc2b.jpg) +改进后的菜单少了一层,更快捷 Snippet提示 -![sublime-completions](http://bbs.thinkphp.cn/data/attachment/forum/201207/27/0942179zll1qlqs9dsn3tt.png) +![sublime-completions](http://www.thinkphp.cn/Uploads/editor/2013-07-14/51e25e9621c58.png) ![视频: 用Sublime text2的Thinkphp插件 像zencoding)一样快速开发TP](http://v.youku.com/v_show/id_XNTA1NjE2MTM2.html) 查看函数说明文档 @@ -33,7 +26,19 @@ mysql编辑器内简单查询 注意database里 0 的那个键不要删除,剪切板里会有要添加的模板,自己要么先删除只剩0,保存后。下次选添加进来,粘贴会有1的模板,自己替换下即可。以后会扩展支持sqlserver。 -2.替换出来的查询页面里的"here is the sql to be queryed" 为要查询的sql,保存后就切换tab后就能显示结果了。这是bug。因为查询结果是用php写文件的。 +现在查看数据表字段注释和数据库查询统一用配置里的去访问数据库,因此有个“change database”菜单和“database queryer”菜单,查询表字段支持tp的命名方式,比如原表名think_user,在配置文件里配了前缀后我们在php文件里写D('User') 这样User选中后右键直接show_cloums就行了,为了方便大家记忆去除从输入框填写的步骤,简化为一个操作 +效果如下: + +![效果图](http://www.thinkphp.cn/Uploads/editor/2012-12-10/50c56b7fd4e97.png) + +最后还支持了命令行访问网页cli模式方便大家调试action中操作,不需要开浏览器。 +选择菜单中的ThinkPHP-CLI 弹出的文件中 输入你想访问的url 记住打开的项目更目录要有入口文件,并且php在path环境变量中有设置。 +保存就可显示结果: + +![效果图](http://www.thinkphp.cn/Uploads/editor/2013-07-14/51e2689cce54a.png) + +这样方便大家调试数据而不必切换浏览器,或者调试接口的时候用 + ##有问题反馈 在使用中有任何问题,欢迎反馈给我,可以用以下联系方式跟我交流 diff --git a/ThinkPHP-CLI.html b/ThinkPHP-CLI.html new file mode 100644 index 0000000..6073ed2 --- /dev/null +++ b/ThinkPHP-CLI.html @@ -0,0 +1,419 @@ +Index/index +################################################### + + + + + + + + + + + + + + + + + + + + + + 首页 + + + +
+ +
+
+ +
+
+ + +
+ ,欢迎回来! + + 首次登录 +
+ + + + +
+ +
+
+ + + \ No newline at end of file diff --git a/ThinkPHP-Queryer b/ThinkPHP-Queryer new file mode 100644 index 0000000..eec75e0 --- /dev/null +++ b/ThinkPHP-Queryer @@ -0,0 +1,5 @@ + + +########################################################################## + +result to be display. diff --git a/ThinkPHP-Queryer.sql b/ThinkPHP-Queryer.sql new file mode 100644 index 0000000..7585515 --- /dev/null +++ b/ThinkPHP-Queryer.sql @@ -0,0 +1,11 @@ +select user from user +########################################################################## + ++------+ +| user | ++------+ +| root | +| root | +| | +| root | ++------+ diff --git a/Thinkphp.py b/Thinkphp.py index e24818d..dd31d5c 100644 --- a/Thinkphp.py +++ b/Thinkphp.py @@ -1,304 +1,118 @@ # -*- coding: utf-8 -*- import sublime, sublime_plugin -import os, httplib, urllib, urllib2, json, webbrowser, threading, codecs +import os, json, threading, codecs, subprocess, webbrowser +from subprocess import PIPE -settings = sublime.load_settings('Thinkphp.sublime-settings') -api_root_url = 'doc.thinkphp.cn' packages_path = sublime.packages_path() + os.sep + 'Thinkphp' -manual_dir = settings.get('manual_dir') - +query_window = packages_path + os.sep + 'ThinkPHP-CLI.html' +query_table = packages_path + os.sep + 'ThinkPHP-Queryer' +seperator = '\n###################################################\n\n' +settings = sublime.load_settings('Thinkphp.sublime-settings') def fs_reader(path): - return codecs.open(path, mode='r', encoding='utf-8').read() - + return codecs.open(path, mode='r', encoding='utf8').read() def fs_writer(path, raw): - codecs.open(path, mode='w', encoding='gbk', errors='ignore').write(raw) - - -def out_tpl(new, name, sub=''): - if sub == '': - return tpl.replace('{%ROOT}', '.').replace('{%title}', name).replace('{%s}', new) - else: - return tpl.replace('{%ROOT}', '..').replace('{%title}', name).replace('{%s}', new) - - -def get_tpl_fullpath(filename, parent_dir=''): - return packages_path + os.sep + manual_dir + os.sep + parent_dir + filename + '.html' - - -def write_tpl(filename, content, parent_dir=''): - # if not os.path.isfile(get_tpl_fullpath(filename,parent_dir)): - fs_writer(get_tpl_fullpath(filename, parent_dir), content) - + codecs.open(path, mode='w', encoding='utf8', errors='ignore').write(raw) def open_tab(url): webbrowser.open_new_tab(url) - -def get_content(id, name, parent_dir=''): - conn = httplib.HTTPConnection(api_root_url) - conn.request("GET", "/api/view/"+id) - r1 = conn.getresponse() - data1 = r1.read() - data1 = json.loads(data1) - data = data1['data'] - content = '' - if data is not None: - for i in data: - content = content + i['content'] - else: - print id + ',' - if parent_dir == '': - return out_tpl(content, name) - else: - return out_tpl(content, name, 1) - -tpl = fs_reader(os.path.join(packages_path + os.sep + manual_dir + os.sep+'public', 'book.tpl')) - - class ThinkphpCommand(sublime_plugin.TextCommand): - - def see(self, id, name, parent_dir=''): - #url = 'http://doc.thinkphp.cn/manual/' + self.data[arg]['name'] - # content = get_content(id,name,parent_dir) - # write_tpl(name,content,parent_dir) - self.build(id, name, parent_dir) - path = get_tpl_fullpath(name, parent_dir) - url = 'file:///'+urllib.quote(path.encode('utf8')) - open_tab(url) - - def build(self, id, name, parent_dir=''): - content = get_content(id, name, parent_dir) - write_tpl(name, content, parent_dir) - - def del_bom(self, dir): - file_count = 0 - bom_files = [] - self.view.window().run_command("show_panel", {"panel": "console", "toggle": None}) - for dirpath, dirnames, filenames in os.walk(dir): - if(len(filenames)): - for filename in filenames: - file_count += 1 - file = open(dirpath + "/" + filename, 'r+') - file_contents = file.read() - - if(len(file_contents) > 3): - if(ord(file_contents[0]) == 239 and ord(file_contents[1]) == 187 and ord(file_contents[2]) == 191): - bom_files.append(dirpath + "/" + filename) - file.seek(0) - file.write(file_contents[3:]) - print dirpath + "/" + filename, "BOM found. Deleted." - file.close() - print file_count, "file(s) found.", len(bom_files), "file(s) have a bom. Deleted." - def run(self, edit): - data = self._init() - self.data = data - chapter = [] - tree = [] - sort_data = [] - k = 0 - for i in data: - chapter.insert(int(i['id']), i['title']) - sort_data.insert(k, i['title']) - state = i.get('_child', None) - if state: - tree.insert(k, i['_child']) - else: - tree.insert(k, None) - k = k+1 - # print chapter - self.chapter = chapter - self.sort_data = sort_data - self.tree = tree - self.view.window().show_quick_panel(chapter, self.panel_done) - - def panel_done(self, arg): - if arg == -1: - pass - else: - self.tree_key = arg - if self.tree[arg] is None: - self.see(self.data[arg]['id'], str(arg)+'.'+self.data[arg]['title']) - else: - parent_dir = packages_path+os.sep+manual_dir+os.sep+str(arg)+'.'+self.sort_data[arg] - if not os.path.isdir(parent_dir): - os.mkdir(parent_dir) - child = [] - k = 0 - for i in self.tree[arg]: - child.insert(k, i['title']) - k += 1 - self.view.window().show_quick_panel(child, self.child_done) - - def child_done(self, arg): - if arg == -1: - self.view.window().show_quick_panel(self.chapter, self.panel_done) - else: - self.see(self.tree[self.tree_key][arg]['id'], str(self.tree_key)+'.'+str(arg)+' '+self.tree[self.tree_key][arg]['title'], str(self.tree_key)+'.'+self.sort_data[self.tree_key]+os.sep) + window = sublime.active_window() + views = window.views() + view = None + for _view in views: + if _view.name() == 'ThinkPHP-CLI.html': + view = _view + break + if not view: + tpl = seperator + 'result to be display.' + fs_writer(query_window, tpl) + self.view.window().open_file(query_window) def view_api(self): url = settings.get('api_url') open_tab(url) - def _init(self): - conn = httplib.HTTPConnection(api_root_url) - conn.request("GET", "/api") - r1 = conn.getresponse() - data1 = r1.read() - data1 = json.loads(data1) - return data1['data'] - - def search_panel(self): - self.view.window().show_input_panel('search in thinkphp manual?', '', self.search_done, self.search_change, self.search_cancel) - - def search_done(self, arg): - data = {'keywords': arg} - f = urllib2.urlopen(url='http://' + api_root_url + '/api/search', data=urllib.urlencode(data)) - data = f.read() - data = json.loads(data) - if data['data'] == []: - sublime.error_message('No Search result !') - else: - chapter = [] - data = data['data'] - self.search_list = data - for i in data: - chapter.insert(int(i['id']), i['title']) - self.view.window().show_quick_panel(chapter, self.manual_search_done) - - def manual_search_done(self, arg): - if arg == -1: - pass - else: - choose = self.search_list[arg] - data = self._init() - for i in data: - if i['id'] == choose['id']: - self.see(choose['id'], choose['title'], '_search'+os.sep) - else: - state = i.get('_child', None) - if state: - for j in i['_child']: - if j['id'] == choose['id']: - if not os.path.isdir(packages_path + os.sep + manual_dir + os.sep+i['title']): - os.mkdir(packages_path + os.sep + manual_dir + os.sep + i['title']) - self.see(choose['id'], choose['title'], '_search'+os.sep) - - def search_change(self, arg): - pass - - def search_cancel(self): - pass - - def cloums(self, arg): - self.show_cloums(arg) - - def cloums_panel(self): - self.view.window().show_input_panel('table you want show?', '', self.show_cloums, self.search_change, self.search_cancel) - - def show_cloums(self, arg): - table = arg - self.table = table - dir = self.view.window().folders() +class Thinkphp(sublime_plugin.EventListener): + def on_post_save(self, view): + dir = view.window().folders() if dir == []: - sublime.error_message('Please open a full ThinkPHP project') + sublime.error_message('Please open a folder') else: - cfg_files = [] - for dirpath, dirnames, filenames in os.walk(dir[0]): - if(len(filenames)): - for filename in filenames: - if filename == 'config.php' and dirpath.find('ThinkPHP') == -1: - cfg_files.append([filename, dirpath + os.sep + filename]) - if(len(cfg_files)): - self.cfg_files = cfg_files - self.view.window().show_quick_panel(cfg_files, self.choose_conf) + content = view.substr(sublime.Region(0, view.size())) + title = "ThinkPHP-CLI.html" + if view.file_name().find(title) != -1: + global seperator + query = content.split(seperator) + cmd = query[0] + command_text = ['php', dir[0] + os.sep + 'index.php', cmd] + thread = cli(command_text,view,dir[0]) + thread.start() + ThreadProgress(thread, 'Is excuting', 'cli excuted') else: - sublime.error_message('no config.php') - - def choose_conf(self, arg): - config_file = self.cfg_files[arg][1] - command_text = 'php "' + packages_path + os.sep + 'command.php" "show_colums_after_connected_from_file" "' + config_file + '" ' + self.table + '"' - print command_text - cloums = os.popen(command_text) - data = json.loads(cloums.read()) - if(data['status'] == 0): - sublime.error_message(data['info']) - else: - cloums = [] - for i in data['data']: - cloums.append([i['Field'], i['Type'], i['Comment']]) - self.view.window().show_quick_panel(cloums, self.search_cancel) + title2 = "ThinkPHP-Queryer" + if view.file_name().find(title2) != -1: + seperator = """##########################################################################""" + query = content.split(seperator) + if len(query) == 2: + sql = query[0] + if sql == '': + sublime.status_message('Pls input correct sql') + else: + command_text = 'php "' + packages_path + os.sep + 'command.php" "query"' + thread = queryWithPhp(command_text) + thread.start() + ThreadProgress(thread, 'Is querying', 'Database query complated!') + else: + sublime.status_message('Error format queryer, pls close it the retry query') -class del_workspace_boms(ThinkphpCommand, sublime_plugin.TextCommand): - def run(self, edit): - dir = self.view.window().folders() - if dir == []: - sublime.error_message('Please open a folder') +class query_database(ThinkphpCommand, sublime_plugin.TextCommand): + def run(self, edit, cmd): + self.cmd = cmd + if cmd == 'change_database': + self.list_database() else: - self.del_bom(dir[0]) + current_database = fs_reader(packages_path + os.sep + 'current_database') + if current_database < '1': + self.list_database() + else: + if cmd == 'show_cloum': + self.show_cloum() + else: + self.show_query_database() -class goto_php_document(ThinkphpCommand, sublime_plugin.TextCommand): - def run(self, edit): + def show_cloum(self): region = self.view.sel()[0] - # pos = self.view.rowcol(region) - # print pos if region.begin() != region.end(): - function = self.view.substr(region) - command_text = 'php "' + packages_path + os.sep + 'command.php" "find_php_defination" "' + function + '"' - # print command_text + table = self.view.substr(region) + command_text = 'php "' + packages_path + os.sep + 'command.php" "show_colums" "' + table + '"' cloums = os.popen(command_text) - # print cloums - # print cloums.read() data = json.loads(cloums.read()) - # print data find - if data['status'] == 0: - sublime.status_message(data['info']) + if(data['status'] == 0): + sublime.error_message(data['info']) else: - # self.view.window().run_command("show_panel", {"panel": "console", "toggle": None}) - # fs_writer(packages_path + os.sep + 'temp.html', data['data']) - window = sublime.active_window() - views = window.views() - view = None - for _view in views: - if _view.name() == ('function "%s" defination(php)') % function: - view = _view - break - - if not view: - view = window.new_file() - view.set_name(('function "%s" defination(php)') % function) - view.set_scratch(True) - - def write(string): - edit = view.begin_edit() - if view.size() == 0: - view.insert(edit, view.size(), string) - view.end_edit(edit) - - write(data['data']) - # command_text = '"' + packages_path + os.sep + 'toolkit.exe" tpl="' + packages_path + os.sep + 'temp.html"' - # print command_text - # cloums = os.popen(command_text) - # cloums.read() - # self.view.window().show_quick_panel([data['data']], self.search_cancel) + cloums = [] + for i in data['data']: + cloums.append([i['Field'], i['Type'], i['Comment']]) + self.view.window().show_quick_panel(cloums, self.cancel) else: - sublime.status_message('must be a word') + sublime.error_message('Pls choose your table') + def cancel(self,arg): + pass -class query_database(ThinkphpCommand, sublime_plugin.TextCommand): - def run(self, edit, cmd): - if cmd == 'list_database': - database = [] - db_list = settings.get('database') - for i in db_list: - database.insert(int(i), db_list[i]['list_title']) - self.database = database - # print database - self.view.window().show_quick_panel(database, self.choose_database) + def list_database(self): + database = [] + db_list = settings.get('database') + for i in db_list: + database.insert(int(i), db_list[i]['list_title']) + self.database = database + self.view.window().show_quick_panel(database, self.choose_database) def choose_database(self, arg): if arg == -1: @@ -320,51 +134,84 @@ def choose_database(self, arg): sublime.set_clipboard(tpl) self.view.window().open_file(setting_file) else: - fs_writer(packages_path + os.sep + 'current_database', arg) + fs_writer(packages_path + os.sep + 'current_database', str(arg)) + if self.cmd == 'show_cloum': + self.show_cloum() + + def show_query_database(self): + window = sublime.active_window() + views = window.views() + view = None + for _view in views: + if _view.name() == 'ThinkPHP-Queryer': + view = _view + break + + if not view: + tpl = """ + +########################################################################## + +result to be display. +""" + fs_writer(query_table, tpl) + self.view.window().open_file(query_table) + +class goto_php_document(ThinkphpCommand, sublime_plugin.TextCommand): + def run(self, edit): + region = self.view.sel()[0] + if region.begin() != region.end(): + function = self.view.substr(region) + command_text = 'php "' + packages_path + os.sep + 'command.php" "find_php_defination" "' + function + '"' + cloums = os.popen(command_text) + data = json.loads(cloums.read()) + if data['status'] == 0: + sublime.status_message(data['info']) + else: window = sublime.active_window() views = window.views() view = None for _view in views: - if _view.name() == 'thinkphp_database_queryer': + if _view.name() == ('function "%s" defination(php)') % function: view = _view break if not view: - tpl = """+------------------------thinkphp_database_queryer-----------------------+ - -########################################################################## - -here is the sql to be queryed + view = window.new_file() + view.set_name(('function "%s" defination(php)') % function) + view.set_scratch(True) -########################################################################## + def write(string): + edit = view.begin_edit() + if view.size() == 0: + view.insert(edit, view.size(), string) + view.end_edit(edit) -here will show the result -""" - query_window = packages_path + os.sep + 'thinkphp_database_queryer' - fs_writer(query_window, tpl) - self.view.window().open_file(query_window) + write(data['data']) + else: + sublime.status_message('must be a word') +class view_thinkphp_api_manual(ThinkphpCommand, sublime_plugin.TextCommand): + """see the ThinkPHP api online""" + def run(self, arg): + self.view_api() -class Thinkphp(sublime_plugin.EventListener): - def on_post_save(self, view): - content = view.substr(sublime.Region(0, view.size())) - print view.file_name() - title = "thinkphp_database_queryer" - if view.file_name().find(title): - seperator = """##########################################################################""" - query = content.split(seperator) - if len(query) == 3: - sql = query[1] - if sql == '': - sublime.status_message('Pls input correct sql') - else: - command_text = 'php "' + packages_path + os.sep + 'command.php" "query"' - thread = queryWithPhp(command_text) - thread.start() - ThreadProgress(thread, 'Is querying', 'Database query complated!') - else: - sublime.status_message('Error format queryer, pls close it the retry query') +class cli(threading.Thread): + def __init__(self, command_text, view,cwd): + self.command_text = command_text + self.view = view + self.cwd = cwd + threading.Thread.__init__(self) + def run(self): + proce = subprocess.Popen(self.command_text, stdout=PIPE, shell=True, cwd=self.cwd) + data,error = proce.communicate() + if data != b'': + content = self.command_text[2] + seperator + data.decode('utf-8') + fs_writer(query_window, content) + else: + if sublime.version() < '3000': + sublime.error_message('cli executed!') class queryWithPhp(threading.Thread): def __init__(self, command_text): @@ -373,83 +220,12 @@ def __init__(self, command_text): def run(self): cloums = os.popen(self.command_text) - # print cloums.read() data = cloums.read() if data: sublime.error_message(data) else: - sublime.error_message('query complated!') - - -class update_thinkphp_manual(ThinkphpCommand, sublime_plugin.TextCommand): - def run(self, edit): - manual_path = packages_path + os.sep + manual_dir + os.sep - thread = updateManual(manual_path) - thread.start() - ThreadProgress(thread, 'Is making ThinkPHP manual', 'ThinkPHP manual generated!') - - -class show_cloums_by_word(ThinkphpCommand, sublime_plugin.TextCommand): - def run(self, edit): - region = self.view.sel()[0] - if region.begin() != region.end(): - self.cloums(self.view.substr(region)) - else: - self.cloums_panel() - - -class search_word_thinkphp_manual(ThinkphpCommand, sublime_plugin.TextCommand): - def run(self, edit): - region = self.view.sel()[0] - if region.begin() != region.end(): - self.search_done(self.view.substr(region)) - else: - self.search_panel() - - -class search_thinkphp_manual(ThinkphpCommand, sublime_plugin.TextCommand): - def run(self, edit): - self.search_panel() - - -class view_thinkphp_api_manual(ThinkphpCommand, sublime_plugin.TextCommand): - """see the ThinkPHP api online""" - def run(self, arg): - self.view_api() - - -class updateManual(threading.Thread): - def __init__(self, manual_path): - self.manual_path = manual_path - threading.Thread.__init__(self) - conn = httplib.HTTPConnection(api_root_url) - conn.request("GET", "/api") - r1 = conn.getresponse() - data1 = r1.read() - data1 = json.loads(data1) - self.data = data1['data'] - - def run(self): - data = self.data - i = 0 - for j in data: - if not j.get('_child', None): - self.build(j['id'], str(i)+'.'+j['title']) - else: - parent_dir = str(i)+'.'+j['title'] - if not os.path.isdir(self.manual_path+parent_dir): - os.mkdir(self.manual_path+parent_dir) - k = 1 - for t in j['_child']: - sublime.set_timeout(self.build(t['id'], str(i)+'.'+str(k)+' '+t['title'], parent_dir + os.sep), 1) - k = k+1 - i = i+1 - sublime.message_dialog('The manual generated!') - - def build(self, id, name, parent_dir=''): - content = get_content(id, name, parent_dir) - write_tpl(name, content, parent_dir) - + if sublime.version() < '3000': + sublime.error_message('query complated!') class ThreadProgress(): """ @@ -492,4 +268,4 @@ def run(self, i): self.addend = 1 i += self.addend - sublime.set_timeout(lambda: self.run(i), 100) + sublime.set_timeout(lambda: self.run(i), 100) \ No newline at end of file diff --git a/Thinkphp.sublime-commands b/Thinkphp.sublime-commands deleted file mode 100644 index 2633872..0000000 --- a/Thinkphp.sublime-commands +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "caption": "view table design", - "command": "show_cloums_by_word" - }, - { - "caption": "ThinkPHP manual: view api", - "command": "view_thinkphp_api_manual" - }, - { - "caption": "ThinkPHP manual: view manual list", - "command": "thinkphp" - }, - { - "caption": "ThinkPHP manual: build book", - "command": "update_thinkphp_manual" - }, - { - "caption": "ThinkPHP manual: search", - "command": "search_thinkphp_manual" - }, - { - "caption": "ThinkPHP delete opened folders' bom", - "command": "del_workspace_boms" - } -] \ No newline at end of file diff --git a/Thinkphp.sublime-settings b/Thinkphp.sublime-settings index a8f049c..256f9c8 100644 --- a/Thinkphp.sublime-settings +++ b/Thinkphp.sublime-settings @@ -1,7 +1,5 @@ { - "manual_dir":"manual", - "api_url":"http://www.thinkphp.cn/api", - "current_database" :"" , + "api_url" : "http://www.thinkphp.cn/api", "database" : { "0":{ "list_title":"add_database" @@ -10,19 +8,18 @@ "list_title":"fujian", "DB_HOST":"192.168.1.200", "DB_USER": "fujian", - "DB_PWD": "fujian", - "DB_NAME": "fujian", - "DB_PREFIX": "sister_", - "DB_PORT": "3306" + "DB_PWD": "fujian", + "DB_NAME": "fujian", + "DB_PREFIX": "sister_", + "DB_PORT": "3306" }, "2":{ "list_title":"local", - "DB_HOST": "localhost", - "DB_USER": "root", - "DB_PWD": "", - "DB_NAME": "mysql", - "DB_PREFIX": "" - } - + "DB_HOST": "localhost", + "DB_USER": "root", + "DB_PWD": "", + "DB_NAME": "mysql", + "DB_PREFIX": "" + } } } \ No newline at end of file diff --git a/command.php b/command.php index 31ad84d..dff7397 100644 --- a/command.php +++ b/command.php @@ -15,29 +15,36 @@ } } -function show_colums_after_connected_from_file($argv){ - $config = include $argv[0]; - $table = $argv[1]; +//连接数据库 +function connect_db(){ + $settings = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'Thinkphp.sublime-settings'); + $settings = json_decode($settings, true); + $current_database = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'current_database'); + $config = $settings['database'][$current_database]; + if(!$config) + exit('current_database config dosen\'t exsist'); $argv = array( 0=>$config['DB_HOST'].':'.$config['DB_PORT'], 1=>$config['DB_USER'], 2=>$config['DB_PWD'], 3=>$config['DB_NAME'], - 4=>$config['DB_PREFIX'].parse_name($table) + 4=>$config['DB_PREFIX'] ); - show_colums($argv); -} - -function show_colums($argv){ $conn = mysql_connect($argv[0],$argv[1],$argv[2]); if(!$conn && (strpos('localhost', $argv[0])!= -1)){ $conn = mysql_connect(str_replace('localhost', '127.0.0.1', $argv[0]),$argv[1],$argv[2]); } - if(!$conn) error('can\'t connect database'); - $db = mysql_select_db($argv[3],$conn); - mysql_set_charset('UTF8', $conn ); + if(!$conn) + exit('can\'t connect database'); + mysql_select_db($argv[3],$conn); + mysql_set_charset('UTF8', $conn); + return $argv; +} - $result = mysql_query("SHOW FULL COLUMNS FROM {$argv[4]}"); +function show_colums($argv){ + $config = connect_db(); + $table = $config[4].parse_name($argv[0]); + $result = mysql_query("SHOW FULL COLUMNS FROM {$table}"); if(!$result){ error(mysql_error()); }else{ @@ -59,14 +66,10 @@ function find_php_defination($argv){ foreach ($list as $key => $value) { $content = file_get_contents($path.$value); $pos_search = strpos($content, $to_search); - // error('',$pos_search); if($pos_search !== false){ $comment = get_comment($pos_search, $content); if($comment){ - // ver_dump($comment); - $comment = str_replace(PHP_EOL, '\n', $comment); - // $comment = str_replace('/**', ' /**', $comment); - // $comment = nl2br($comment); + // $comment = str_replace(PHP_EOL, '\n', $comment); success('found it!', $comment); break; } @@ -77,39 +80,19 @@ function find_php_defination($argv){ function get_comment($pos,$content){ $content_length = strlen($content); - $end_pos = strripos($content, '*/', $pos-$content_length); - $start_pos = strripos($content, '/**', $end_pos-$content_length); - return substr($content, $start_pos, $end_pos-$start_pos+2); + $end_pos = strripos($content, '*/', $pos - $content_length); + $start_pos = strripos($content, '/**', $end_pos - $content_length); + return substr($content, $start_pos, $end_pos - $start_pos + 2); } function query($argv = ''){ error_reporting(7); - $table_queryer_file = __DIR__.DIRECTORY_SEPARATOR.'thinkphp_database_queryer'; - $settings = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'Thinkphp.sublime-settings'); - $settings = json_decode($settings, true); - $current_database = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'current_database'); - $config = $settings['database'][$current_database]; - if(!$config) - exit('current_database config dosen\'t exsist'); - $argv = array( - 0=>$config['DB_HOST'].':'.$config['DB_PORT'], - 1=>$config['DB_USER'], - 2=>$config['DB_PWD'], - 3=>$config['DB_NAME'], - ); - + $table_queryer_file = __DIR__.DIRECTORY_SEPARATOR.'ThinkPHP-Queryer'; $content = file_get_contents($table_queryer_file); $sep = '##########################################################################'; $arr_content = split($sep, $content); - $sql = trim($arr_content[1]); - $conn = mysql_connect($argv[0],$argv[1],$argv[2]); - if(!$conn && (strpos('localhost', $argv[0])!= -1)){ - var_dump($argv); - $conn = mysql_connect(str_replace('localhost', '127.0.0.1', $argv[0]),$argv[1],$argv[2]); - } - if(!$conn) error('can\'t connect database'); - $db = mysql_select_db($argv[3],$conn); - mysql_set_charset('UTF8', $conn); + $sql = trim($arr_content[0]); + connect_db($argv); $result = mysql_query($sql); $rows = array(); if($result){ @@ -126,12 +109,13 @@ function query($argv = ''){ 'header'=>$header? $header : array(), 'rows'=>$rows ); - - $table = new table($in); - $output = $table->render(0); - if($output == false) + if($rows){ + $table = new table($in); + $output = $table->render(0); + } + if(!$output) $output = 'no results!'; - $output = str_replace($arr_content[2], PHP_EOL.PHP_EOL.$output, $content); + $output = str_replace($arr_content[1], PHP_EOL.PHP_EOL.$output, $content); file_put_contents($table_queryer_file, $output); // exit($output); exit; diff --git a/manual/public/book.tpl b/manual/public/book.tpl deleted file mode 100644 index e8fbcb8..0000000 --- a/manual/public/book.tpl +++ /dev/null @@ -1,48 +0,0 @@ - - - - - {%title} - - - - - - - -
- {%s} -
- - \ No newline at end of file diff --git a/manual/public/css/book.css b/manual/public/css/book.css deleted file mode 100644 index c9e15d9..0000000 --- a/manual/public/css/book.css +++ /dev/null @@ -1,540 +0,0 @@ -body{ font-family: "微软雅黑"} -ol,ul{ list-style: none; } -a{ - color: #333; - text-decoration: none; -} -img{ - border: 0 none; -} -.fl{ - float: left; -} -.fr{ - float: right; -} -.cf{ - zoom : 1; -} -.cf:after{ - content : '.'; - display : block; - clear : both; - height: 0; - font-size: 0; - line-height: 0; - visibility: hidden; -} -.book-box{ - position: relative; - z-index: 100; - background-color: #FFF; - min-width: 500px; - padding: 105px 24px 0 230px; -} - -.book-tool{ - padding: 5px 12px; -} - -.book-tool .prev,.book-tool .next{ - padding: 6px 12px; - border: 1px solid #D8D8D8; - background: #F1F1F1; - margin-right: 3px; - border-radius: 2px 2px 2px 2px; - line-height: 0; - font-size: 0; -} - -.book-tool .prev:hover,.book-tool .next:hover,.book-tool .set:hover,.book-tool .share:hover,.book-tool .move:hover{ - background: #f6f6f6; - border-color: #C6C6C6; -} - -.book-tool .prev:hover i,.book-tool .next:hover i,.book-tool .set:hover i,.book-tool .share:hover i,.book-tool .move:hover i{ - opacity: 0.8; -} - -.book-tool .prev i{ - display: inline-block; - height: 13px; - width: 9px; - opacity: 0.5; - background: url(../images/bg_ico.png) no-repeat -26px -25px; -} - -.book-tool .next i{ - display: inline-block; - height: 13px; - width: 9px; - opacity: 0.5; - background: url(../images/bg_ico.png) no-repeat -48px -25px; -} - -.book-tool .book-view{ - margin-right: 12px; -} - -.book-tool .share ul{ - position: absolute; - background: #F6F6F6; - border: 1px solid #C6C6C6; - width: 46px; - top: 25px; - left: -1px; - border-top: none; - text-align: center; - padding: 6px 0 3px; - display: none; -} - -.book-tool .share li{ - line-height: 0; - font-size: 0; - margin-bottom: 3px; -} - -.book-tool .share ul a{ - display: inline-block; - width: 32px; - height: 32px; - line-height: 9999px; - overflow: hidden; - background: url(../images/bg_weibo.png) no-repeat; -} - -.book-tool .share ul .sina{ - background-position: 0 0; -} - -.book-tool .share ul .qq{ - background-position: 0 -37px; -} - -.book-tool .share,.book-tool .set,.book-tool .move{ - padding: 4px 10px; - border: 1px solid #D8D8D8; - background: #F1F1F1; - height: 17px; - line-height: 16px; - border-radius: 2px 2px 2px 2px; - position: relative; - margin-right: 3px; -} - -.book-tool .share i{ - display: inline-block; - width: 14px; - height: 17px; - line-height: 99999px; - overflow: hidden; - vertical-align: top; - opacity: 0.5; - margin-left: 3px; - background: url(../images/bg_ico.png) no-repeat -90px -86px; -} - - -.book-tool .set ul{ - position: absolute; - top: 27px; - left: -1px; - background: #F1F1F1; - border: 1px solid #C6C6C6; - padding: 6px; - min-width: 74px; - width: auto!important; - width: 70px; - display: none; -} - -.book-tool .set i{ - display: inline-block; - width: 18px; - height: 18px; - margin-left: 3px; - line-height: 99999px; - overflow: hidden; - vertical-align: top; - opacity: 0.5; - background: url(../images/bg_ico.png) no-repeat -1px -22px; -} - -.book-tool .move i{ - display: inline-block; - width: 18px; - height: 18px; - margin-left: 3px; - line-height: 99999px; - overflow: hidden; - vertical-align: top; - opacity: 0.5; - background: url(../images/bg_ico.png) no-repeat -63px -65px; -} - -.menu-title{ - color: #D64937; - text-align: left; - font-weight: bold; - padding: 0 16px; - font-size: 16px; -} - - -.book-content,.book-add-content{ - margin: 5px 12px; - padding: 6px; - line-height: 30px; - position: relative; - border-bottom: 1px solid #FFF; - border-top: 1px solid #FFF; -} - -.book-content .code{ - background: #FAFAFA; - border: 1px solid #D1D7DC; - padding: 6px; - font-size: 12px; - font-family: Consolas; - margin: 10px 0; -} - -.book-content p{ - margin: 0; - padding: 0; -} - -.book-content table{ - background: #666; - margin: 10px 0; -} - -.book-content table th{ - color: #fff; - text-align: left; - padding-left: 10px; - padding-right: 10px; - background: #666; -} - -.book-content td{ - padding-left: 10px; - padding-right: 10px; - background: #fff; - cursor: pointer; -} - -.book-content .add td{ - background: #efefef; -} - -.book-content table .hover td{ - background: #D9E5F5; -} - -.book-content-menu{ - padding: 6px 50px; - line-height: 30px; - list-style: outside decimal; -} -.book-content-menu li{ -} - -/* 编辑模式样式 */ -.book-focus{ - background-color: #F3F8F9; -} -.book-edit{ - margin-right: 12px; - margin-left: 12px; - padding: 0; -} -.book-edit textarea{ - resize: none; - font-family: Consolas; -} -.book-editor{ - border: 0 none; - background-color: #F3F8F9; - margin: 0; - padding: 0; - overflow: hidden; - line-height: 25px; - font-size: 14px; - font-family: "微软雅黑"; -} -.book-add{ - margin: 5px 12px; - text-align: center; - padding: 10px; - cursor: pointer; - color: #D74937; - background: #F1F1F1; - border-bottom: 1px dotted #D1D1D1; - border-top: 1px dotted #D1D1D1; -} - -.book-menu li{ - list-style: none; - margin: 0; - padding: 0; - line-height: 25px; - margin-bottom: 1px; - margin-right: 3px; -} - -.book-menu li a{ - display: block; - height: 25px; - padding-right: 6px; - padding-left: 8px; - overflow: hidden; -} - -.book-menu .selected{ - border-left: 2px solid #D54937; - color: #D54937; - font-weight: bold; - padding-left: 6px; -} - -.book-menu li a:hover{ - background-color: #f5f5f5; -} - - -.book-menu li .title:hover{ - -} - -.book-menu li ul{ - display: none; - padding: 0 0 0 13px; -} - -.book-menu .show ul{ - display: block; -} - -.book-title h1, .book-title h2{ - font-size: 24px; - font-weight: 500; - line-height: 40px; - margin-right: 12px; - padding-left: 6px; - margin-left: 12px; -} - - -/*手册头部样式*/ -.book-top .left{ - width: 780px; - height: 54px; -} - -.book-top .book-logo{ - font-weight: bold; - font-size: 28px; - line-height: 54px; - margin-left: 24px; - padding-left: 54px; - background: url(../images/logo.png) no-repeat 0 5px; -} - -.book-top .book-logo sup{ - display: inline-block; - font-size: 12px; - font-weight: normal; - padding: 0 3px 0 10px; - color: #fff; - height: 16px; - overflow: hidden; - line-height: 16px; - font-family: "微软雅黑"; - background: url(../images/version-tip.png) #D74937 no-repeat 0 0; -} - -.book-tool .search{ - position: relative; -} - -.book-tool .search label{ - color: #999; - position: absolute; - top: 2px; - left: 3px; - cursor: text; - line-height: 20px; -} - -.book-tool .search .text{ - width: 280px; - height: 20px; - margin-right: 6px; - line-height: 20px; - padding: 2px 3px; - border: 1px solid #D9D9D9; - border-top-color: #C0C0C0; -} - -.book-tool .search .button{ - height: 26px; - width: 60px; - border: 1px solid #3079ED; - border-radius: 2px 2px 2px 2px; - background: url(../images/search_button.png) #4A8BF5 no-repeat 22px 6px; - padding-right: 3px; - cursor: pointer; -} -.book-tool .search .button:hover{ - background-color: #3B80EE; -} - -.book-footer p{ - line-height: 30px; - text-align: center; - color: #666; - font-size: 12px; -} -.book-footer p a{ - width: 80px; - display: inline-block; - background-position: center; - background-repeat: no-repeat; - background-image: url(../images/thinkphp.png); -} -.book-footer a img{ - display: none; -} -/*当前用户*/ -.user-current{ height: 24px; line-height: 24px; font-size: 14px; margin-right: 24px; } - -/*选择语言*/ -.book-top .right{ position: absolute; right: 0; top: 0; } -.lang-check{ position: absolute; top: 24px; right: 24px; z-index: 1300; padding-right: 10px; font-size: 12px; line-height: 20px; background: url(../images/lang_switch.png) no-repeat right -12px; } -.lang-check ul{ width: 54px; text-align: left; display: none; line-height: 20px; padding: 6px; position: absolute; right: 0; top: 20px; z-index: 1500; background: #fff; border: 1px solid #E5E5E5; } -.lang-check li a{ display: block; height: 20px; border-bottom: 1px solid #E5E5E5; padding: 0 2px; margin-bottom: 2px; } -.lang-check li a:hover{ background-color: #E9F7FE; } -.lang-check.close{ background-position: right 8px; } - -/*评论列表*/ -.review-list{ width: 224px; position: fixed; overflow-y: auto; top: 105px; left: 6px; z-index: 3000; display: none; overflow-y: auto; } - -/*返回顶部*/ -.top-reutrn{ background: #666; padding: 3px; border: 1px solid #fff; border-radius: 2px 2px 2px 2px; } -.top-reutrn a{ display: inline-block; height: 24px; width: 28px; border-top: 2px solid #333; } -.top-reutrn a:hover{ color: #fff; border-top-color: #fff; } - -/*编辑目录*/ -.edit-menu-list li{ - clear: both; - width: 100%; - height: 25px; -} -.edit-menu-list li.hover{ - background-color: #F3F8F9; -} -.edit-menu-list li.title{ - font-weight: 700; - height: 40px; - line-height: 40px; -} -.edit-menu-list li.child{ - padding-top: 3px; -} -.edit-menu-list li span{ - float: left; - overflow: hidden; - margin-right: 5px; -} -.edit-menu-list li span input{ - border:1px solid #666; - height: 20px; - line-height: 20px; - padding: 0 2px; - font-family: "微软雅黑"; -} -.edit-menu-list li.hover span input{ - background-color: #F3F8F9; -} -.edit-menu-list span.num{ - width: 55px; - text-align: right; -} -.edit-menu-list span.num input{ - width: 45px; -} -.edit-menu-list span.sort{ - width: 55px; -} -.edit-menu-list span.sort input{ - width: 45px; -} -.edit-menu-list span.name{ - width: 120px; -} -.edit-menu-list span.name input{ - width: 110px; -} -.edit-menu-list span.title{ - width: 210px; -} -.edit-menu-list span.title input{ - width: 200px; -} -.edit-menu-list span.save a{ - display: none; -} -.edit-menu-list .hover span.save a{ - display: block; -} - -/* 搜索高亮 */ -.ThinkHighlight{ - background-color: #FF3; -} - - - - -/* 内容样式 */ -.book-content a{ - color: #459C01; - border-bottom: 1px dotted #459C01; -} - -.book-content ul{ - margin: 0; - padding: 0; -} -.book-content ul li{ - margin: 0; - padding: 0 0 0 20px; - background: url(../images/point.png) no-repeat 6px 13px; -} -.book-content h3,.book-content h4{ - color: #487858; - font-size: 18px; - font-weight: 300; -} -.book-content h4 { - color: #000; -} -.book-content .tips{ - font-weight: 700; - color: #F60; - border: 1px solid #CCC; - padding: 0 10px; -} -.book-content .warning{ - border: 1px solid #CCC; - padding: 5px 10px 5px 30px; - background: url(../images/w.png) #FAFAFA no-repeat 5px 10px ; -} -.book-content .cli{ - background:#2d2d2d; - border:1px solid silver; - padding:3px 20px; - color:#f5f5f5; -} \ No newline at end of file diff --git a/manual/public/css/prettify.css b/manual/public/css/prettify.css deleted file mode 100644 index 3b20a7f..0000000 --- a/manual/public/css/prettify.css +++ /dev/null @@ -1,47 +0,0 @@ -.pln{color:#000} -@media screen{ - .str{color:#080} - .kwd{color:#008} - .com{color:#800} - .typ{color:#606} - .lit{color:#066} - .pun,.opn,.clo{color:#660} - .tag{color:#008} - .atn{color:#606} - .atv{color:#080} - .dec,.var{color:#606} - .fun{color:red} -} -@media print,projection{ - .str{color:#060} - .kwd{color:#006;font-weight:bold} - .com{color:#600;font-style:italic} - .typ{color:#404;font-weight:bold} - .lit{color:#044} - .pun,.opn,.clo{color:#440} - .tag{color:#006;font-weight:bold} - .atn{color:#404}.atv{color:#060} -} - -ol.linenums{margin: 0 0 0 40px;color:#2BA5D8;white-space: normal; list-style: outside decimal} -li.L0,li.L1,li.L2,li.L3,li.L4,li.L5,li.L6,li.L7,li.L8,li.L9{ - border-left:1px solid #D1D7DC; - padding:0 5px; - line-height:23px; - background-color:#FAFAFA; - text-indent: 0; -} - -code.prettyprint { - position: relative; - border: 0; - border: 1px solid #D1D7DC; - margin-left: 0; - padding: 2px; - font-size: 14px; - display: block; - font-family: "Consolas",\5FAE\8F6F\96C5\9ED1; - margin: 10px 0; - white-space: normal; - word-wrap: break-word; -} diff --git a/manual/public/js/jquery-1.7.1.min.js b/manual/public/js/jquery-1.7.1.min.js deleted file mode 100644 index 979ed08..0000000 --- a/manual/public/js/jquery-1.7.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/manual/public/js/prettify.js b/manual/public/js/prettify.js deleted file mode 100644 index 43b4f15..0000000 --- a/manual/public/js/prettify.js +++ /dev/null @@ -1,1536 +0,0 @@ -// Copyright (C) 2006 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -/** - * @fileoverview - * some functions for browser-side pretty printing of code contained in html. - * - *

- * For a fairly comprehensive set of languages see the - * README - * file that came with this source. At a minimum, the lexer should work on a - * number of languages including C and friends, Java, Python, Bash, SQL, HTML, - * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk - * and a subset of Perl, but, because of commenting conventions, doesn't work on - * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class. - *

- * Usage:

    - *
  1. include this source file in an html page via - * {@code } - *
  2. define style rules. See the example page for examples. - *
  3. mark the {@code
    } and {@code } tags in your source with
    - *    {@code class=prettyprint.}
    - *    You can also use the (html deprecated) {@code } tag, but the pretty
    - *    printer needs to do more substantial DOM manipulations to support that, so
    - *    some css styles may not be preserved.
    - * </ol>
    - * That's it.  I wanted to keep the API as simple as possible, so there's no
    - * need to specify which language the code is in, but if you wish, you can add
    - * another class to the {@code <pre>} or {@code <code>} element to specify the
    - * language, as in {@code <pre class="prettyprint lang-java">}.  Any class that
    - * starts with "lang-" followed by a file extension, specifies the file type.
    - * See the "lang-*.js" files in this directory for code that implements
    - * per-language file handlers.
    - * <p>
    - * Change log:<br>
    - * cbeust, 2006/08/22
    - * <blockquote>
    - *   Java annotations (start with "@") are now captured as literals ("lit")
    - * </blockquote>
    - * @requires console
    - */
    -
    -// JSLint declarations
    -/*global console, document, navigator, setTimeout, window, define */
    -
    -/**
    - * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
    - * UI events.
    - * If set to {@code false}, {@code prettyPrint()} is synchronous.
    - */
    -window['PR_SHOULD_USE_CONTINUATION'] = true;
    -
    -/**
    - * Find all the {@code <pre>} and {@code <code>} tags in the DOM with
    - * {@code class=prettyprint} and prettify them.
    - *
    - * @param {Function?} opt_whenDone if specified, called when the last entry
    - *     has been finished.
    - */
    -var prettyPrintOne;
    -/**
    - * Pretty print a chunk of code.
    - *
    - * @param {string} sourceCodeHtml code as html
    - * @return {string} code as html, but prettier
    - */
    -var prettyPrint;
    -
    -
    -(function () {
    -  var win = window;
    -  // Keyword lists for various languages.
    -  // We use things that coerce to strings to make them compact when minified
    -  // and to defeat aggressive optimizers that fold large string constants.
    -  var FLOW_CONTROL_KEYWORDS = ["break,continue,do,else,for,if,return,while"];
    -  var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," + 
    -      "double,enum,extern,float,goto,int,long,register,short,signed,sizeof," +
    -      "static,struct,switch,typedef,union,unsigned,void,volatile"];
    -  var COMMON_KEYWORDS = [C_KEYWORDS,"catch,class,delete,false,import," +
    -      "new,operator,private,protected,public,this,throw,true,try,typeof"];
    -  var CPP_KEYWORDS = [COMMON_KEYWORDS,"alignof,align_union,asm,axiom,bool," +
    -      "concept,concept_map,const_cast,constexpr,decltype," +
    -      "dynamic_cast,explicit,export,friend,inline,late_check," +
    -      "mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast," +
    -      "template,typeid,typename,using,virtual,where"];
    -  var JAVA_KEYWORDS = [COMMON_KEYWORDS,
    -      "abstract,boolean,byte,extends,final,finally,implements,import," +
    -      "instanceof,null,native,package,strictfp,super,synchronized,throws," +
    -      "transient"];
    -  var CSHARP_KEYWORDS = [JAVA_KEYWORDS,
    -      "as,base,by,checked,decimal,delegate,descending,dynamic,event," +
    -      "fixed,foreach,from,group,implicit,in,interface,internal,into,is,let," +
    -      "lock,object,out,override,orderby,params,partial,readonly,ref,sbyte," +
    -      "sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort," +
    -      "var,virtual,where"];
    -  var COFFEE_KEYWORDS = "all,and,by,catch,class,else,extends,false,finally," +
    -      "for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then," +
    -      "throw,true,try,unless,until,when,while,yes";
    -  var JSCRIPT_KEYWORDS = [COMMON_KEYWORDS,
    -      "debugger,eval,export,function,get,null,set,undefined,var,with," +
    -      "Infinity,NaN"];
    -  var PERL_KEYWORDS = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for," +
    -      "goto,if,import,last,local,my,next,no,our,print,package,redo,require," +
    -      "sub,undef,unless,until,use,wantarray,while,BEGIN,END";
    -  var PYTHON_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "and,as,assert,class,def,del," +
    -      "elif,except,exec,finally,from,global,import,in,is,lambda," +
    -      "nonlocal,not,or,pass,print,raise,try,with,yield," +
    -      "False,True,None"];
    -  var RUBY_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "alias,and,begin,case,class," +
    -      "def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo," +
    -      "rescue,retry,self,super,then,true,undef,unless,until,when,yield," +
    -      "BEGIN,END"];
    -  var SH_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "case,done,elif,esac,eval,fi," +
    -      "function,in,local,set,then,until"];
    -  var ALL_KEYWORDS = [
    -      CPP_KEYWORDS, CSHARP_KEYWORDS, JSCRIPT_KEYWORDS, PERL_KEYWORDS +
    -      PYTHON_KEYWORDS, RUBY_KEYWORDS, SH_KEYWORDS];
    -  var C_TYPES = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;
    -
    -  // token style names.  correspond to css classes
    -  /**
    -   * token style for a string literal
    -   * @const
    -   */
    -  var PR_STRING = 'str';
    -  /**
    -   * token style for a keyword
    -   * @const
    -   */
    -  var PR_KEYWORD = 'kwd';
    -  /**
    -   * token style for a comment
    -   * @const
    -   */
    -  var PR_COMMENT = 'com';
    -  /**
    -   * token style for a type
    -   * @const
    -   */
    -  var PR_TYPE = 'typ';
    -  /**
    -   * token style for a literal value.  e.g. 1, null, true.
    -   * @const
    -   */
    -  var PR_LITERAL = 'lit';
    -  /**
    -   * token style for a punctuation string.
    -   * @const
    -   */
    -  var PR_PUNCTUATION = 'pun';
    -  /**
    -   * token style for plain text.
    -   * @const
    -   */
    -  var PR_PLAIN = 'pln';
    -
    -  /**
    -   * token style for an sgml tag.
    -   * @const
    -   */
    -  var PR_TAG = 'tag';
    -  /**
    -   * token style for a markup declaration such as a DOCTYPE.
    -   * @const
    -   */
    -  var PR_DECLARATION = 'dec';
    -  /**
    -   * token style for embedded source.
    -   * @const
    -   */
    -  var PR_SOURCE = 'src';
    -  /**
    -   * token style for an sgml attribute name.
    -   * @const
    -   */
    -  var PR_ATTRIB_NAME = 'atn';
    -  /**
    -   * token style for an sgml attribute value.
    -   * @const
    -   */
    -  var PR_ATTRIB_VALUE = 'atv';
    -
    -  /**
    -   * A class that indicates a section of markup that is not code, e.g. to allow
    -   * embedding of line numbers within code listings.
    -   * @const
    -   */
    -  var PR_NOCODE = 'nocode';
    -
    -
    -
    -/**
    - * A set of tokens that can precede a regular expression literal in
    - * javascript
    - * http://web.archive.org/web/20070717142515/http://www.mozilla.org/js/language/js20/rationale/syntax.html
    - * has the full list, but I've removed ones that might be problematic when
    - * seen in languages that don't support regular expression literals.
    - *
    - * <p>Specifically, I've removed any keywords that can't precede a regexp
    - * literal in a syntactically legal javascript program, and I've removed the
    - * "in" keyword since it's not a keyword in many languages, and might be used
    - * as a count of inches.
    - *
    - * <p>The link above does not accurately describe EcmaScript rules since
    - * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
    - * very well in practice.
    - *
    - * @private
    - * @const
    - */
    -var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*';
    -
    -// CAVEAT: this does not properly handle the case where a regular
    -// expression immediately follows another since a regular expression may
    -// have flags for case-sensitivity and the like.  Having regexp tokens
    -// adjacent is not valid in any language I'm aware of, so I'm punting.
    -// TODO: maybe style special characters inside a regexp as punctuation.
    -
    -
    -  /**
    -   * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
    -   * matches the union of the sets of strings matched by the input RegExp.
    -   * Since it matches globally, if the input strings have a start-of-input
    -   * anchor (/^.../), it is ignored for the purposes of unioning.
    -   * @param {Array.<RegExp>} regexs non multiline, non-global regexs.
    -   * @return {RegExp} a global regex.
    -   */
    -  function combinePrefixPatterns(regexs) {
    -    var capturedGroupIndex = 0;
    -  
    -    var needToFoldCase = false;
    -    var ignoreCase = false;
    -    for (var i = 0, n = regexs.length; i < n; ++i) {
    -      var regex = regexs[i];
    -      if (regex.ignoreCase) {
    -        ignoreCase = true;
    -      } else if (/[a-z]/i.test(regex.source.replace(
    -                     /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
    -        needToFoldCase = true;
    -        ignoreCase = false;
    -        break;
    -      }
    -    }
    -  
    -    var escapeCharToCodeUnit = {
    -      'b': 8,
    -      't': 9,
    -      'n': 0xa,
    -      'v': 0xb,
    -      'f': 0xc,
    -      'r': 0xd
    -    };
    -  
    -    function decodeEscape(charsetPart) {
    -      var cc0 = charsetPart.charCodeAt(0);
    -      if (cc0 !== 92 /* \\ */) {
    -        return cc0;
    -      }
    -      var c1 = charsetPart.charAt(1);
    -      cc0 = escapeCharToCodeUnit[c1];
    -      if (cc0) {
    -        return cc0;
    -      } else if ('0' <= c1 && c1 <= '7') {
    -        return parseInt(charsetPart.substring(1), 8);
    -      } else if (c1 === 'u' || c1 === 'x') {
    -        return parseInt(charsetPart.substring(2), 16);
    -      } else {
    -        return charsetPart.charCodeAt(1);
    -      }
    -    }
    -  
    -    function encodeEscape(charCode) {
    -      if (charCode < 0x20) {
    -        return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
    -      }
    -      var ch = String.fromCharCode(charCode);
    -      return (ch === '\\' || ch === '-' || ch === ']' || ch === '^')
    -          ? "\\" + ch : ch;
    -    }
    -  
    -    function caseFoldCharset(charSet) {
    -      var charsetParts = charSet.substring(1, charSet.length - 1).match(
    -          new RegExp(
    -              '\\\\u[0-9A-Fa-f]{4}'
    -              + '|\\\\x[0-9A-Fa-f]{2}'
    -              + '|\\\\[0-3][0-7]{0,2}'
    -              + '|\\\\[0-7]{1,2}'
    -              + '|\\\\[\\s\\S]'
    -              + '|-'
    -              + '|[^-\\\\]',
    -              'g'));
    -      var ranges = [];
    -      var inverse = charsetParts[0] === '^';
    -  
    -      var out = ['['];
    -      if (inverse) { out.push('^'); }
    -  
    -      for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
    -        var p = charsetParts[i];
    -        if (/\\[bdsw]/i.test(p)) {  // Don't muck with named groups.
    -          out.push(p);
    -        } else {
    -          var start = decodeEscape(p);
    -          var end;
    -          if (i + 2 < n && '-' === charsetParts[i + 1]) {
    -            end = decodeEscape(charsetParts[i + 2]);
    -            i += 2;
    -          } else {
    -            end = start;
    -          }
    -          ranges.push([start, end]);
    -          // If the range might intersect letters, then expand it.
    -          // This case handling is too simplistic.
    -          // It does not deal with non-latin case folding.
    -          // It works for latin source code identifiers though.
    -          if (!(end < 65 || start > 122)) {
    -            if (!(end < 65 || start > 90)) {
    -              ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
    -            }
    -            if (!(end < 97 || start > 122)) {
    -              ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
    -            }
    -          }
    -        }
    -      }
    -  
    -      // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
    -      // -> [[1, 12], [14, 14], [16, 17]]
    -      ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });
    -      var consolidatedRanges = [];
    -      var lastRange = [];
    -      for (var i = 0; i < ranges.length; ++i) {
    -        var range = ranges[i];
    -        if (range[0] <= lastRange[1] + 1) {
    -          lastRange[1] = Math.max(lastRange[1], range[1]);
    -        } else {
    -          consolidatedRanges.push(lastRange = range);
    -        }
    -      }
    -  
    -      for (var i = 0; i < consolidatedRanges.length; ++i) {
    -        var range = consolidatedRanges[i];
    -        out.push(encodeEscape(range[0]));
    -        if (range[1] > range[0]) {
    -          if (range[1] + 1 > range[0]) { out.push('-'); }
    -          out.push(encodeEscape(range[1]));
    -        }
    -      }
    -      out.push(']');
    -      return out.join('');
    -    }
    -  
    -    function allowAnywhereFoldCaseAndRenumberGroups(regex) {
    -      // Split into character sets, escape sequences, punctuation strings
    -      // like ('(', '(?:', ')', '^'), and runs of characters that do not
    -      // include any of the above.
    -      var parts = regex.source.match(
    -          new RegExp(
    -              '(?:'
    -              + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]'  // a character set
    -              + '|\\\\u[A-Fa-f0-9]{4}'  // a unicode escape
    -              + '|\\\\x[A-Fa-f0-9]{2}'  // a hex escape
    -              + '|\\\\[0-9]+'  // a back-reference or octal escape
    -              + '|\\\\[^ux0-9]'  // other escape sequence
    -              + '|\\(\\?[:!=]'  // start of a non-capturing group
    -              + '|[\\(\\)\\^]'  // start/end of a group, or line start
    -              + '|[^\\x5B\\x5C\\(\\)\\^]+'  // run of other characters
    -              + ')',
    -              'g'));
    -      var n = parts.length;
    -  
    -      // Maps captured group numbers to the number they will occupy in
    -      // the output or to -1 if that has not been determined, or to
    -      // undefined if they need not be capturing in the output.
    -      var capturedGroups = [];
    -  
    -      // Walk over and identify back references to build the capturedGroups
    -      // mapping.
    -      for (var i = 0, groupIndex = 0; i < n; ++i) {
    -        var p = parts[i];
    -        if (p === '(') {
    -          // groups are 1-indexed, so max group index is count of '('
    -          ++groupIndex;
    -        } else if ('\\' === p.charAt(0)) {
    -          var decimalValue = +p.substring(1);
    -          if (decimalValue) {
    -            if (decimalValue <= groupIndex) {
    -              capturedGroups[decimalValue] = -1;
    -            } else {
    -              // Replace with an unambiguous escape sequence so that
    -              // an octal escape sequence does not turn into a backreference
    -              // to a capturing group from an earlier regex.
    -              parts[i] = encodeEscape(decimalValue);
    -            }
    -          }
    -        }
    -      }
    -  
    -      // Renumber groups and reduce capturing groups to non-capturing groups
    -      // where possible.
    -      for (var i = 1; i < capturedGroups.length; ++i) {
    -        if (-1 === capturedGroups[i]) {
    -          capturedGroups[i] = ++capturedGroupIndex;
    -        }
    -      }
    -      for (var i = 0, groupIndex = 0; i < n; ++i) {
    -        var p = parts[i];
    -        if (p === '(') {
    -          ++groupIndex;
    -          if (!capturedGroups[groupIndex]) {
    -            parts[i] = '(?:';
    -          }
    -        } else if ('\\' === p.charAt(0)) {
    -          var decimalValue = +p.substring(1);
    -          if (decimalValue && decimalValue <= groupIndex) {
    -            parts[i] = '\\' + capturedGroups[decimalValue];
    -          }
    -        }
    -      }
    -  
    -      // Remove any prefix anchors so that the output will match anywhere.
    -      // ^^ really does mean an anchored match though.
    -      for (var i = 0; i < n; ++i) {
    -        if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
    -      }
    -  
    -      // Expand letters to groups to handle mixing of case-sensitive and
    -      // case-insensitive patterns if necessary.
    -      if (regex.ignoreCase && needToFoldCase) {
    -        for (var i = 0; i < n; ++i) {
    -          var p = parts[i];
    -          var ch0 = p.charAt(0);
    -          if (p.length >= 2 && ch0 === '[') {
    -            parts[i] = caseFoldCharset(p);
    -          } else if (ch0 !== '\\') {
    -            // TODO: handle letters in numeric escapes.
    -            parts[i] = p.replace(
    -                /[a-zA-Z]/g,
    -                function (ch) {
    -                  var cc = ch.charCodeAt(0);
    -                  return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
    -                });
    -          }
    -        }
    -      }
    -  
    -      return parts.join('');
    -    }
    -  
    -    var rewritten = [];
    -    for (var i = 0, n = regexs.length; i < n; ++i) {
    -      var regex = regexs[i];
    -      if (regex.global || regex.multiline) { throw new Error('' + regex); }
    -      rewritten.push(
    -          '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
    -    }
    -  
    -    return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
    -  }
    -
    -
    -  /**
    -   * Split markup into a string of source code and an array mapping ranges in
    -   * that string to the text nodes in which they appear.
    -   *
    -   * <p>
    -   * The HTML DOM structure:</p>
    -   * <pre>
    -   * (Element   "p"
    -   *   (Element "b"
    -   *     (Text  "print "))       ; #1
    -   *   (Text    "'Hello '")      ; #2
    -   *   (Element "br")            ; #3
    -   *   (Text    "  + 'World';")) ; #4
    -   * </pre>
    -   * <p>
    -   * corresponds to the HTML
    -   * {@code <p><b>print </b>'Hello '<br>  + 'World';</p>}.</p>
    -   *
    -   * <p>
    -   * It will produce the output:</p>
    -   * <pre>
    -   * {
    -   *   sourceCode: "print 'Hello '\n  + 'World';",
    -   *   //                     1          2
    -   *   //           012345678901234 5678901234567
    -   *   spans: [0, #1, 6, #2, 14, #3, 15, #4]
    -   * }
    -   * </pre>
    -   * <p>
    -   * where #1 is a reference to the {@code "print "} text node above, and so
    -   * on for the other text nodes.
    -   * </p>
    -   *
    -   * <p>
    -   * The {@code} spans array is an array of pairs.  Even elements are the start
    -   * indices of substrings, and odd elements are the text nodes (or BR elements)
    -   * that contain the text for those substrings.
    -   * Substrings continue until the next index or the end of the source.
    -   * </p>
    -   *
    -   * @param {Node} node an HTML DOM subtree containing source-code.
    -   * @param {boolean} isPreformatted true if white-space in text nodes should
    -   *    be considered significant.
    -   * @return {Object} source code and the text nodes in which they occur.
    -   */
    -  function extractSourceSpans(node, isPreformatted) {
    -    var nocode = /(?:^|\s)nocode(?:\s|$)/;
    -  
    -    var chunks = [];
    -    var length = 0;
    -    var spans = [];
    -    var k = 0;
    -  
    -    function walk(node) {
    -      switch (node.nodeType) {
    -        case 1:  // Element
    -          if (nocode.test(node.className)) { return; }
    -          for (var child = node.firstChild; child; child = child.nextSibling) {
    -            walk(child);
    -          }
    -          var nodeName = node.nodeName.toLowerCase();
    -          if ('br' === nodeName || 'li' === nodeName) {
    -            chunks[k] = '\n';
    -            spans[k << 1] = length++;
    -            spans[(k++ << 1) | 1] = node;
    -          }
    -          break;
    -        case 3: case 4:  // Text
    -          var text = node.nodeValue;
    -          if (text.length) {
    -            if (!isPreformatted) {
    -              text = text.replace(/[ \t\r\n]+/g, ' ');
    -            } else {
    -              text = text.replace(/\r\n?/g, '\n');  // Normalize newlines.
    -            }
    -            // TODO: handle tabs here?
    -            chunks[k] = text;
    -            spans[k << 1] = length;
    -            length += text.length;
    -            spans[(k++ << 1) | 1] = node;
    -          }
    -          break;
    -      }
    -    }
    -  
    -    walk(node);
    -  
    -    return {
    -      sourceCode: chunks.join('').replace(/\n$/, ''),
    -      spans: spans
    -    };
    -  }
    -
    -
    -  /**
    -   * Apply the given language handler to sourceCode and add the resulting
    -   * decorations to out.
    -   * @param {number} basePos the index of sourceCode within the chunk of source
    -   *    whose decorations are already present on out.
    -   */
    -  function appendDecorations(basePos, sourceCode, langHandler, out) {
    -    if (!sourceCode) { return; }
    -    var job = {
    -      sourceCode: sourceCode,
    -      basePos: basePos
    -    };
    -    langHandler(job);
    -    out.push.apply(out, job.decorations);
    -  }
    -
    -  var notWs = /\S/;
    -
    -  /**
    -   * Given an element, if it contains only one child element and any text nodes
    -   * it contains contain only space characters, return the sole child element.
    -   * Otherwise returns undefined.
    -   * <p>
    -   * This is meant to return the CODE element in {@code <pre><code ...>} when
    -   * there is a single child element that contains all the non-space textual
    -   * content, but not to return anything where there are multiple child elements
    -   * as in {@code <pre><code>...</code><code>...</code></pre>} or when there
    -   * is textual content.
    -   */
    -  function childContentWrapper(element) {
    -    var wrapper = undefined;
    -    for (var c = element.firstChild; c; c = c.nextSibling) {
    -      var type = c.nodeType;
    -      wrapper = (type === 1)  // Element Node
    -          ? (wrapper ? element : c)
    -          : (type === 3)  // Text Node
    -          ? (notWs.test(c.nodeValue) ? element : wrapper)
    -          : wrapper;
    -    }
    -    return wrapper === element ? undefined : wrapper;
    -  }
    -
    -  /** Given triples of [style, pattern, context] returns a lexing function,
    -    * The lexing function interprets the patterns to find token boundaries and
    -    * returns a decoration list of the form
    -    * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
    -    * where index_n is an index into the sourceCode, and style_n is a style
    -    * constant like PR_PLAIN.  index_n-1 <= index_n, and style_n-1 applies to
    -    * all characters in sourceCode[index_n-1:index_n].
    -    *
    -    * The stylePatterns is a list whose elements have the form
    -    * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
    -    *
    -    * Style is a style constant like PR_PLAIN, or can be a string of the
    -    * form 'lang-FOO', where FOO is a language extension describing the
    -    * language of the portion of the token in $1 after pattern executes.
    -    * E.g., if style is 'lang-lisp', and group 1 contains the text
    -    * '(hello (world))', then that portion of the token will be passed to the
    -    * registered lisp handler for formatting.
    -    * The text before and after group 1 will be restyled using this decorator
    -    * so decorators should take care that this doesn't result in infinite
    -    * recursion.  For example, the HTML lexer rule for SCRIPT elements looks
    -    * something like ['lang-js', /<[s]cript>(.+?)<\/script>/].  This may match
    -    * '<script>foo()<\/script>', which would cause the current decorator to
    -    * be called with '<script>' which would not match the same rule since
    -    * group 1 must not be empty, so it would be instead styled as PR_TAG by
    -    * the generic tag rule.  The handler registered for the 'js' extension would
    -    * then be called with 'foo()', and finally, the current decorator would
    -    * be called with '<\/script>' which would not match the original rule and
    -    * so the generic tag rule would identify it as a tag.
    -    *
    -    * Pattern must only match prefixes, and if it matches a prefix, then that
    -    * match is considered a token with the same style.
    -    *
    -    * Context is applied to the last non-whitespace, non-comment token
    -    * recognized.
    -    *
    -    * Shortcut is an optional string of characters, any of which, if the first
    -    * character, gurantee that this pattern and only this pattern matches.
    -    *
    -    * @param {Array} shortcutStylePatterns patterns that always start with
    -    *   a known character.  Must have a shortcut string.
    -    * @param {Array} fallthroughStylePatterns patterns that will be tried in
    -    *   order if the shortcut ones fail.  May have shortcuts.
    -    *
    -    * @return {function (Object)} a
    -    *   function that takes source code and returns a list of decorations.
    -    */
    -  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
    -    var shortcuts = {};
    -    var tokenizer;
    -    (function () {
    -      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
    -      var allRegexs = [];
    -      var regexKeys = {};
    -      for (var i = 0, n = allPatterns.length; i < n; ++i) {
    -        var patternParts = allPatterns[i];
    -        var shortcutChars = patternParts[3];
    -        if (shortcutChars) {
    -          for (var c = shortcutChars.length; --c >= 0;) {
    -            shortcuts[shortcutChars.charAt(c)] = patternParts;
    -          }
    -        }
    -        var regex = patternParts[1];
    -        var k = '' + regex;
    -        if (!regexKeys.hasOwnProperty(k)) {
    -          allRegexs.push(regex);
    -          regexKeys[k] = null;
    -        }
    -      }
    -      allRegexs.push(/[\0-\uffff]/);
    -      tokenizer = combinePrefixPatterns(allRegexs);
    -    })();
    -
    -    var nPatterns = fallthroughStylePatterns.length;
    -
    -    /**
    -     * Lexes job.sourceCode and produces an output array job.decorations of
    -     * style classes preceded by the position at which they start in
    -     * job.sourceCode in order.
    -     *
    -     * @param {Object} job an object like <pre>{
    -     *    sourceCode: {string} sourceText plain text,
    -     *    basePos: {int} position of job.sourceCode in the larger chunk of
    -     *        sourceCode.
    -     * }</pre>
    -     */
    -    var decorate = function (job) {
    -      var sourceCode = job.sourceCode, basePos = job.basePos;
    -      /** Even entries are positions in source in ascending order.  Odd enties
    -        * are style markers (e.g., PR_COMMENT) that run from that position until
    -        * the end.
    -        * @type {Array.<number|string>}
    -        */
    -      var decorations = [basePos, PR_PLAIN];
    -      var pos = 0;  // index into sourceCode
    -      var tokens = sourceCode.match(tokenizer) || [];
    -      var styleCache = {};
    -
    -      for (var ti = 0, nTokens = tokens.length; ti < nTokens; ++ti) {
    -        var token = tokens[ti];
    -        var style = styleCache[token];
    -        var match = void 0;
    -
    -        var isEmbedded;
    -        if (typeof style === 'string') {
    -          isEmbedded = false;
    -        } else {
    -          var patternParts = shortcuts[token.charAt(0)];
    -          if (patternParts) {
    -            match = token.match(patternParts[1]);
    -            style = patternParts[0];
    -          } else {
    -            for (var i = 0; i < nPatterns; ++i) {
    -              patternParts = fallthroughStylePatterns[i];
    -              match = token.match(patternParts[1]);
    -              if (match) {
    -                style = patternParts[0];
    -                break;
    -              }
    -            }
    -
    -            if (!match) {  // make sure that we make progress
    -              style = PR_PLAIN;
    -            }
    -          }
    -
    -          isEmbedded = style.length >= 5 && 'lang-' === style.substring(0, 5);
    -          if (isEmbedded && !(match && typeof match[1] === 'string')) {
    -            isEmbedded = false;
    -            style = PR_SOURCE;
    -          }
    -
    -          if (!isEmbedded) { styleCache[token] = style; }
    -        }
    -
    -        var tokenStart = pos;
    -        pos += token.length;
    -
    -        if (!isEmbedded) {
    -          decorations.push(basePos + tokenStart, style);
    -        } else {  // Treat group 1 as an embedded block of source code.
    -          var embeddedSource = match[1];
    -          var embeddedSourceStart = token.indexOf(embeddedSource);
    -          var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;
    -          if (match[2]) {
    -            // If embeddedSource can be blank, then it would match at the
    -            // beginning which would cause us to infinitely recurse on the
    -            // entire token, so we catch the right context in match[2].
    -            embeddedSourceEnd = token.length - match[2].length;
    -            embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;
    -          }
    -          var lang = style.substring(5);
    -          // Decorate the left of the embedded source
    -          appendDecorations(
    -              basePos + tokenStart,
    -              token.substring(0, embeddedSourceStart),
    -              decorate, decorations);
    -          // Decorate the embedded source
    -          appendDecorations(
    -              basePos + tokenStart + embeddedSourceStart,
    -              embeddedSource,
    -              langHandlerForExtension(lang, embeddedSource),
    -              decorations);
    -          // Decorate the right of the embedded section
    -          appendDecorations(
    -              basePos + tokenStart + embeddedSourceEnd,
    -              token.substring(embeddedSourceEnd),
    -              decorate, decorations);
    -        }
    -      }
    -      job.decorations = decorations;
    -    };
    -    return decorate;
    -  }
    -
    -  /** returns a function that produces a list of decorations from source text.
    -    *
    -    * This code treats ", ', and ` as string delimiters, and \ as a string
    -    * escape.  It does not recognize perl's qq() style strings.
    -    * It has no special handling for double delimiter escapes as in basic, or
    -    * the tripled delimiters used in python, but should work on those regardless
    -    * although in those cases a single string literal may be broken up into
    -    * multiple adjacent string literals.
    -    *
    -    * It recognizes C, C++, and shell style comments.
    -    *
    -    * @param {Object} options a set of optional parameters.
    -    * @return {function (Object)} a function that examines the source code
    -    *     in the input job and builds the decoration list.
    -    */
    -  function sourceDecorator(options) {
    -    var shortcutStylePatterns = [], fallthroughStylePatterns = [];
    -    if (options['tripleQuotedStrings']) {
    -      // '''multi-line-string''', 'single-line-string', and double-quoted
    -      shortcutStylePatterns.push(
    -          [PR_STRING,  /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
    -           null, '\'"']);
    -    } else if (options['multiLineStrings']) {
    -      // 'multi-line-string', "multi-line-string"
    -      shortcutStylePatterns.push(
    -          [PR_STRING,  /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
    -           null, '\'"`']);
    -    } else {
    -      // 'single-line-string', "single-line-string"
    -      shortcutStylePatterns.push(
    -          [PR_STRING,
    -           /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
    -           null, '"\'']);
    -    }
    -    if (options['verbatimStrings']) {
    -      // verbatim-string-literal production from the C# grammar.  See issue 93.
    -      fallthroughStylePatterns.push(
    -          [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
    -    }
    -    var hc = options['hashComments'];
    -    if (hc) {
    -      if (options['cStyleComments']) {
    -        if (hc > 1) {  // multiline hash comments
    -          shortcutStylePatterns.push(
    -              [PR_COMMENT, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, '#']);
    -        } else {
    -          // Stop C preprocessor declarations at an unclosed open comment
    -          shortcutStylePatterns.push(
    -              [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,
    -               null, '#']);
    -        }
    -        // #include <stdio.h>
    -        fallthroughStylePatterns.push(
    -            [PR_STRING,
    -             /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,
    -             null]);
    -      } else {
    -        shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
    -      }
    -    }
    -    if (options['cStyleComments']) {
    -      fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);
    -      fallthroughStylePatterns.push(
    -          [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
    -    }
    -    if (options['regexLiterals']) {
    -      /**
    -       * @const
    -       */
    -      var REGEX_LITERAL = (
    -          // A regular expression literal starts with a slash that is
    -          // not followed by * or / so that it is not confused with
    -          // comments.
    -          '/(?=[^/*])'
    -          // and then contains any number of raw characters,
    -          + '(?:[^/\\x5B\\x5C]'
    -          // escape sequences (\x5C),
    -          +    '|\\x5C[\\s\\S]'
    -          // or non-nesting character sets (\x5B\x5D);
    -          +    '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+'
    -          // finally closed by a /.
    -          + '/');
    -      fallthroughStylePatterns.push(
    -          ['lang-regex',
    -           new RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')
    -           ]);
    -    }
    -
    -    var types = options['types'];
    -    if (types) {
    -      fallthroughStylePatterns.push([PR_TYPE, types]);
    -    }
    -
    -    var keywords = ("" + options['keywords']).replace(/^ | $/g, '');
    -    if (keywords.length) {
    -      fallthroughStylePatterns.push(
    -          [PR_KEYWORD,
    -           new RegExp('^(?:' + keywords.replace(/[\s,]+/g, '|') + ')\\b'),
    -           null]);
    -    }
    -
    -    shortcutStylePatterns.push([PR_PLAIN,       /^\s+/, null, ' \r\n\t\xA0']);
    -    fallthroughStylePatterns.push(
    -        // TODO(mikesamuel): recognize non-latin letters and numerals in idents
    -        [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],
    -        [PR_TYPE,        /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null],
    -        [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
    -        [PR_LITERAL,
    -         new RegExp(
    -             '^(?:'
    -             // A hex number
    -             + '0x[a-f0-9]+'
    -             // or an octal or decimal number,
    -             + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
    -             // possibly in scientific notation
    -             + '(?:e[+\\-]?\\d+)?'
    -             + ')'
    -             // with an optional modifier like UL for unsigned long
    -             + '[a-z]*', 'i'),
    -         null, '0123456789'],
    -        // Don't treat escaped quotes in bash as starting strings.  See issue 144.
    -        [PR_PLAIN,       /^\\[\s\S]?/, null],
    -        [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#\\]*/, null]);
    -
    -    return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
    -  }
    -
    -  var decorateSource = sourceDecorator({
    -        'keywords': ALL_KEYWORDS,
    -        'hashComments': true,
    -        'cStyleComments': true,
    -        'multiLineStrings': true,
    -        'regexLiterals': true
    -      });
    -
    -  /**
    -   * Given a DOM subtree, wraps it in a list, and puts each line into its own
    -   * list item.
    -   *
    -   * @param {Node} node modified in place.  Its content is pulled into an
    -   *     HTMLOListElement, and each line is moved into a separate list item.
    -   *     This requires cloning elements, so the input might not have unique
    -   *     IDs after numbering.
    -   * @param {boolean} isPreformatted true iff white-space in text nodes should
    -   *     be treated as significant.
    -   */
    -  function numberLines(node, opt_startLineNum, isPreformatted) {
    -    var nocode = /(?:^|\s)nocode(?:\s|$)/;
    -    var lineBreak = /\r\n?|\n/;
    -  
    -    var document = node.ownerDocument;
    -  
    -    var li = document.createElement('li');
    -    while (node.firstChild) {
    -      li.appendChild(node.firstChild);
    -    }
    -    // An array of lines.  We split below, so this is initialized to one
    -    // un-split line.
    -    var listItems = [li];
    -  
    -    function walk(node) {
    -      switch (node.nodeType) {
    -        case 1:  // Element
    -          if (nocode.test(node.className)) { break; }
    -          if ('br' === node.nodeName.toLowerCase()) {
    -            breakAfter(node);
    -            // Discard the <BR> since it is now flush against a </LI>.
    -            if (node.parentNode) {
    -              node.parentNode.removeChild(node);
    -            }
    -          } else {
    -            for (var child = node.firstChild; child; child = child.nextSibling) {
    -              walk(child);
    -            }
    -          }
    -          break;
    -        case 3: case 4:  // Text
    -          if (isPreformatted) {
    -            var text = node.nodeValue;
    -            var match = text.match(lineBreak);
    -            if (match) {
    -              var firstLine = text.substring(0, match.index);
    -              node.nodeValue = firstLine;
    -              var tail = text.substring(match.index + match[0].length);
    -              if (tail) {
    -                var parent = node.parentNode;
    -                parent.insertBefore(
    -                    document.createTextNode(tail), node.nextSibling);
    -              }
    -              breakAfter(node);
    -              if (!firstLine) {
    -                // Don't leave blank text nodes in the DOM.
    -                node.parentNode.removeChild(node);
    -              }
    -            }
    -          }
    -          break;
    -      }
    -    }
    -  
    -    // Split a line after the given node.
    -    function breakAfter(lineEndNode) {
    -      // If there's nothing to the right, then we can skip ending the line
    -      // here, and move root-wards since splitting just before an end-tag
    -      // would require us to create a bunch of empty copies.
    -      while (!lineEndNode.nextSibling) {
    -        lineEndNode = lineEndNode.parentNode;
    -        if (!lineEndNode) { return; }
    -      }
    -  
    -      function breakLeftOf(limit, copy) {
    -        // Clone shallowly if this node needs to be on both sides of the break.
    -        var rightSide = copy ? limit.cloneNode(false) : limit;
    -        var parent = limit.parentNode;
    -        if (parent) {
    -          // We clone the parent chain.
    -          // This helps us resurrect important styling elements that cross lines.
    -          // E.g. in <i>Foo<br>Bar</i>
    -          // should be rewritten to <li><i>Foo</i></li><li><i>Bar</i></li>.
    -          var parentClone = breakLeftOf(parent, 1);
    -          // Move the clone and everything to the right of the original
    -          // onto the cloned parent.
    -          var next = limit.nextSibling;
    -          parentClone.appendChild(rightSide);
    -          for (var sibling = next; sibling; sibling = next) {
    -            next = sibling.nextSibling;
    -            parentClone.appendChild(sibling);
    -          }
    -        }
    -        return rightSide;
    -      }
    -  
    -      var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0);
    -  
    -      // Walk the parent chain until we reach an unattached LI.
    -      for (var parent;
    -           // Check nodeType since IE invents document fragments.
    -           (parent = copiedListItem.parentNode) && parent.nodeType === 1;) {
    -        copiedListItem = parent;
    -      }
    -      // Put it on the list of lines for later processing.
    -      listItems.push(copiedListItem);
    -    }
    -  
    -    // Split lines while there are lines left to split.
    -    for (var i = 0;  // Number of lines that have been split so far.
    -         i < listItems.length;  // length updated by breakAfter calls.
    -         ++i) {
    -      walk(listItems[i]);
    -    }
    -  
    -    // Make sure numeric indices show correctly.
    -    if (opt_startLineNum === (opt_startLineNum|0)) {
    -      listItems[0].setAttribute('value', opt_startLineNum);
    -    }
    -  
    -    var ol = document.createElement('ol');
    -    ol.className = 'linenums';
    -    var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0;
    -    for (var i = 0, n = listItems.length; i < n; ++i) {
    -      li = listItems[i];
    -      // Stick a class on the LIs so that stylesheets can
    -      // color odd/even rows, or any other row pattern that
    -      // is co-prime with 10.
    -      li.className = 'L' + ((i + offset) % 10);
    -      if (!li.firstChild) {
    -        li.appendChild(document.createTextNode('\xA0'));
    -      }
    -      ol.appendChild(li);
    -    }
    -  
    -    node.appendChild(ol);
    -  }
    -
    -  /**
    -   * Breaks {@code job.sourceCode} around style boundaries in
    -   * {@code job.decorations} and modifies {@code job.sourceNode} in place.
    -   * @param {Object} job like <pre>{
    -   *    sourceCode: {string} source as plain text,
    -   *    spans: {Array.<number|Node>} alternating span start indices into source
    -   *       and the text node or element (e.g. {@code <BR>}) corresponding to that
    -   *       span.
    -   *    decorations: {Array.<number|string} an array of style classes preceded
    -   *       by the position at which they start in job.sourceCode in order
    -   * }</pre>
    -   * @private
    -   */
    -  function recombineTagsAndDecorations(job) {
    -    var isIE8OrEarlier = /\bMSIE\s(\d+)/.exec(navigator.userAgent);
    -    isIE8OrEarlier = isIE8OrEarlier && +isIE8OrEarlier[1] <= 8;
    -    var newlineRe = /\n/g;
    -  
    -    var source = job.sourceCode;
    -    var sourceLength = source.length;
    -    // Index into source after the last code-unit recombined.
    -    var sourceIndex = 0;
    -  
    -    var spans = job.spans;
    -    var nSpans = spans.length;
    -    // Index into spans after the last span which ends at or before sourceIndex.
    -    var spanIndex = 0;
    -  
    -    var decorations = job.decorations;
    -    var nDecorations = decorations.length;
    -    // Index into decorations after the last decoration which ends at or before
    -    // sourceIndex.
    -    var decorationIndex = 0;
    -  
    -    // Remove all zero-length decorations.
    -    decorations[nDecorations] = sourceLength;
    -    var decPos, i;
    -    for (i = decPos = 0; i < nDecorations;) {
    -      if (decorations[i] !== decorations[i + 2]) {
    -        decorations[decPos++] = decorations[i++];
    -        decorations[decPos++] = decorations[i++];
    -      } else {
    -        i += 2;
    -      }
    -    }
    -    nDecorations = decPos;
    -  
    -    // Simplify decorations.
    -    for (i = decPos = 0; i < nDecorations;) {
    -      var startPos = decorations[i];
    -      // Conflate all adjacent decorations that use the same style.
    -      var startDec = decorations[i + 1];
    -      var end = i + 2;
    -      while (end + 2 <= nDecorations && decorations[end + 1] === startDec) {
    -        end += 2;
    -      }
    -      decorations[decPos++] = startPos;
    -      decorations[decPos++] = startDec;
    -      i = end;
    -    }
    -  
    -    nDecorations = decorations.length = decPos;
    -  
    -    var sourceNode = job.sourceNode;
    -    var oldDisplay;
    -    if (sourceNode) {
    -      oldDisplay = sourceNode.style.display;
    -      sourceNode.style.display = 'none';
    -    }
    -    try {
    -      var decoration = null;
    -      while (spanIndex < nSpans) {
    -        var spanStart = spans[spanIndex];
    -        var spanEnd = spans[spanIndex + 2] || sourceLength;
    -  
    -        var decEnd = decorations[decorationIndex + 2] || sourceLength;
    -  
    -        var end = Math.min(spanEnd, decEnd);
    -  
    -        var textNode = spans[spanIndex + 1];
    -        var styledText;
    -        if (textNode.nodeType !== 1  // Don't muck with <BR>s or <LI>s
    -            // Don't introduce spans around empty text nodes.
    -            && (styledText = source.substring(sourceIndex, end))) {
    -          // This may seem bizarre, and it is.  Emitting LF on IE causes the
    -          // code to display with spaces instead of line breaks.
    -          // Emitting Windows standard issue linebreaks (CRLF) causes a blank
    -          // space to appear at the beginning of every line but the first.
    -          // Emitting an old Mac OS 9 line separator makes everything spiffy.
    -          if (isIE8OrEarlier) {
    -            styledText = styledText.replace(newlineRe, '\r');
    -          }
    -          textNode.nodeValue = styledText;
    -          var document = textNode.ownerDocument;
    -          var span = document.createElement('span');
    -          span.className = decorations[decorationIndex + 1];
    -          var parentNode = textNode.parentNode;
    -          parentNode.replaceChild(span, textNode);
    -          span.appendChild(textNode);
    -          if (sourceIndex < spanEnd) {  // Split off a text node.
    -            spans[spanIndex + 1] = textNode
    -                // TODO: Possibly optimize by using '' if there's no flicker.
    -                = document.createTextNode(source.substring(end, spanEnd));
    -            parentNode.insertBefore(textNode, span.nextSibling);
    -          }
    -        }
    -  
    -        sourceIndex = end;
    -  
    -        if (sourceIndex >= spanEnd) {
    -          spanIndex += 2;
    -        }
    -        if (sourceIndex >= decEnd) {
    -          decorationIndex += 2;
    -        }
    -      }
    -    } finally {
    -      if (sourceNode) {
    -        sourceNode.style.display = oldDisplay;
    -      }
    -    }
    -  }
    -
    -
    -  /** Maps language-specific file extensions to handlers. */
    -  var langHandlerRegistry = {};
    -  /** Register a language handler for the given file extensions.
    -    * @param {function (Object)} handler a function from source code to a list
    -    *      of decorations.  Takes a single argument job which describes the
    -    *      state of the computation.   The single parameter has the form
    -    *      {@code {
    -    *        sourceCode: {string} as plain text.
    -    *        decorations: {Array.<number|string>} an array of style classes
    -    *                     preceded by the position at which they start in
    -    *                     job.sourceCode in order.
    -    *                     The language handler should assigned this field.
    -    *        basePos: {int} the position of source in the larger source chunk.
    -    *                 All positions in the output decorations array are relative
    -    *                 to the larger source chunk.
    -    *      } }
    -    * @param {Array.<string>} fileExtensions
    -    */
    -  function registerLangHandler(handler, fileExtensions) {
    -    for (var i = fileExtensions.length; --i >= 0;) {
    -      var ext = fileExtensions[i];
    -      if (!langHandlerRegistry.hasOwnProperty(ext)) {
    -        langHandlerRegistry[ext] = handler;
    -      } else if (win['console']) {
    -        console['warn']('cannot override language handler %s', ext);
    -      }
    -    }
    -  }
    -  function langHandlerForExtension(extension, source) {
    -    if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
    -      // Treat it as markup if the first non whitespace character is a < and
    -      // the last non-whitespace character is a >.
    -      extension = /^\s*</.test(source)
    -          ? 'default-markup'
    -          : 'default-code';
    -    }
    -    return langHandlerRegistry[extension];
    -  }
    -  registerLangHandler(decorateSource, ['default-code']);
    -  registerLangHandler(
    -      createSimpleLexer(
    -          [],
    -          [
    -           [PR_PLAIN,       /^[^<?]+/],
    -           [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],
    -           [PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],
    -           // Unescaped content in an unknown language
    -           ['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],
    -           ['lang-',        /^<%([\s\S]+?)(?:%>|$)/],
    -           [PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],
    -           ['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
    -           // Unescaped content in javascript.  (Or possibly vbscript).
    -           ['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
    -           // Contains unescaped stylesheet content
    -           ['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
    -           ['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]
    -          ]),
    -      ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);
    -  registerLangHandler(
    -      createSimpleLexer(
    -          [
    -           [PR_PLAIN,        /^[\s]+/, null, ' \t\r\n'],
    -           [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']
    -           ],
    -          [
    -           [PR_TAG,          /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
    -           [PR_ATTRIB_NAME,  /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
    -           ['lang-uq.val',   /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
    -           [PR_PUNCTUATION,  /^[=<>\/]+/],
    -           ['lang-js',       /^on\w+\s*=\s*\"([^\"]+)\"/i],
    -           ['lang-js',       /^on\w+\s*=\s*\'([^\']+)\'/i],
    -           ['lang-js',       /^on\w+\s*=\s*([^\"\'>\s]+)/i],
    -           ['lang-css',      /^style\s*=\s*\"([^\"]+)\"/i],
    -           ['lang-css',      /^style\s*=\s*\'([^\']+)\'/i],
    -           ['lang-css',      /^style\s*=\s*([^\"\'>\s]+)/i]
    -           ]),
    -      ['in.tag']);
    -  registerLangHandler(
    -      createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': CPP_KEYWORDS,
    -          'hashComments': true,
    -          'cStyleComments': true,
    -          'types': C_TYPES
    -        }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': 'null,true,false'
    -        }), ['json']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': CSHARP_KEYWORDS,
    -          'hashComments': true,
    -          'cStyleComments': true,
    -          'verbatimStrings': true,
    -          'types': C_TYPES
    -        }), ['cs']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': JAVA_KEYWORDS,
    -          'cStyleComments': true
    -        }), ['java']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': SH_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true
    -        }), ['bsh', 'csh', 'sh']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': PYTHON_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true,
    -          'tripleQuotedStrings': true
    -        }), ['cv', 'py']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': PERL_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true,
    -          'regexLiterals': true
    -        }), ['perl', 'pl', 'pm']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': RUBY_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true,
    -          'regexLiterals': true
    -        }), ['rb']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': JSCRIPT_KEYWORDS,
    -          'cStyleComments': true,
    -          'regexLiterals': true
    -        }), ['js']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': COFFEE_KEYWORDS,
    -          'hashComments': 3,  // ### style block comments
    -          'cStyleComments': true,
    -          'multilineStrings': true,
    -          'tripleQuotedStrings': true,
    -          'regexLiterals': true
    -        }), ['coffee']);
    -  registerLangHandler(
    -      createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
    -
    -  function applyDecorator(job) {
    -    var opt_langExtension = job.langExtension;
    -
    -    try {
    -      // Extract tags, and convert the source code to plain text.
    -      var sourceAndSpans = extractSourceSpans(job.sourceNode, job.pre);
    -      /** Plain text. @type {string} */
    -      var source = sourceAndSpans.sourceCode;
    -      job.sourceCode = source;
    -      job.spans = sourceAndSpans.spans;
    -      job.basePos = 0;
    -
    -      // Apply the appropriate language handler
    -      langHandlerForExtension(opt_langExtension, source)(job);
    -
    -      // Integrate the decorations and tags back into the source code,
    -      // modifying the sourceNode in place.
    -      recombineTagsAndDecorations(job);
    -    } catch (e) {
    -      if (win['console']) {
    -        console['log'](e && e['stack'] ? e['stack'] : e);
    -      }
    -    }
    -  }
    -
    -  /**
    -   * @param sourceCodeHtml {string} The HTML to pretty print.
    -   * @param opt_langExtension {string} The language name to use.
    -   *     Typically, a filename extension like 'cpp' or 'java'.
    -   * @param opt_numberLines {number|boolean} True to number lines,
    -   *     or the 1-indexed number of the first line in sourceCodeHtml.
    -   */
    -  function prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) {
    -    var container = document.createElement('pre');
    -    // This could cause images to load and onload listeners to fire.
    -    // E.g. <img onerror="alert(1337)" src="nosuchimage.png">.
    -    // We assume that the inner HTML is from a trusted source.
    -    container.innerHTML = sourceCodeHtml;
    -    if (opt_numberLines) {
    -      numberLines(container, opt_numberLines, true);
    -    }
    -
    -    var job = {
    -      langExtension: opt_langExtension,
    -      numberLines: opt_numberLines,
    -      sourceNode: container,
    -      pre: 1
    -    };
    -    applyDecorator(job);
    -    return container.innerHTML;
    -  }
    -
    -  function prettyPrint(opt_whenDone) {
    -    function byTagName(tn) { return document.getElementsByTagName(tn); }
    -    // fetch a list of nodes to rewrite
    -    var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
    -    var elements = [];
    -    for (var i = 0; i < codeSegments.length; ++i) {
    -      for (var j = 0, n = codeSegments[i].length; j < n; ++j) {
    -        elements.push(codeSegments[i][j]);
    -      }
    -    }
    -    codeSegments = null;
    -
    -    var clock = Date;
    -    if (!clock['now']) {
    -      clock = { 'now': function () { return +(new Date); } };
    -    }
    -
    -    // The loop is broken into a series of continuations to make sure that we
    -    // don't make the browser unresponsive when rewriting a large page.
    -    var k = 0;
    -    var prettyPrintingJob;
    -
    -    var langExtensionRe = /\blang(?:uage)?-([\w.]+)(?!\S)/;
    -    var prettyPrintRe = /\bprettyprint\b/;
    -    var prettyPrintedRe = /\bprettyprinted\b/;
    -    var preformattedTagNameRe = /pre|xmp/i;
    -    var codeRe = /^code$/i;
    -    var preCodeXmpRe = /^(?:pre|code|xmp)$/i;
    -
    -    function doWork() {
    -      var endTime = (win['PR_SHOULD_USE_CONTINUATION'] ?
    -                     clock['now']() + 250 /* ms */ :
    -                     Infinity);
    -      for (; k < elements.length && clock['now']() < endTime; k++) {
    -        var cs = elements[k];
    -        var className = cs.className;
    -        if (prettyPrintRe.test(className)
    -            // Don't redo this if we've already done it.
    -            // This allows recalling pretty print to just prettyprint elements
    -            // that have been added to the page since last call.
    -            && !prettyPrintedRe.test(className)) {
    -
    -          // make sure this is not nested in an already prettified element
    -          var nested = false;
    -          for (var p = cs.parentNode; p; p = p.parentNode) {
    -            var tn = p.tagName;
    -            if (preCodeXmpRe.test(tn)
    -                && p.className && prettyPrintRe.test(p.className)) {
    -              nested = true;
    -              break;
    -            }
    -          }
    -          if (!nested) {
    -            // Mark done.  If we fail to prettyprint for whatever reason,
    -            // we shouldn't try again.
    -            cs.className += ' prettyprinted';
    -
    -            // If the classes includes a language extensions, use it.
    -            // Language extensions can be specified like
    -            //     <pre class="prettyprint lang-cpp">
    -            // the language extension "cpp" is used to find a language handler
    -            // as passed to PR.registerLangHandler.
    -            // HTML5 recommends that a language be specified using "language-"
    -            // as the prefix instead.  Google Code Prettify supports both.
    -            // http://dev.w3.org/html5/spec-author-view/the-code-element.html
    -            var langExtension = className.match(langExtensionRe);
    -            // Support <pre class="prettyprint"><code class="language-c">
    -            var wrapper;
    -            if (!langExtension && (wrapper = childContentWrapper(cs))
    -                && codeRe.test(wrapper.tagName)) {
    -              langExtension = wrapper.className.match(langExtensionRe);
    -            }
    -
    -            if (langExtension) { langExtension = langExtension[1]; }
    -
    -            var preformatted;
    -            if (preformattedTagNameRe.test(cs.tagName)) {
    -              preformatted = 1;
    -            } else {
    -              var currentStyle = cs['currentStyle'];
    -              var whitespace = (
    -                  currentStyle
    -                  ? currentStyle['whiteSpace']
    -                  : (document.defaultView
    -                     && document.defaultView.getComputedStyle)
    -                  ? document.defaultView.getComputedStyle(cs, null)
    -                  .getPropertyValue('white-space')
    -                  : 0);
    -              preformatted = whitespace
    -                  && 'pre' === whitespace.substring(0, 3);
    -            }
    -
    -            // Look for a class like linenums or linenums:<n> where <n> is the
    -            // 1-indexed number of the first line.
    -            var lineNums = cs.className.match(/\blinenums\b(?::(\d+))?/);
    -            lineNums = lineNums
    -                ? lineNums[1] && lineNums[1].length ? +lineNums[1] : true
    -                : false;
    -            if (lineNums) { numberLines(cs, lineNums, preformatted); }
    -
    -            // do the pretty printing
    -            prettyPrintingJob = {
    -              langExtension: langExtension,
    -              sourceNode: cs,
    -              numberLines: lineNums,
    -              pre: preformatted
    -            };
    -            applyDecorator(prettyPrintingJob);
    -          }
    -        }
    -      }
    -      if (k < elements.length) {
    -        // finish up in a continuation
    -        setTimeout(doWork, 250);
    -      } else if (opt_whenDone) {
    -        opt_whenDone();
    -      }
    -    }
    -
    -    doWork();
    -  }
    -
    -  /**
    -   * Contains functions for creating and registering new language handlers.
    -   * @type {Object}
    -   */
    -  var PR = win['PR'] = {
    -        'createSimpleLexer': createSimpleLexer,
    -        'registerLangHandler': registerLangHandler,
    -        'sourceDecorator': sourceDecorator,
    -        'PR_ATTRIB_NAME': PR_ATTRIB_NAME,
    -        'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,
    -        'PR_COMMENT': PR_COMMENT,
    -        'PR_DECLARATION': PR_DECLARATION,
    -        'PR_KEYWORD': PR_KEYWORD,
    -        'PR_LITERAL': PR_LITERAL,
    -        'PR_NOCODE': PR_NOCODE,
    -        'PR_PLAIN': PR_PLAIN,
    -        'PR_PUNCTUATION': PR_PUNCTUATION,
    -        'PR_SOURCE': PR_SOURCE,
    -        'PR_STRING': PR_STRING,
    -        'PR_TAG': PR_TAG,
    -        'PR_TYPE': PR_TYPE,
    -        'prettyPrintOne': win['prettyPrintOne'] = prettyPrintOne,
    -        'prettyPrint': win['prettyPrint'] = prettyPrint
    -      };
    -
    -  // Make PR available via the Asynchronous Module Definition (AMD) API.
    -  // Per https://github.com/amdjs/amdjs-api/wiki/AMD:
    -  // The Asynchronous Module Definition (AMD) API specifies a
    -  // mechanism for defining modules such that the module and its
    -  // dependencies can be asynchronously loaded.
    -  // ...
    -  // To allow a clear indicator that a global define function (as
    -  // needed for script src browser loading) conforms to the AMD API,
    -  // any global define function SHOULD have a property called "amd"
    -  // whose value is an object. This helps avoid conflict with any
    -  // other existing JavaScript code that could have defined a define()
    -  // function that does not conform to the AMD API.
    -  if (typeof define === "function" && define['amd']) {
    -    define("google-code-prettify", [], function () {
    -      return PR; 
    -    });
    -  }
    -})();
    diff --git a/php.sublime-completions b/php.sublime-completions
    index 98af369..19b8775 100644
    --- a/php.sublime-completions
    +++ b/php.sublime-completions
    @@ -167,7 +167,7 @@
     		{ "trigger": "_ad", "contents": "protected function _after_delete(\\$data,\\$options) {\n   ${1:}\n}$0" },
     		{ "trigger": "_af", "contents": "protected function _after_find(&\\$result,\\$options) {\n  ${1:}\n}$0" },
     		{ "trigger": "_ai", "contents": "protected function _after_insert(\\$data,\\$options) {\n   ${1:}\n}$0" },
    -		{ "trigger": "_as", "contents": "protected function _after_select(&\\$result,\\$options){\n	${1:}\n}$0" },
    +		{ "trigger": "_as", "contents": "protected function _after_select(&\\$result,\\$options){\n	${1:foreach(\\$result as &\\$record)\\{\n		${2:\\$this->_after_find(\\$record,\\$options);}\n	\\}}\n}$0" },
     		{ "trigger": "_au", "contents": "protected function _after_update(\\$data,\\$options) {\n   ${1:}\n}$0" },
     		{ "trigger": "_bi", "contents": "protected function _before_insert(&\\$data,\\$options) {\n ${1:}\n}$0" },
     		{ "trigger": "_bu", "contents": "protected function _before_update(&\\$data,\\$options) {\n ${1:}\n}$0" },
    @@ -193,7 +193,7 @@
     		{ "trigger": "display", "contents": "\\$this->display(${1:})$0" },
     		{ "trigger": "->distinct", "contents": "->distinct('${1:}')$0" },
     		{ "trigger": "dump", "contents": "dump('${1:str}')$0" },
    -		{ "trigger": "error", "contents": "\\$this->error('${1:name}')$0" },
    +		{ "trigger": "error", "contents": "error('${1:name}')$0" },
     		{ "trigger": "->execute", "contents": "->execute(${1:})$0" },
     		{ "trigger": "->fetch", "contents": "->fetch('${1:}')$0" },
     		{ "trigger": "field()", "contents": "field()$0" },
    @@ -246,7 +246,7 @@
     		{ "trigger": "setInc()", "contents": "setInc(\\$${1:field}${2:,\\$step})$0" },
     		{ "trigger": "setProperty()", "contents": "setProperty(${1:name},${2:value})$0" },
     		{ "trigger": "startTrans()", "contents": "startTrans()$0" },
    -		{ "trigger": "success", "contents": "\\$this->success('${1:info}')$0" },
    +		{ "trigger": "success", "contents": "success('${1:info}')$0" },
     		{ "trigger": "sum()", "contents": "sum()$0" },
     		{ "trigger": "switchModel()", "contents": "switchModel(\\$${1:type},\\$${2:var})$0" },
     		{ "trigger": "S", "contents": "S(${1:\\$name}${2:,\\$value}${3:,\\$options})$0" },
    diff --git a/thinkphp_database_queryer b/thinkphp_database_queryer
    index aa7d292..7f3780a 100644
    --- a/thinkphp_database_queryer
    +++ b/thinkphp_database_queryer
    @@ -1,9 +1,4 @@
    -+------------------------thinkphp_database_queryer-----------------------+
     
     ##########################################################################
     
    -here is the sql to be queryed
    -
    -##########################################################################
    -
    -here will show the result
    +result to be display.
    diff --git a/tpl.sublime-completions b/tpl.sublime-completions
    index 062a2a7..2c67847 100644
    --- a/tpl.sublime-completions
    +++ b/tpl.sublime-completions
    @@ -3,18 +3,20 @@
     
     	"completions":
     	[
    -	{ "trigger": "emp", "contents": "<empty name=\"${1:name}\">${2:name为空}<else /> ${3:name不为空}</empty>$0" },
    -	{ "trigger": "eq", "contents": "<eq name=\"${1:name}\" value=\"${2:value}\">$0</eq>" },
    -	{ "trigger": "if", "contents": "<if condition=\"${1:conditon}\">\n		${2:do}\n</if>$0" },
    -	{ "trigger": "inc", "contents": "<include file=\"${1:Public:header}\" />$0" },
    -	{ "trigger": "layout", "contents": "<include file=\"${1:Public:header}\"/>\n{__CONTENT__}\n<include file=\"${2:Public:footer}\"/>$0" },
    -	{ "trigger": "lit", "contents": "<literal>\n	${1:content}\n</literal>$0" },
    -	{ "trigger": "nolayout", "contents": "{__NOLAYOUT__}\n$0" },
    -	{ "trigger": "php", "contents": "<php>${1:echo 'Hello,world!';}</php>$0" },
    -	{ "trigger": "pres", "contents": "<present name=\"${1:name}\">${2:name已经赋值}<else />${3:name还没有赋值}</present>$0" },
    -	{ "trigger": "sw", "contents": "<switch name=\"${1:level}\">\n	<case value=\"${2:1}\">${3:value1}</case>\n	<case value=\"${4:2}\">${5:value2}</case>\n	<default />${6:default}</switch>$0" },
    -	{ "trigger": "vo", "contents": "<volist name=\"${1:list}\" id=\"${2:vo}\">\n	${3:{\\$vo\\}}\n</volist>$0" },
    -	{ "trigger": "|fun", "contents": "{\\$${1:name}|${2:fun}=${3:arg1,###}}$0" },
    -	{ "trigger": "|def", "contents": "{\\$${1:name}|default=\"${2:***}\"}$0" }
    +		{ "trigger": "bl", "contents": "<block name=\"${1:name}\">$0</block>" },
    +		{ "trigger": "emp", "contents": "<empty name=\"${1:name}\">${2:name为空}<else /> ${3:name不为空}</empty>$0" },
    +		{ "trigger": "eq", "contents": "<eq name=\"${1:name}\" value=\"${2:value}\">$0</eq>" },
    +		{ "trigger": "extend", "contents": "<extend name=\"${1:name}\" />$0" },
    +		{ "trigger": "if", "contents": "<if condition=\"${1:conditon}\">\n		${2:do}\n</if>$0" },
    +		{ "trigger": "inc", "contents": "<include file=\"${1:Public:header}\" />$0" },
    +		{ "trigger": "layout", "contents": "<include file=\"${1:Public:header}\"/>\n{__CONTENT__}\n<include file=\"${2:Public:footer}\"/>$0" },
    +		{ "trigger": "lit", "contents": "<literal>\n	${1:content}\n</literal>$0" },
    +		{ "trigger": "nolayout", "contents": "{__NOLAYOUT__}\n$0" },
    +		{ "trigger": "php", "contents": "<php>${1:echo 'Hello,world!';}</php>$0" },
    +		{ "trigger": "pres", "contents": "<present name=\"${1:name}\">${2:name已经赋值}<else />${3:name还没有赋值}</present>$0" },
    +		{ "trigger": "sw", "contents": "<switch name=\"${1:level}\">\n	<case value=\"${2:1}\">${3:value1}</case>\n	<case value=\"${4:2}\">${5:value2}</case>\n	<default />${6:default}</switch>$0" },
    +		{ "trigger": "vo", "contents": "<volist name=\"${1:list}\" id=\"${2:vo}\">\n	${3:{\\$vo\\}}\n</volist>$0" },
    +		{ "trigger": "|fun", "contents": "{\\$${1:name}|${2:fun}=${3:arg1,###}}$0" },
    +		{ "trigger": "|def", "contents": "{\\$${1:name}|default=\"${2:***}\"}$0" }
     	]
     }
    \ No newline at end of file