├── .gitignore ├── LICENSE ├── MANIFEST.in ├── README.md ├── cache ├── config.html ├── construction │ └── youdao │ │ └── head.html ├── css │ ├── entry-min.css │ ├── pad.css │ ├── result-min.css │ └── style_result.css ├── donate.html ├── expand.html ├── google.html ├── goslate.html ├── help.html ├── images │ ├── donate │ │ └── alipay.png │ └── icon │ │ └── icon.jpg ├── js │ ├── autocomplete.r156903.js │ ├── extra.js │ ├── huaci.js │ ├── icibatop.js │ ├── jquery-ui.min.js │ ├── jquery.min.js │ ├── jquery.sidebar.js │ ├── jsScrollbar.js │ ├── jsScroller.js │ ├── jsScrollerTween.js │ └── result-min.js ├── lock.html ├── origin.html ├── result.html ├── unlock.html ├── zh2en.html ├── zh2enlj.html ├── zh2fr.html ├── zh2frlj.html ├── zh2jap.html ├── zh2japlj.html ├── zh2ko.html └── zh2kolj.html ├── desktop └── openyoudao.desktop ├── fusionyoudao.py ├── gl.py ├── goslate.py ├── install-openyoudao.sh ├── openyoudao.py ├── openyoudao.svg ├── scripts └── openyoudao ├── setup.py ├── uninstall-openyoudao.sh └── webshot.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.swp 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE README.md 2 | recursive-include cache * 3 | include desktop/openyoudao.desktop 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # YouDao 2 | 3 | It is a YouDao client for linux. 4 | 5 | Author: justzx2011@gmail.com @justzx 6 | lvzongting@gmail.com @lvzongting 7 | Powered by xdlinux.info 西电开源社区 8 | 9 | 10 | #Dependencies: 11 | python-xlib python-webkit python-lxml python-beautifulsoup xclip inotify-tools curl 12 | #Installation: 13 | 14 | #Archlinux: 15 | yaourt -S openyoudao 16 | 17 | #Ubuntu/debian: 18 | Add mirrorlist: 19 | 20 | deb http://ppa.launchpad.net/justzx2011/openyoudao-v0.4/ubuntu trusty main 21 | 22 | deb-src http://ppa.launchpad.net/justzx2011/openyoudao-v0.4/ubuntu trusty main 23 | 24 | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 14C9B91C3F9493B9 25 | 26 | sudo apt-get update 27 | 28 | sudo apt-get install openyoudao 29 | 30 | #Opensuse: 31 | 32 | http://software.opensuse.org/package/openyoudao 33 | 34 | #Fedora 19/20/21/rawhide 使用以下命令安装: 35 | 36 | yum install dnf-plugins-core 37 | 38 | dnf copr enable mosquito/myrepo 39 | 40 | dnf install openyoudao 41 | 42 | #RHEL/CentOS 7 使用以下命令安装: 43 | 44 | yum-config-manager --add-repo=https://copr.fedoraproject.org/coprs/mosquito/myrepo/repo/epel-7/mosquito-myrepo-epel-7.repo 45 | 46 | yum install epel-release 47 | 48 | yum install openyoudao 49 | 50 | #setup.py: 51 | 52 | git clone https://github.com/justzx2011/openyoudao 53 | 54 | python setup.py build 55 | 56 | sudo python setup.py install 57 | 58 | #其他发行版linux: 59 | #apt-get install python-xlib python-webkit python-lxml python-beautifulsoup xclip inotify-tools curl 60 | 61 | $wget https://github.com/justzx2011/openyoudao/archive/beta0.4.tar.gz 62 | 63 | tar -xvf beta0.4.tar.gz && cd openyoudao-beta0.4 64 | 65 | 安装bin文件,方便程序执行: 66 | 67 | 将bin文件:scripts/openyoudao安装到目录/usr/bin/openyoudao: 68 | 69 | #cp scripts/openyoudao /usr/bin/. 70 | 71 | 设置权限: 72 | 73 | #chmod 755 /usr/bin/openyoudao 74 | 75 | 安装libs文件: 76 | 77 | #mkdir /usr/lib/openyoudao 78 | 79 | #cp ./*.py /usr/lib/openyoudao 80 | 81 | #chmod 644 /usr/lib/openyoudao/*.py 82 | 83 | 安装cache文件: 84 | 85 | #mkdir /var/cache/openyoudao 86 | 87 | #cp -rf cache/* /usr/share/openyoudao/. 88 | 89 | 安装desktop: 90 | 91 | #cp desktop/openyoudao.desktop /usr/share/applications/ 92 | 93 | #chmod 644 /usr/share/applications/openyoudao.desktop 94 | 95 | 哈哈~现在应该看到openyoudao的图标了吧~ 96 | 97 | 点击图标就能运行程序了 98 | 99 | TODO 100 | -------------- 101 | 01 重新设计软件界面 102 | 02 增强与其它程序的兼容性 103 | 03 重新规划目录、打包 104 | 04 重新格式化网页界面 ----- 使用beautiful soup 105 | 05 创建配置页面 106 | 06 去除滚动条,改用js 107 | 07 编写config.html,作为配置页,用作主页,用js 108 | 08 浏览器侧边加方形标签,用于切换 109 | 09 推入软件源 110 | 10 完善项目主页 111 | 11 增加项目日志 112 | 12 打包ppa 113 | 13 打包rpm 114 | 14 增加ocr取词功能 115 | 15 编写QT版本 116 | 16 添加离线取词功能 117 | 17 修改取词模式添加快捷键辅助取词 118 | 18 添加命令行查词功能 119 | 19 编写mac版本 120 | 20 优化项目主页,添加后台线程下载功能,加快访问速度 121 | 21 编程多线程下载代理,提高取词速度 122 | 22 实现程序的可脚本化 123 | 23 改用PyQT4Qt中Webkit 124 | 24 捕捉程序异常,sqlite操作可能会抛出异常,特别是多线程 125 | 25 减少global使用,太多的global 影响程序的健壮性 126 | 26 对DOM操作,借鉴PhantomJS和CasperJS 127 | 27 实现man手册的跳转 128 | 28 以守护进程运行该程序 129 | 29 脚本竞技场 130 | 30 寻找轻量级的取词方案 131 | 31 修复视频播放 132 | DONE 133 | ----- 134 | 2014-8-02 ------- 发布openyoudao v0.4版本 135 | 2014-5-17 ------- 发布openyoudao v0.3版本 136 | 2014-4-16 ------- 发布openyoudao v0.2版本 137 | 2013-9-01 ------- 发布openyoudao beta版本 138 | 2012-8-23 ------- 发布了ppa包 139 | 2012-8-21 ------- 修改了程序设计,将用户配置文件转移到了$HOME/.openyoudao目录下 140 | 2012-8-17 ------- 创建项目邮件列表,辅助项目测试 141 | 2012-8-08 ------- 修复了发音功能 142 | 2012-8-07 ------- 重新编写了使用教程,以兼容各个发行版linux 143 | 2012-8-01 ------- 修正了取词脚本 144 | 2012-7-23 ------- 添加程序运行过程中所需要的临时文件,以解决系统权限问题 145 | 2012-7-22 ------- 修正了desktop存在的bug 146 | 2012-7-21 ------- 考虑到python-requests存在过期依赖问题,改用curl进行网页下载 147 | 2012-7-19 ------- 将程序打包为aur 148 | 2012-7-11 ------- 编写了openyoudao.desktop 149 | 2012-7-10 ------- kokdemo重新设计了项目主页 150 | 2012-7-04 ------- 增加了代理设置 151 | 2012-7-01 ------- 完善了README.md,更新了网页,发布Alpha 152 | 2012-6-30 ------- 增加了程序图标,调整了相对路径,清理了github分支 153 | 2012-6-29 ------- 改进了webshot 154 | 2012-6-26 ------- 修复了icb,解决了css冲突 155 | 2012-6-25 ------- 调整了线程的开启顺序,清空剪切板,清空管道 156 | 2012-6-22 ------- 通过inotify取词 157 | 2012-6-20 ------- 改用lxml加速下载,实现了字典的流畅切换,去除搜索框 158 | 2012-6-18 ------- 加速了页面重构 159 | 2012-6-15 ------- 从localStorage动态载入配置文件 160 | 2012-6-11 ------- 添加了侧边栏,通过localStorage.content存储配置信息 161 | 2012-6-10 ------- 调整了程序目录,添加了程序启动页面 162 | 2012-6-09 ------- 修复链接,解决了超长字符串替换问题,用js重写了滚动条 163 | 2012-6-07 ------- 增加了程序健壮性 164 | 2012-6-06 ------- 对网页进行了简单重构 165 | 2012-6-01 ------- 增加了滚动条 166 | 2012-5-31 ------- 解决了字符串问题,实现了特殊字符的正确提取 167 | 2012-5-30 ------- 解决了权限问题,可以用普通用户运行程序 168 | 2012-5-28 ------- 成功的将界面和程序高度分离 169 | 2012-5-27 ------- 主程序结构设计完成,一般情况下结构不会变更 170 | 2012-5-26 ------- 完成了程序退出机制,全局统一退出标志,为差错控制模块预留了接口 171 | UPDATES 172 | -------------- 173 | 2014-8-02 ------- 增加了取词历史 174 | 2014-7-07 ------- 增加了取词锁定功能 175 | 2014-7-06 ------- 增加了谷歌翻译 176 | 2014-5-16 ------- 增加了汉日互译、汉韩互译、汉法互译 177 | 2014-5-15 ------- 修复了视频例句无法播放的问题 178 | 2014-5-7 ------- 增加了程序启动图标 179 | 2014-4-16 ------- 解决了程序异常中断的bug 180 | 2012-8-23 ------- 发布ppa 181 | 2012-8-17 ------- 创建项目邮件列表,辅助项目测试 182 | 2012-8-08 ------- 修复了发音功能 183 | 2012-7-19 ------- 发布aur包 184 | 2012-7-01 ------- 发布Alpha 185 | 2012-6-10 ------- 增加了侧边栏 186 | 2012-6-9 ------- 增加了滚动条 187 | 2012-6-6 ------- 重构了界面 188 | 2012-6-4 ------- 对网页进行了重构,修改了css,网页交由bainizhao更新维护 189 | 2012-6-1 ------- 增加了滚动条 190 | 2012-5-31 ------- 给项目主页添加了域名,地址:http://openyoudao.org/ 191 | 2012-5-30 ------- 修正了一些Bug,项目可以正常使用,正式命名为openyoudao 192 | 2012-5-28 ------- 完善了项目主页,地址:http://74.117.59.126/,注册了推@openyoudao 193 | 2012-5-27 ------- 整理代码并提交到github 194 | 2012-5-26 ------- 实现了屏幕取词翻译,完善了程序的主框架 195 | RULES 196 | ---- 197 | 1 界面上永远不许有按钮 198 | 2 主程序中既是测试程序,不许有功能模块 199 | 3 所有功能模块保持最大化的独立,尤其是界面和程序不许纠缠 200 | 4 取词模块(xclip)、查词模块(curl)、显示模块(webkit)、聚合模块(beautiful soup) 201 | 202 | 203 | Construction 204 | ---- 205 | 206 | -------------- 207 | | 主程序 | 208 | | def main() | 209 | --------------- 210 | ------------- | --------------- | -------------- | 211 | | | | | 212 | | | | | 213 | --------------- ------------ ------------- --------------- 214 | | 取词 | | 查字 | | 显示 | 配置文件 | 215 | | def gettext()| | def lookup() | | def webshow() | loadconfig() | 216 | --------------- ------------- -------------- ---------------- 217 | -------------------------------------------------------------------------------- /cache/config.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

欢迎使用有道字典 linux版

13 |

所有配置工作通过选词功能完成,找到您想要的选项,然后用鼠标选取右边对应指令即可.

14 |

汉英互译            %zh2en%          汉英例句               %zh2enlj%               返回配置页           %index%

15 |

汉日互译            %zh2jap%         汉日例句               %zh2japlj%               使用说明               %helps%

16 |

汉韩互译            %zh2ko%           汉韩例句               %zh2kolj%               退出程序               %exits%

17 |

  汉法互译            %zh2fr%           汉法例句               %zh2frlj%                 展开选项               %expand%

18 |

19 | 20 | 21 | -------------------------------------------------------------------------------- /cache/construction/youdao/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /cache/css/entry-min.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8";html,body,div,p,form,input{margin:0;padding:0}html,body{height:100%}body{font:12px/1.2 Arial}a{text-decoration:none}a:hover{text-decoration:underline}#w{min-height:100%;height:100%;position:relative}.sp{font-size:0;line-height:0}#t{padding:0 10px 0 0;height:27px;line-height:27px;text-align:right}.ac{position:relative}.ac .ai{font-size:9px}.dm{position:absolute;left:0;top:21px;width:138px;text-align:left;line-height:26px}.dm a{display:block;padding:0 0 0 8px}#l{margin:0 auto;width:399px;height:143px}#nv{width:590px;margin:0 auto;font-size:14px;padding:0 0 0 3px;line-height:16px}#nv strong,#nv a:hover{background:url(http://shared.ydstatic.com/oxo/p/nv_line.gif) bottom center no-repeat}#nv a,#nv strong{display:inline-block;margin:0 1px 0 0;padding:0 13px 9px;text-align:center;line-height:1.2em}#nv a:hover{text-decoration:none}#an{text-align:center}#ft{position:absolute;bottom:0;width:100%;line-height:27px}#cr,#fn{display:inline}#cr{position:absolute;top:0;right:0;margin:0 10px 0 0}#fn{float:left;margin:0 0 0 10px}.nl{padding:0 10px}@charset "utf-8";#t{background:url(../images/pic.gif) no-repeat;background-position:0 -38px;background-repeat:repeat-x;border-bottom:1px solid #ededed}#t a{color:#333}.dm{background-color:#fff;border:1px solid #bfbfc8}.dm a:hover{background:#f7f7f7;text-decoration:none}#l{background:url(../images/logo-entry.png) no-repeat center 0;_background:0;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../../images/logo-entry.png",sizingMethod="crop")}#nv a,#nv a:visited{color:#333}#an a{color:#999}#ft{border-top:1px solid #ededed;color:#999;background-color:#fff}#ft a{color:#999}.nl{color:#ddd}#fm{position:relative;width:592px;margin:3px auto 0;z-index:5}.s-inpt-w,.s-btn-w{background:url(http://shared.ydstatic.com/r/2.0/p/pic.gif) no-repeat}.s-inpt-w{display:inline-block;width:504px;height:37px;background-position:0 -67px;vertical-align:top}#fm .s-inpt{border:0;outline:0;background:transparent;width:461px;font:16px arial;height:25px;height:24px\9;padding:8px 3px 3px 5px;padding:9px 5px 2px\9 3px;position:relative}.s-btn-w{cursor:pointer;display:inline-block;height:36px;width:88px}.s-btn-w:hover{background-position:-176px 0}.s-btn-w:active{background-position:-88px 0}.s-btn{cursor:pointer;height:34px;width:88px;font-size:14px;font-weight:bold;text-align:center;border:0;background:0;position:relative;z-index:1}html{overflow-y:auto}div,ul,ol,li,p,th,td{margin:0;padding:0}table{border-collapse:collapse;border-spacing:0}li{list-style:none}img{border:0}.clear:after{content:'.';display:block;visibility:hidden;height:0;line-height:0;font-size:0;clear:both}.clear{zoom:1}.sg-wrap{position:absolute;top:35px;left:0;z-index:9999;border:1px solid #bfbfc8;width:501px;background-color:#fff;font-size:12px}.sg-wrap .sg-result-list{font-size:14px;color:#000}.sg-wrap .sg-result-list .default_menu_s,.sg-wrap .sg-result-list .default_menu_z{background-color:#f4f4f4}.sg-wrap .sg-result-list .default_menu_z .havesg{background:url(../images/bg_activehavesg.gif) no-repeat}.sg-wrap .sg-result-list li.default_menu_z.default_menu_s{background-color:#f7f7f7}.sg-wrap .sg-result-list .sg-hightlight{color:#c60a00;text-decoration:underline}.sg-wrap .sg-result-list .havesg{position:absolute;right:8px;top:50%;margin:-5px 0 0;width:7px;height:11px;background:url(../images/bg_havesg.gif) no-repeat}.sg-wrap .sg-result-list .sg-from{display:block;color:#007b43;line-height:1.5;font-style:normal}.sg-wrap .sg-result-list li{position:relative;padding:8px 0 8px 8px;cursor:default;_zoom:1}.sob-wrap{width:248px;border-left:1px solid #ededed;position:relative;vertical-align:top;padding:0 0 29px 0}.sob-wrap .sgob-title{font-size:14px;font-weight:bold}.sob-wrap .sgob-title a{color:#000;text-decoration:none}.sob-wrap .sob-close{position:absolute;top:8px;right:8px;width:15px;height:15px;text-indent:-999em;overflow:hidden;background:url(../images/sg_close.gif) no-repeat;cursor:pointer}.sob-wrap .sob{margin:9px 0 0 15px}.sob-wrap .sob .sob-hd{font-weight:bold;font-size:14px;margin:0 0 10px 0}.sob-wrap .sob .sob-hd a{color:#000}.sob-wrap .sob-info{position:absolute;top:50%;margin:-10px 0 0 0;height:20px;width:248px;text-align:center;color:#808080}.sob-ext{position:absolute;bottom:0;line-height:29px;width:248px;background-color:#fbfbfb;text-align:right;font-family:"\5B8B\4F53"}.sob-ext .more-link{color:#808080;text-decoration:none;margin-right:18px}.sob-ext .more-link:hover{text-decoration:underline}body{padding:0;margin:0;font-family:Arial,sans-serif;color:#434343;line-height:24px}#ao{margin-top:30px;margin-bottom:1em}#productList{margin-bottom:80px;font-size:1.2em}#yd{background:transparent url(http://shared.ydstatic.com/r/${StaticVersion}/p/dict-logo.png?${StaticTimeStamp}) repeat scroll 0;_background:0;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src = "http://shared.ydstatic.com/r/${StaticVersion}/p/dict-logo.png?${StaticTimeStamp}",sizingMethod = "crop");height:135px;margin:0 auto;text-indent:-9999em;width:360px}#ts .q{width:265px}.hand-write{background:url(../images/pic.gif) no-repeat -356px 0;display:inline-block;padding-top:16px;height:0;width:16px;overflow:hidden;position:absolute;top:10px;left:476px;cursor:pointer}.hnw_btn_hover{background-position:-375px 0}.hnw_btn_on{background-position:-394px 0}#handWrite{width:348px;height:216px;border:1px solid #bfbfc8}.pm{display:none;position:absolute;z-index:1000;width:70px;border:1px solid #8cbbdd;background:white}#imgAd{width:960px;margin:0 auto;position:relative}#imgAd iframe{position:absolute;bottom:0}.sw{font-size:17px;border:1px solid #bfbfc8}.sw table{background:#fff;border-collapse:collapse}.remindtt75,.jstxlan{padding:3px}.remindtt752{padding:.2em;color:#808080;font-size:.95em}.jstxlan{color:#656565;font-size:12px;cursor:pointer}.jstxhuitiaoyou{background:#f5f5f5;padding:3px;display:none}.aa_highlight{color:#000;background:#f5f5f5} -------------------------------------------------------------------------------- /cache/css/pad.css: -------------------------------------------------------------------------------- 1 | .ua-ios #topImgAd,.ua-ios #ads,.ua-ios #hnwBtn,.ua-ios #imgAd{display:none}.ua-ios .results-content,.ua-ios .rel-search{margin-left:170px}.ua-ios .result_navigator{width:150px}.ua-ios .sub-catalog h3,.ua-ios .sub-catalog li{font:14px/30px normal}.ua-ios .sub-catalog li a{height:30px}.ua-ios .nav-collins .collins-icon{left:100px}.ua-ios .c-subtopbar,.ua-ios .c-header,.ua-ios #container{width:775px}.ua-ios .results-content{width:601px}.ua-ios .c-header>a:last-child{display:none} -------------------------------------------------------------------------------- /cache/css/result-min.css: -------------------------------------------------------------------------------- 1 |  body{padding:0;margin:0;font-size:14px;font-family:Arial,sans-serif;color:#434343;line-height:24px}h1,h2,h3,h4,h5,p,ul,form,li,ol,div,dl,dt,dd{margin:0;padding:0}ul,ol,li{list-style:none}img{border:0}a:link,a:visited{color:#35a1d4;outline:0}a.viaInner,.gray a{text-decoration:none}b{font-weight:normal;color:#638c0b}.additional{color:#959595}.sp,.result_navigator .go-top,.add_to_wordbook,.remove_from_wordbook,.desk-dict,.phone-dict,.wordbook,.yd-school,.sina,.netease,.tencent,.renren,.kaixin,.trans-wrapper h3 .toggleOpen,.trans-wrapper h3 .toggle,.more_sp,.more-collapse .more_sp,.video .close,.trans-container div .do-detail,.wt-collapse div .do-detail,.nav-collins .collins-icon,.sub-catalog .split,#editwordform #close-editwordform,.example_see_also .icon{background:url(new-sprite.png) no-repeat;vertical-align:middle;overflow:hidden;display:inline-block}#topImgAd{height:60px}#container{width:960px;margin:10px auto 0;overflow:hidden;zoom:1}#results{margin-top:15px;float:left;position:relative}.results-content{margin-top:7px;width:550px;float:left;_display:inline;margin-left:140px}.ads{float:right;width:250px;margin-top:22px}.result_navigator{margin-right:20px;width:120px;margin-top:10px;position:absolute;text-align:center;left:0}html{_background-image:url(null)}.rel-search{clear:both;margin-left:140px}.rel-search a{margin-right:40px}.sub-catalog{margin-bottom:20px}.sub-catalog h3{text-align:center;font:12px/27px normal;color:#aaa;margin-bottom:6px}.sub-catalog .split{display:block;background-position:-238px -8px;height:10px;width:120px;margin:0 auto;font-size:0}.example-group .split{margin:3px auto 0}#result_navigator .example-group h3{font-size:13px;margin-left:-18px}.sub-catalog li{font:12px/27px normal}.sub-catalog li a{color:#a0a0a0;display:inline-block;text-decoration:none;width:120px;height:27px}.sub-catalog li a:link,.sub-catalog li a:visited{color:#a0a0a0}.sub-catalog li a:hover,.example-group h3 a:hover{font-weight:bold;color:#434343}.result_navigator .go-top{background-position:-29px 0;display:inline-block;padding-top:24px;height:0;width:25px}.result_navigator .go-top:hover{background-position:-59px 0}.result_navigator .back-to-dict{display:block;margin:15px 0 0 30px;font-size:12px;color:#c9c9c9;text-decoration:none;width:56px;height:19px;line-height:19px;border:2px solid #ddd}.result_navigator .back-to-dict:hover{border:2px solid #a9c7d7;color:#a9c7d7}.nav-collins{position:relative}.nav-collins .collins-icon{position:absolute;top:-5px;left:78px;background-position:0 0;width:24px;height:9px}.example-group li a{text-align:left}.example-group h3 a{color:#000;text-decoration:none}.example-group .catalog-selected a{font-weight:bold;color:#434343}.example-group li{margin-left:16px;padding-left:19px}.example-group .sub-catalog-selected{border-left:2px solid #63bfeb;font-weight:bold}.example-group .sub-catalog-selected a{position:relative;left:-2px;color:#434343}.dict-inter,.follow{border:1px solid #e5e5e5;background:#fafafa;margin-bottom:15px;font-size:12px}#baidu-adv{margin-bottom:15px}.dict-inter a{text-decoration:none}.dict-inter a:hover{text-decoration:underline}.dict-inter li{float:left;width:114px;height:30px;line-height:30px;text-align:left;overflow:hidden;zoom:1}.pr-link{height:68px;padding:8px 4px 0 8px}.pr-link li{padding:0 4px 5px 0}.pr-link li a{display:inline-block;width:114px;height:30px;color:#a0a0a0;vertical-align:top;cursor:pointer}.pr-link li a:hover,.follow .bd a{text-decoration:none;zoom:1}.text-link{padding:10px 13px 10px 15px;line-height:26px}.desk-dict,.phone-dict,.wordbook,.yd-school{padding-left:46px}.desk-dict{background-position:-379px 4px}.pr-link li a:hover .desk-dict{background-position:-380px -31px}.phone-dict{background-position:-380px -137px}.pr-link li a:hover .phone-dict{background-position:-380px -171px}.wordbook{background-position:-379px -68px}.pr-link li a:hover .wordbook{background-position:-379px -102px}.yd-school{background-position:-380px -205px}.pr-link li a:hover .yd-school{background-position:-381px -244px}.follow .hd{margin:15px 0 0 15px;color:#a0a0a0}.follow .bd{margin:10px -14px 15px 10px}.follow .bd a{display:inline-block;width:60px;text-align:center;margin:0 24px 5px 0;color:#a0a0a0;text-decoration:none;cursor:pointer}.sina,.netease,.tencent,.renren,.kaixin{padding-top:40px}.sina{background-position:-319px -283px}.follow a:hover .sina{background-position:-377px -283px}.netease{background-position:-210px -285px}.follow a:hover .netease{background-position:-260px -285px}.tencent{background-position:10px -212px}.follow a:hover .tencent{background-position:-41px -213px}.renren{background-position:-92px -283px}.follow a:hover .renren{background-position:-152px -283px}.kaixin{background-position:10px -283px}.follow a:hover .kaixin{background-position:-35px -283px}#phrsListTab{margin-top:0}#phrsListTab .phonetic{font-size:18px}#phrsListTab .trans-container{margin:0 0 1.1em 0;color:#000}#phrsListTab h2{font-size:24px;margin-bottom:12px}.keyword{margin-right:1px}#phrsListTab .trans-container li{font-weight:bold;color:#434343}.img-list{float:right}.img-list img{height:80px;padding:2px;border:1px solid #e5e5e5}.add-fav{display:inline-block;width:23px;height:19px;background-position:-168px -132px;outline:0}.add-fav:hover{background-position:-168px -149px}.add-faved{outline:0;background-position:-209px -132px}.add-faved:hover{background-position:-209px -149px}#phrsListTab h2 .dictvoice{outline:0;display:inline-block;width:16px;height:26px;background-position:-92px 4px;vertical-align:top;margin-left:.5em}#phrsListTab h2 .dictvoice:hover{background-position:-121px 4px}.dictvoice{vertical-align:middle;width:10px;height:21px;background-position:-33px -35px}.dictvoice:hover{background-position:-47px -35px}.humanvoice{vertical-align:top;width:18px;height:18px;background-position:-149px 2px}.humanvoice:hover{background-position:-179px 2px}.add_to_wordbook{vertical-align:top;background-position:-205px 5px;width:24px;padding-top:26px;height:0;margin-left:.5em;*margin-left:.75em}.add_to_wordbook:hover{background-position:0 -32px}.remove_from_wordbook{vertical-align:top;background-position:-70px -32px;width:22px;padding-top:26px;height:0;margin-left:.5em;*margin-left:.75em}.remove_from_wordbook:hover{background-position:-100px -32px}.pos{margin-right:.1em}.def{margin-left:.1em}.trans-wrapper{position:relative;zoom:1}.trans-wrapper h3{font-size:14px;position:relative;margin:0 0 .7em 0;height:26px;line-height:26px;border-bottom:2px solid #ddd}.trans-wrapper h3 .toggle{position:absolute;top:12px;right:0;cursor:pointer;width:11px;height:20px;background-position:-181px -37px}.trans-wrapper h3 .toggle:hover{background-position:-202px -37px}.trans-wrapper h3 .toggleOpen{background-position:-138px -37px}.trans-wrapper h3 .toggleOpen:hover{background-position:-160px -37px}.tabs a,.tab-current{font-weight:normal;text-decoration:none;display:inline-block;border-bottom:2px solid #fff;height:26px;_position:relative;_top:2px}.tabs a span{cursor:pointer}.tabs a.tab-current{cursor:default}.tabs a.tab-current span{cursor:default;color:#434343;font-weight:bold}.tabs a span,.tab-current span{display:inline-block;padding:0 20px;height:26px;border-bottom:2px solid #bfbfbf;margin-right:2px;_position:relative;_top:2px}.results-content .tabs a:hover span{border-bottom:2px solid #5fc4f3}.results-content .tab-current span{border-bottom:2px solid #5fc4f3;color:#434343;font-weight:bold}.trans-container{margin:.9em 0 1.8em}.trans-container p,.trans-container li{line-height:24px}.trans-container .ol{margin:8px 15px 0 20px;margin-left:33px\9}.trans-container .ul{margin:8px 15px 18px 0}.trans-container .ol li{list-style:decimal;margin:0 0 .7em 0}.trans-container .ul li{margin:0 0 1em 0}.ar{color:#a0a0a0;font-size:12px}p.via,span.via{color:#959595}p.via{font-size:12px}p.via a{color:#35a1d4;font-size:12px}p.additional a{color:#35a1d4;text-decoration:none}.s1{margin:0 3px}.trans-container h4 sup{font-size:.77em;font-weight:normal}#examples_sentences .allExplanation{float:right;margin:0 15px 0 0;text-decoration:none;background:#63bfeb;color:#fff;padding:0 5px}#examples_sentences .allExplanation:hover{background:#a4d5ec}.search_result{margin:.83em 0 1.25em}.search_result .sresult_content{margin:.45em 0}.search_result .sresult_link{color:#54903f;text-decoration:none}.phonetic,.field,.origin,.complexfont{font-weight:normal;color:#666;margin:0 .1em}h4 .field,h4 .origin,h4 .def,h4 .collapsed-def{margin-left:10px;font-size:12px}.phonetic{color:#a0a0a0;font-family:"lucida sans unicode",arial,sans-serif}.dif{color:#808080}.wordGroup .contentTitle{font-weight:bold;color:#35a1d4;margin-right:.5em}.wordGroup .contentTitle a{text-decoration:none}.wordGroup .century21{cursor:pointer;width:16px;display:inline-block;height:16px;background:url("new-sprite.png") no-repeat -110px -150px;text-decoration:none}.wordGroup a.century21:hover{background:url("new-sprite.png") no-repeat -110px -132px}.ol .sense-ex{margin:0;padding:0;list-style:none;color:#808080}.ol .sense-ex li{list-style:none;margin-bottom:0}.sense-ex .exam-sen{padding-left:2.5em}.sense-ex ul,.sense-ex ul li{margin:0;padding:0}#tWebTrans .wt-container p{margin:0 15px}#webPhrase{margin-top:10px}.wt-container .collapsed-def{display:none}.wt-collapse .collapsed-def{display:inline;font-weight:normal}.wt-collapse .collapse-content{display:none}.phrase-collapse .wt-more{display:none}.pr-container .title,.wt-container .title{font-weight:bold;position:relative}.wt-container .title span{zoom:1;vertical-align:middle}#tWebTrans .wt-container p{margin:.45em 15px}#results-content .wt-container div a{color:#2b2b2b;text-decoration:none}#results-content #collinsResult .wt-container div a{color:#35a1d4}.trans-container div .do-detail{background-position:-194px -74px;width:12px;height:12px;margin-right:5px}.trans-container div .do-detail:hover{background-position:-219px -74px}.wt-collapse div .do-detail{background-position:0 -74px}.wt-collapse div .do-detail:hover{background-position:-17px -74px}.wt-container a{outline:0}.more{height:18px;width:200px;line-height:18px;_line-height:23px;margin:15px 0;color:#35a1d4}.more_sp{background-position:-39px -74px;width:12px;height:12px;text-decoration:none}.more_sp:hover{background-position:-58px -74px}.more-collapse .more_sp{background-position:-76px -74px}.more-collapse .more_sp:hover{background-position:-96px -74px}.unfold{display:none}.more-collapse .collapse{display:none}.more-collapse .unfold{display:inline}.show_more{display:none}.more-collapse .show_more{display:inline}.show_less{display:inline}.more-collapse .show_less{display:none}.gram{display:block;font-style:normal;font-weight:normal;color:#808080}.related-lan{padding:1em 22px}.related-lan a{margin-left:.5em}.hh-collapse .hh-more{display:none}.more-hh{width:103px;padding-top:20px;margin:.7em 0 0;background-position:-309px -90px}.hh-collapse .more-hh{background-position:-206px -90px}.more-example{text-decoration:none;color:#35a1d4}.eBaike .trans-container{margin:.5em 0 1em}.eBaike .eBaike-index{overflow:hidden;zoom:1;padding-bottom:15px;border-bottom:1px dotted #ddd;line-height:24px}.eBaike-index .content{line-height:24px}.eBaike-detail .eBaike-index{border:0}.eBaike h2{font-size:12px;font-weight:normal;overflow:hidden;zoom:1}.eBaike h2 .subject{font-size:24px;float:left;margin:0 .5em 0 .3em;font-weight:bold}.eBaike .title{text-decoration:none;line-height:24px;font-weight:bold}.eBaike .img_r{float:right;margin-left:1em}.eBaike .img{background:#f7f7f7;border:1px solid #e1e1e1;color:#666;padding:3px;text-align:center}.eBaike .img strong{clear:both;display:block;font-size:12px;font-weight:normal;line-height:18px;overflow:hidden}.eBaike .see_more{text-decoration:none}.eBaike .ar{float:right}#bk .ar{float:none;text-align:right}#baike h2{font-size:1em;overflow:auto;zoom:1}#baike h2 .subject{font-size:1.13em;float:left}#baike h2 .via{float:right;color:#959595;font-weight:normal}#baike .via img{vertical-align:middle}#baike .description{line-height:1.5em;overflow:hidden;zoom:1}#baike .sub-title{float:left}#baike h3{background:0;font-size:1em;height:1.9em;line-height:1.9em;margin:.83em 0 .83em;position:relative;padding-left:5px;border-top:1px dotted #e0e0e0}#baike .trans-container .content{overflow:hidden;zoom:1;line-height:1.5em;margin:.25em 0}#baike .trans-container .content .term{font-weight:bold}#baike .trans-container a{text-decoration:none}#baike .img{background:#f7f7f7;border:1px solid #e1e1e1;color:#666;padding:3px;text-align:center}#baike .img_r{float:right;margin-left:1em}#baike .img strong{clear:both;display:block;font-size:1em;font-weight:normal;line-height:1.5em;overflow:hidden}#baike .img_l{float:right;margin-left:1em}#baike .table{border-spacing:0;border-collapse:collapse;empty-cells:show;background:#f7f7f7;border:1px solid #e1e1e1}#baike .table td{background:#fafafa;border:1px solid #DDD;padding:10px;vertical-align:top}#baike .suggests .suggest{border-top:1px dotted #e0e0e0;margin:10px 0;padding-top:10px;overflow:hidden;zoom:1}.example_content .content_title .boldWord{font-weight:bold}.example_content .content_title .boldWord a,.example_content .content_title .boldWord a:link,.example_content .content_title a:visited{text-decoration:none}.example_content .content_title .tabLink a:hover{color:#313131}.example_content .content_title .tabLink a.selected_link{cursor:default;color:#313131}.example_content .allExplanation{float:right;margin:2px 15px 0 0;width:85px;height:24px;text-decoration:none;font-weight:bold;background:url("new-sprite.png") no-repeat 0 -168px}.example_content a.allExplanation:hover{background-position:-85px -168px}.example_content .error-wrapper{margin:20px 10px 20px 0}.video{position:relative}.video .play{display:inline-block;position:relative}.video .close{width:14px;height:14px;background-position:-117px -72px;position:absolute;top:-1px;left:330px}.video .close:hover{background-position:-141px -72px}.video .playicon{cursor:pointer;position:absolute;width:30px;height:30px;top:50%;left:50%;margin-left:-15px;margin-top:-15px}.remind{margin:1.1em 0 2.85em}.remind a{text-decoration:none}.example_see_also{overflow:hidden;zoom:1}.example_see_also .info{float:left;width:185px;height:110px;margin:5px 10px 0 0;display:inline;background:#f5f5f5;cursor:pointer;text-decoration:none;padding:0 10px}a.info:hover{background:#78c8e3}.example_see_also div{line-height:24px;margin:10px 20px 10px 0}.example_see_also .info .description{color:#a0a0a0;font-size:12px;margin:0}.example_see_also .info:hover .description,.example_see_also .info:hover .title{color:#fff}.example_see_also .icon{display:inline-block;height:33px;width:46px;vertical-align:middle}.example_see_also .title{margin-left:10px;font-size:14px}.example_see_also .bilingual .icon{background-position:-46px -107px;width:50px}.example_see_also .originalSound .icon{background-position:6px -107px}.example_see_also .authority .icon{background-position:-96px -107px;width:50px}.bottom{position:absolute;bottom:0}.def a{text-decoration:none}.highLight{background:#e8e5cb}.dont_show_nav #example_navigator{display:none}.dont_show_nav #example_content{margin-left:15px}#tPowerTrans p.additional{margin:5px 0;text-indent:20px}#tEETrans p.additional{margin:5px 0;text-indent:14px}#tEETrans .ol p em,.gray{color:#a0a0a0}.wordTrans{display:inline-block;width:13px;height:13px;background-position:-183px -237px;cursor:pointer}.wordTrans a{color:#2779b6}.errorTip{height:18px;line-height:18px;font-weight:normal}#transDevotion form p{margin:8px 0;line-height:1.5em}#transDevotion form label{margin:0 .83em 0 0}#transDevotion form .center{margin:0 6px 0 0}.trans-container textarea.trans-content,.trans-container input.trans-message{vertical-align:middle;font-size:12px;font-weight:normal;width:220px}.trans-container textarea.trans-content{height:70px;resize:none}#transDevotion form .submitTip{margin-left:70px}#transDevotion .error-message{margin:0 0 -5px 72px;display:block}.trans-container .ensure,.trans-container a.ensure:hover{display:inline-block;width:61px;height:24px;cursor:pointer}.trans-container .ensure{background-position:-61px -237px}.trans-container .ensure:hover{background-position:0 -237px}.trans-container .ensure:active{background-position:-122px -237px}.trans-container .cancel,.trans-container .cancel:hover{display:inline-block;width:61px;height:24px;margin-left:30px;cursor:pointer}.trans-container .cancel{background-position:-61px -261px}.trans-container .cancel:hover{background-position:0 -261px}.trans-container .cancel:active{background-position:-122px -261px}.trans-container .alignCenter span{display:none}.collins .wordGroup{color:#35a1d4;margin-bottom:6px}.collins .wordGroup .contentTitle{color:#a0a0a0;font-weight:normal}.collins .more{float:right;margin:-23px 0;width:auto}.wt-container .trans-tip{font-weight:normal;color:#9d9d9d}.wt-container .trans-content{font-weight:normal}.wt-container .collins-intro{border:1px solid #cdcdcd;padding:6px 0 6px 5px;color:#959595}.trans-content ol{padding-left:23px}.trans-content .pattern,.trans-content .spell{font-weight:normal;margin-left:5px;font-size:12px}.collins-phonetic{font-family:"lucida sans unicode",arial,sans-serif}.trans-content .pattern{margin-left:15px}.trans-content .title,.trans-content .rank{font-size:14px;color:#313131;font-weight:bold}.trans-content .rank{margin-left:20px}.trans-content .trans{margin-left:10px;color:#313131}#collins .additional span{display:inline-block;margin-left:-1.83em}#collins .additional p{padding-left:1.83em}.usage{margin-left:15px}.p-type{text-decoration:none}.p-type:hover{color:#313131}.type-list{line-height:24px}.type-list .boldWord{margin-right:10px}.type-list ins{text-decoration:none;margin:0 10px;color:#959595;cursor:default}.type-list a:hover{color:#434343}.type-list .selected_link{color:#434343}#tPETrans .additional{font-size:12px}#tPETrans .additional a{text-decoration:underline}#tPETrans .type-list .selected_link{cursor:default;color:#313131}#tPETrans .all-trans{margin:16px 0}.all-trans .types .items{margin-bottom:16px;list-style:none}.all-trans .types .items a:link,.all-trans .types .items a:visited{font-size:12px;color:#959595;text-decoration:none}.all-trans .types .items a:hover{text-decoration:underline}.all-trans .items .title{font-weight:bold}.all-trans .types{display:none;margin:0}.all-trans .types .source{margin-top:6px}.all-trans .types .trans{margin-bottom:6px}.clearfix:after{content:".";display:block;height:0;visibility:hidden;clear:both}.clearfix{zoom:1}#results .middot{font-size:20px;_font-size:12px;font-weight:bold;vertical-align:middle;margin:0}#simple_dict_trans ul .small-lang{zoom:1}.ead_line div{zoom:1}.need-help{display:inline-block;margin-left:2px;margin-top:2px;background-position:-166px -72px;width:20px;height:16px}.wt-container div.title span,#webPhrase .more,#hhTrans .more-hh,#word_phrs .more,#collinsResult .pr-container .more{cursor:pointer}#examples_sentences,#examples_sentences .trans-container{margin-top:0}#examples_sentences .ol{margin-top:25px}.example-via a{color:#959595;text-decoration:none;font-size:12px}.error-typo{margin:0 0 15px 0;padding:9px 5px 14px;border:1px solid #e1deb6;background-color:#f9f8eb}.error-typo h4{margin:0 0 13px}.error-typo .typo-rel{margin:8px 0 0}.error-typo .typo-rel .title{font-weight:bold}.error-typo .typo-rel .title a{text-decoration:none}#relatedLan .trans-container a{text-decoration:none;margin-left:10px}.pm{display:none;position:absolute;z-index:1000;width:70px;border:1px solid #8cbbdd;background:white}.pm a{display:block;padding:4px 3px;text-decoration:none;zoom:1}#langSelection{width:77px;border:1px solid #bfbfc8}#langSelection a{padding:1px 3px 1px 7px;color:#000;font-size:12px}#langSelection a:hover{color:#000;background:#f5f5f5}#langSelection .current{color:#000;background:#f5f5f5}#handWrite{width:346px;height:216px;border:1px solid #bfbfc8}#editwordform{position:absolute;top:222px;left:50%;padding:0 2px 2px;z-index:3;font-size:12px;background:#5db3dd;display:none;margin-left:-340px}#editwordform h3{line-height:26px;color:#fff;font-weight:bold;font-size:14px;padding-left:3px;margin:0}#editwordform form{background:#fff;border:#74abc6 solid 1px;padding:8px}#editwordform #wordbook-word{width:150px;display:inline;vertical-align:middle}#editwordform #delword{margin-left:5px;vertical-align:middle;line-height:20px}#editwordform label{display:block;line-height:24px}#editwordform input{width:260px;display:block;height:18px}#editwordform select{width:150px}#editwordform #wordbook-desc{width:260px;height:50px;font-size:12px;display:block}#editwordform #addword,#editwordform #openwordbook{width:82px;height:30px;display:inline-block;color:#fff;line-height:30px;font-weight:bold;text-decoration:none}#editwordform #addword{background:#a7c36c;margin:10px 0 5px 0}#editwordform #openwordbook{background:#95cbe5;margin:10px 30px 5px 0}#editwordform #close-editwordform{position:absolute;background-position:-235px -32px;right:3px;top:4px;width:20px;height:20px;display:inline-block}#editwordform #close-editwordform:hover{background-position:-267px -32px}#editwordform #tag-select-list{width:262px;border:1px solid #ccc;display:none;position:absolute;background:#e3eff8;_left:10px;#left:10px;padding:0}#editwordform #tag-select-list li{display:block;width:100%}.error-note strong{word-wrap:break-word;word-break:break-all}#fanyiToggle .additional{font-size:12px}#research,#research21{position:absolute;top:6px;right:35px;text-decoration:none;padding-left:18px;background:url(research.png) 3px 3px no-repeat;height:18px;line-height:18px;font-size:12px}#researchZoon,#researchZoon21{width:250px;height:261px;border:2px solid #5db3dd}#researchZoon .title,#researchZoon21 .title{height:26px;line-height:26px;background-color:#5db3dd;color:#fff;font-weight:bold;padding-left:3px}#researchZoon .zoo-content,#researchZoon21 .zoo-content{font-size:12px;padding:12px 0 0 7px}#researchZoon a,#researchZoon21 a{padding:0;margin:0}#researchZoon .zoo-content p,#researchZoon21 .zoo-content p{margin:0 0 12px 12px;height:18px;line-height:18px}#researchZoon .zoo-content p input,#researchZoon21 .zoo-content p input{margin-right:6px}#researchZoon .submitResult,#researchZoon21 .submitResult{margin:14px auto 0 auto;width:82px;height:30px;line-height:30px;text-align:center;color:#fff;font-weight:bold;background-color:#a7c36c;display:block}#researchZoon label,#researchZoon21 label{cursor:pointer}#researchZoon a,#researchZoon21 a{display:inline}.c-topbar{height:27px;line-height:27px;color:#333;font-size:12px}.c-subtopbar{width:960px;margin:0 auto;position:relative;zoom:1;z-index:3}.c-topbar a{color:#333!important;text-decoration:none}.c-snav{float:left;color:#ddd}.c-snav a,.c-snav b{width:36px;text-align:center;display:inline-block}.c-snav a:hover,.c-snav b{text-decoration:none;border-top:1px solid #d22e45}.c-snav b{color:#000;font-weight:bold}.c-snav .nav-more{*+line-height:25px}.c-snav .ne163:hover{border:0;text-decoration:underline}.c-sust{float:right;margin:0 10px 0 0;display:inline;position:relative}.c-sust a:hover{text-decoration:underline}.c-sust .c-sp{margin:0 10px;color:#ddd}.c-sust .ac{position:relative;z-index:99}.c-sust .ac .ai{font-size:9px}.c-sust .dm{position:absolute;left:0;top:21px;width:138px;text-align:left;line-height:26px;background-color:#fff;border:1px solid #bfbfc8}.c-sust .dm a{display:block;padding:0 0 0 8px}#uname{font-weight:bold;color:#626262;cursor:pointer;position:relative;padding:0 5px 0 5px}#uname u{height:21px;vertical-align:top}#unameop{border:1px solid #dcdddd;font-size:13px;background-color:#fff;position:absolute;top:27px;left:56px}#unameop a{color:#2a2a2a;display:block;line-height:24px;margin:0;padding:2px 0 0 9px;text-decoration:none;float:none;font-weight:normal}#unameop a:hover{background:#f5f5f5;color:#000;text-decoration:none}.c-header{position:relative;clear:both;height:64px;width:960px;margin:0 auto}.c-logo{display:inline-block;overflow:hidden;width:147px;height:0;padding-top:37px;vertical-align:top;background:url(../images/logo-result.png) no-repeat;margin:14px 19px 0 0;float:left;_display:inline}.s-inpt-w,.s-btn-w{background:url(../images/pic.gif) no-repeat}.c-fm-w{position:relative;display:inline-block;margin:14px 0 0 0;z-index:2}.s-inpt-w{display:inline-block;width:520px;height:37px;background-position:0 -67px;vertical-align:top}.s-inpt{border:0;background:transparent;width:400px;width:397px\9;overflow:hidden;font:17px arial;margin:0 37px 0 84px;padding:7px 0 0 1px;padding:8px 0 0 4px\9;height:29px;height:27px\9;_margin-right:0;vertical-align:top;outline:0}#bs .s-inpt{width:515px;margin:0;padding-left:5px}.s-btn-w{display:inline-block;height:37px;width:88px}.s-btn-w:hover{background-position:-176px 0}.s-btn-w:active{background-position:-88px 0}.s-btn{cursor:pointer;height:34px;width:88px;font-size:14px;font-weight:bold;text-align:center;border:0;background:0}.c-fm-ext{font-size:12px;padding:0 0 0 10px}.c-fm-ext a{font-size:12px;color:#999;text-decoration:none}.c-fm-ext a:hover{text-decoration:underline}.header-pic-tg{position:absolute;right:2px;top:0;z-index:0}.header-pic-tg img{border:1px solid #fff;font-size:0}.c-header-ext .header-pic-tg{right:0}.c-header-ext .header-pic-tg img{border:0}.c-bsearch{background-color:#f6f6f6;margin:35px 0 0;padding:19px 0 0 0;height:81px;color:#999}.c-bsearch-box,.c-bsearch .fblinks{width:794px;margin:0 auto;position:relative;padding-left:166px}.c-bsearch .c-fm-w{margin:0}.c-bsearch a{color:#999;text-decoration:none;font-size:12px}.c-bsearch .fblinks{margin:11px auto 0 auto}.c-bsearch .fblinks a{color:#666}.c-bsearch .fblinks a:hover{text-decoration:underline}#c_footer{margin:30px 0;font-size:12px;text-align:center;color:#999}#c_footer a{color:#999;text-decoration:none}#c_footer a:hover{text-decoration:underline}#c_footer .c_fnl{color:#ddd;margin:0 10px}#c_footer .c_fcopyright{margin:10px 0 0}.langSelector{position:absolute;top:7px;_top:12px;left:10px;font-size:12px;cursor:pointer;color:#656565}.aca{background:url(../images/pic.gif) no-repeat -313px 0;display:inline-block;padding-top:14px;height:0;width:14px;overflow:hidden;vertical-align:middle;margin-left:5px;cursor:pointer}.aca_btn_on{background-position:-341px 0}.aca_btn_hover{background-position:-327px 0}.hand-write{background:url(../images/pic.gif) no-repeat -356px 0;display:inline-block;padding-top:16px;height:0;width:16px;overflow:hidden;position:absolute;top:10px;left:494px;cursor:pointer}.hnw_btn_hover{background-position:-375px 0}.hnw_btn_on{background-position:-394px 0}.sw{font-size:1em;border:1px solid #bfbfc8}.sw table{background:#fff;border-collapse:collapse}.remindtt75,.jstxlan{padding:3px}.remindtt752{padding:.2em;color:#808080;font-size:.95em}.jstxlan{color:#656565;font-size:12px;cursor:pointer}.jstxhuitiaoyou{background:#f5f5f5;font-size:0;display:none}.aa_highlight{color:#000;background:#f5f5f5}#custheme{background:url(skin.png) no-repeat;height:93px;left:0;overflow:hidden;position:absolute;top:0;width:100%;z-index:-1} -------------------------------------------------------------------------------- /cache/css/style_result.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | /* CSS Document */ 3 | body,div,ul,li,h1,h2,h3,h4,h5,h6,p,form,input,label,table,thead,tbody,th,tr,td,dl,dt,dd{margin:0;padding:0;}input,button,textarea,select{font-family:Arial;font-size:inherit;font-style:inherit;font-weight:inherit;}input{vertical-align:middle;}body{font-family:Arial;font-size:14px;background:#fff;color:#666;} 4 | ul,li{list-style:none;}a{color:#666; text-decoration:none;}img{border:0;} 5 | 6 | a:hover,#footer .hp_footer a:hover,a.text_black:hover{color:#4372b6;text-decoration:underline;} 7 | 8 | .addbox{width:310px;height:167px;font-size:14px;display:none;z-index:99999;background:url(../images/bg_add.png) repeat;_background:none #ccc;padding:10px;position:absolute;top:10px;left:20px}.addWordContent{background:url(../images/t_body.png) repeat-x 0 bottom #fff;width:310px;height:167px}.addbox .cH{background:url(../images/t_bg.png) repeat-x;height:29px;line-height:29px;text-align:left;padding:0 11px;font-size:12px;color:#4372b6}.addbox .cF INPUT{padding:3px;font-size:14px;float:right}.addbox .cH .close{float:right;margin-top:9px;cursor:pointer}.addbox .CB div{color:#333;font-family:Arial,Helvetica,sans-serif,SimSun}.addbox .CB div a:link,.addbox .CB div a:visited{color:#4372b6;font-weight:bold}.addbox .CB div a:hover{color:#0067ce}.addbox .cF{height:25px;padding-top:3px}.addbox .cF a:link,.addbox .cF a:visited{width:86px;height:23px;display:block;float:right;line-height:23px;text-align:center;background:url(../images/t_bg.png) repeat-x 0 -30px;cursor:pointer;border:#c5d3dd 1px solid;color:#4372b6;text-decoration:none;font-size:12px;margin-right:10px}.addbox .cF a:hover{background:url(../images/t_bg.png) repeat-x 0 -54px} 9 | 10 | .bg_main{background:url(../images/bg_layout.jpg) repeat-x 0 29px #fff;} 11 | #login,.usually,.prons,#side_bar,.tab_list,.group_inf{font-size:12px;} 12 | #login{background-color:#F0F5FE;height:32px;line-height:32px;border-bottom:#E9EFF3 1px solid;padding:0 16px;overflow:hidden;} 13 | .fl,.nav_list li,.left_bg,.input_style,.search,.search_hover,.usually label,.usually span,.title,.tab_list li,.group_inf li,.eg,.us{float:left;} 14 | .register,.search_main,.right_bg,.up,.down{float:right} 15 | .register{padding-left:25px;} 16 | a.text_black,.nav_list strong{color:#333;} 17 | #layout{width:960px;margin:0 auto;} 18 | #header{padding:24px 0 7px;display:inline-block;width:960px;background:url(../images/logo_cd.gif) no-repeat 0 18px;} 19 | .handwrite,.handwrite_over,.drop_down,.drop_down:hover,.ico_sound,.new_word a,.ico,.part_main h3.close a,.part_main h3.open a,.up,.down,.ico_close,.ct_example li,.to_top,.to_top:hover,.suggest li,a.example,a.example_up,a.info,.online_fb,.online_cl{background-image:url(../images/img_page2.gif);background-repeat:no-repeat;} 20 | .logo{width:142px;height:64px;float:left;padding-top:1px;} 21 | .logo a{width:142px;height:64px;float:left;} 22 | .search_main{width:786px;} 23 | .nav_list{display:inline-block;padding-left:6px;} 24 | .nav_list li{padding-right:18px;} 25 | #main_box a{text-decoration:underline;color:#236fd4;} 26 | #main_box a:hover,.feedback a:hover{color:#0093FF;} 27 | 28 | .group_inf{padding-top:7px;display:inline-block;width:720px;} 29 | .group_inf li{white-space:nowrap;} 30 | .word_other{line-height:220%;font-size:12px;} 31 | .search_box{height:49px;margin-top:7px;background:url(../images/bg_more2.png) repeat-x;position:relative;z-index:3000;} 32 | #pull_down{position:absolute;left:10px;top:38px;width:655px;border:#c6c6c6 1px solid;background-color:#fff;line-height:170%;color:#333;z-index:1000;visibility:hidden} 33 | #pull_down ul{margin-top:0} 34 | #pull_down li{border:0;padding:0 5px} 35 | #pull_down .text_blue{color:#0766dc;font-weight:bold} 36 | #pull_down li.bg_blue{background-color:#4372b6;color:#fff} 37 | #pull_down p{background-color:#f0f0f0;height:22px;line-height:22px;text-align:right;padding-right:5px;font-size:12px;} 38 | #pull_down p a{color:#346699;} 39 | .left_bg,.right_bg,.search,.button_expan a,.button_expan a:hover{background-image:url(../images/bg_more2.png);background-repeat:no-repeat;} 40 | .left_bg,.right_bg{width:5px;height:49px;} 41 | .left_bg{background-position:0 -51px;} 42 | .right_bg{background-position:-6px -51px;} 43 | .input_style{width:585px;height:23px;border:0;line-height:25px;margin:9px 0 0 5px;padding:3px 10px 3px 8px;font-size:18px;} 44 | .handwrite,.handwrite_over,.drop_down{width:16px;height:16px;cursor: pointer;position:absolute;} 45 | .handwrite{background-position:0 -70px;top:14px;right:130px;} 46 | .handwrite_over{background-position:-18px -70px;top:14px;right:130px;} 47 | .drop_down{background-position:-36px -70px;top:15px;right:150px;} 48 | .drop_down:hover{background-position:-54px -70px} 49 | #main_box{width:755px;float:left;} 50 | #dict_main{padding:0 8px 18px;border:#D9E2E9 1px solid;} 51 | .search{background-position:-13px -51px;border:0;cursor:pointer;width:108px;height:31px;margin:8px 6px 0 0;padding:0; float:right;} 52 | .search_hover{background-position:-370px -51px;} 53 | 54 | #center{padding-top:11px;width:960px;display:inline-block;overflow:hidden;} 55 | .dictbar{width:729px;display:inline-block;padding:15px 0 20px 8px;position:relative;} 56 | .usually{float:right;width:137px;line-height:16px;padding-top:10px;} 57 | .usually .tips_content{padding:3px 9px 4px 11px;} 58 | .star{background-position:left top;background-repeat:repeat-x;position:relative;} 59 | .star_current{background-position:left center;background-repeat:repeat-x;left:0;top:0;position:absolute;} 60 | .title{line-height:32px;padding-right:17px;position:relative;} 61 | .prons{white-space:nowrap;word-break:break-all;font-weight:normal;float:left; padding-top:7px;} 62 | .dict_title{width:580px;font-size:28px;color:#333;font-family:arial,sans-serif;} 63 | .dict_title h1{font-size:28px;} 64 | .ico_sound{background-position:-74px -73px;display:inline-block;height:15px;margin:2px 0 -4px 4px;overflow:hidden;width:15px; } 65 | .ico_sound:hover{background-position:-98px -73px} 66 | .eg,.us,.group_pos strong,.group_inf li{padding-right:10px;} 67 | .eg,.us{font-family:"lucida sans unicode",arial;padding-top:2px;} 68 | .new_word{padding-top:2px;float:left;} 69 | .new_word a{padding:2px 10px 0 20px;height:17px;display:block;background-position:-125px -69px;font-family:"宋体"} 70 | .tab_list,.tab_list li,.tab_list li:hover,.tab_list li a,.tab_list li a:hover{background-image:url(../images/bg_more2.png);background-repeat:repeat-x;} 71 | .tab_list{background-position: 0 -164px;height:29px;padding:0 0 10px 8px;} 72 | .tab_list h2,.tab_list h3{font-size:12px;font-weight:normal;} 73 | .tab_list li{line-height:29px;border-right:#D9E2E9 1px solid;border-left:#D9E2E9 1px solid;margin-right:-1px;z-index:200;} 74 | #main_box .like{float:left;line-height:29px;padding-left:19px;} 75 | #main_box .like a{color:#0caa35;text-decoration:none;} 76 | #main_box .like a:hover{color:#0caa35;text-decoration:underline;} 77 | #main_box .tab_list li a{padding:0 16px;background-position:0 -102px;display:block;cursor:pointer;color:#666} 78 | #main_box .tab_list li a:hover{background-position: 0 -133px;color:#4372b6;} 79 | #main_box .tab_list li.current,#main_box .tab_list li.current a{background-position:0 -161px;color:#000;} 80 | #main_box .tab_list li.current a:hover{background:none;} 81 | #main_box .tab_list li.text_red a{padding:0 18px 0 21px;_width:158px;} 82 | #main_box .tab_list li.text_red a:hover{color:#4372B6;} 83 | .up,.down{width:18px;height:16px;margin:11px 1px 0 0;} 84 | .up{background-position:-33px -86px;} 85 | .down{background-position:-33px -102px;} 86 | #main_box .usually,#main_box .prons{color:#999;} 87 | .group_prons .second{float:none;height:24px;} 88 | .dict_content{padding:0 0 0 10px;} 89 | #center #bdshare{float:right;padding-top:5px;} 90 | 91 | .group_pos{color:#000;line-height:22px; clear:both;overflow:hidden;} 92 | .group_pos p{width:725px;clear:both;} 93 | .label_list{float:left;width:635px;} 94 | .cn .group_pos,#main_box .group_pos strong{color:#333;} 95 | .group_pos strong{float:left;} 96 | .group_prons{clear:both;padding-top:10px;} 97 | .margin_top{padding-top:6px;} 98 | .collins{margin-top:18px;} 99 | .ico{position:absolute;width:32px;height:32px;background-position:0 -94px;top:-14px;left:-11px;} 100 | #main_box .tab_list li.#main_box .tab_list li.text_red a{color:#666;} 101 | .part_list,.part_list a,.part_main h3,.part_main h3 a{color:#4372b6;font-weight:bold;font-size:14px;} 102 | .part_main h3{padding:15px 0 7px 0;} 103 | .part_main h3.close a{background-position:-125px -101px;padding-left:15px;display:block;} 104 | .cn_main h3.close a{background-position:-128px -230px;padding-left:22px;} 105 | .part_main h3.open a{background-position:-127px -130px;padding-left:15px;display:block;} 106 | .cn_main h3.open a{background-position:-128px -267px;padding-left:22px;} 107 | .part_main h3 a:hover,a.text_blue,.text_blue,.feedback a,.collins_en_cn b,.vEn_tip b{color:#236fd4;} 108 | .part_list{background-color:#F1F4FC;line-height:24px;padding:7px 12px;} 109 | .tab_content{display:none;} 110 | .collins_en_cn{line-height:20px;} 111 | .caption{background-color:#F5F7FC;color:#333;font-size:14px;font-weight:normal;padding:9px 9px 9px 32px;text-indent:-15px;margin-bottom:11px;position:relative;} 112 | .caption .text_blue{padding-right:8px;} 113 | .collins_en_cn ul{color:#666;padding:0 45px 1px 47px;} 114 | .collins_en_cn ul.vli{padding:10px 0 0;} 115 | .vli li{line-height:20px;color:#8b8b8b} 116 | .collins_en_cn li,.vExplain_r li{background:url(../images/img_page2.gif) no-repeat -139px -305px;padding-bottom:11px;clear:both;padding-left:10px;} 117 | .caption .st{font-size:12px;font-weight:bold;color:#666;padding-right:9px;z-index:700} 118 | .tab_list li.text_red,.caption .st{position:relative;} 119 | .tab_list li.text_red{z-index:2000;} 120 | .caption .num{text-indent:-15px;font-weight:bold;color:#666;} 121 | .tips_box{position:relative;display:inline-block;background-color:#F4F4F4;padding-left:10px; z-index:600} 122 | .tips_main{position:absolute;top:19px;left:-12px;font-weight:normal;display:none; z-index:500;} 123 | .caption .st .tips_main{position:absolute;*top:29px;left:-1px;*left:14px;} 124 | a.example,a.info,a.example_up{display:inline-block;overflow:hidden;padding-left:10px;vertical-align:middle;height:15px; } 125 | a.example{background-position:10px -162px;width:67px; } 126 | a.example:hover{background-position:10px -194px;} 127 | a.info{background-position:-69px -162px;width:57px; } 128 | a.info:hover{background-position:-69px -178px;} 129 | a.example_up{background-position:10px -178px;width:67px; } 130 | a.example_up:hover{background-position:10px -210px;} 131 | .title .tips_main{line-height:80%;font-weight:normal;left:15px;top:30px;} 132 | .tips_content{position:absolute;font-size:12px;color:#BF901F;border:#E3DFAF 1px solid;padding:2px 9px 1px 26px;background-color:#FEFFE5;margin-top:3px;white-space:nowrap;} 133 | .title .tips_content{padding:0 9px 1px 12px;} 134 | .bg_tips{position:absolute;width:55px;height:4px;background:url(../images/bg_tips.gif) no-repeat;z-index:200;} 135 | .caption .st .bg_tips{background:url(../images/bg_tips_cx.gif) no-repeat;} 136 | .usually .tips_main{top:28px;left:0;} 137 | .usually_tip{position:absolute;left:615px;top:43px;} 138 | .usually_tip .tips_content{padding:4px 9px 4px 11px} 139 | .tab_list li.text_red .tips_content{left:13px;width:418px; white-space:normal;padding:3px 9px 1px 12px;line-height:20px;top:8px;} 140 | .tab_list li.text_red .bg_tips{top:8px;left:13px;} 141 | .about{font-size:12px;color:#666;padding:9px 9px 9px 22px;text-indent:0;overflow:hidden;zoom:1;} 142 | .about dt{width:63px;float:left;padding-top:1px;} 143 | .about dd{width:640px;float:left;} 144 | .about a,.bold_blue a{font-size:14px;font-weight:bold;} 145 | .bold_blue{font-weight:bold;color:#236fd4;} 146 | .collins_en_cn .en_tip,.vEn_tip{background-color:#F9F9DC;border:#CBD7E0 1px solid;line-height:24px;padding:5px 9px 10px 15px;margin:10px 0;color:#333;} 147 | .collins_en_cn .en_tip .p_pl,.vEn_tip .p_pl{padding-left:17px;} 148 | .collins_en_cn .bg_doc,.vBg_doc{background:url(../images/doc.gif) no-repeat 10px -230px #F9F9DC;padding-left:25px;} 149 | .collins_en_cn li.explain_s,.collins_en_cn li.explain_c,.collins_en_cn li.explain_r,.vExplain_s{background-image:url(../images/doc.gif);background-repeat:no-repeat;color:#333;line-height:24px;background-color:#F9F9DC;padding:5px 25px 0 29px;border:#CBD7E0 1px solid;margin-bottom:10px;width:589px;text-indent:0;} 150 | .vExplain_s{width:auto;padding-left:40px;background:url(../images/bg_ok.gif) no-repeat 17px 11px #F9F9DC;} 151 | .collins_en_cn li.explain_s{background:url(../images/bg_ok.gif) no-repeat 10px 11px #F9F9DC;} 152 | .collins_en_cn li.explain_c{background-position:10px -72px;} 153 | .collins_en_cn li.explain_r,.vExplain_r{background:#F9F9DC url(../images/vdoc.gif) no-repeat 10px 0;} 154 | .vExplain_r{padding:5px 25px 5px 29px;border:#CBD7E0 1px solid;background-position:14px 2px;margin-bottom:10px;color:#333;line-height:24px;} 155 | .vExplain_r .caption{background:none;padding:5px 9px 0 15px;margin-bottom:5px;} 156 | .vExplain_r ul{padding:0 45px 1px 15px;line-height:20px;} 157 | .vExplain_r li{padding-bottom:5px;} 158 | .collins_en_cn img{ vertical-align:middle;} 159 | .text_gray{color:#666;} 160 | .annotation{color:#8B8B8B;} 161 | .question{padding:7px 17px;border:#E2E2C2 1px solid;color:#000;background-color:#F9F9DC;border-bottom:0;font-size:16px;} 162 | .history{width:730px;padding:9px 6px 6px 17px;border:#D9E2E9 1px solid;color:#010101;background-color:#F5F7FC;border-bottom:0;font-size:14px; line-height:145%;overflow:hidden;display:inline-block;} 163 | .history h4{font-weight:normal;} 164 | .history dt{width:82px;float:left;padding-top:1px;} 165 | .history dd{width:643px;float:left;max-height:42px;overflow:hidden;} 166 | .history a{padding-right:6px;} 167 | #main_box .history a{text-decoration:none;} 168 | #main_box .history a:hover{text-decoration:underline;} 169 | .unfound_tips{padding:10px 6px 10px;position:relative;background:url(../images/ico_tip.png) 20px 18px no-repeat #F9F9DC;padding-left:42px;} 170 | .ico_close{float:right;width:15px;height:11px;background-position:-51px -91px;overflow:hidden;margin:2px 0 0;} 171 | .unfound_tips .ico_close{position:absolute;right:2px;top:3px;} 172 | .hidden{display:none;} 173 | .button_expan{padding:10px 0 0 9px;} 174 | .cn_main .button_expan{padding:10px 0 0 19px;} 175 | .button_expan a{width:112px;height:30px;background-position:-130px -51px;display:block;} 176 | .button_expan a:hover{background-position:0 -205px;} 177 | .button_expan a.button_close{background-position:-250px -51px;} 178 | .button_expan a.button_close:hover{background-position:-120px -205px;} 179 | .word_group .button_expan a{width:88px;background-position:0 -237px;} 180 | .word_group .button_expan a:hover{background-position:-96px -237px;} 181 | .word_group .button_expan a.button_close{background-position:-240px -205px;} 182 | .word_group .button_expan a.button_close:hover{background-position:-334px -205px;} 183 | .word_group h5{font-size:14px;color:#333;font-weight:normal;} 184 | .word_group .def_list h4{color:#236fd4;} 185 | .word_group .def_list{padding:0 0 0 9px} 186 | .word_group .ct_example li{background:none;} 187 | .word_group .ct_example li{padding-left:20px;} 188 | .word_group .see_more,.word_group .up_more{padding-left:9px;} 189 | .cn .def_list{padding:10px 0 0 9px} 190 | .cn .ct_example p{padding:0 0 14px 15px;color:#333;line-height:100%} 191 | .cn h5{line-height:100%; padding:2px 0 6px;} 192 | #main_box .synon a,#main_box .cn_synon_box a{padding-right:6px} 193 | .see_more,.up_more{padding-top:10px;} 194 | .see_more_en{padding-top:15px;font-size:12px;} 195 | #main_box .see_more a,#main_box .up_more a{font-size:12px;text-decoration:none; padding-left:12px;} 196 | #main_box .see_more a{background:url(../images/bg_more.gif) no-repeat 0 4px; *background:url(../images/bg_more.gif) no-repeat 0 2px;} 197 | #main_box .up_more a{background:url(../images/bg_more.gif) no-repeat 0 -13px; *background:url(../images/bg_more.gif) no-repeat 0 -15px;} 198 | .def_list{padding:0 0 9px 9px;} 199 | .cn_main .def_list{padding:0 0 0 19px;} 200 | .def_list dt{color:#333;font-weight:bold;padding:17px 0 2px;} 201 | .def_list h4{background:url(../images/bg_up.gif) no-repeat 0 5px;padding-left:37px;text-indent:-17px;line-height:24px;font-size:14px;font-weight:normal;color:#333;cursor:pointer;} 202 | .def_list h4.bg_down{background:url(../images/bg_down.gif) no-repeat 0 5px;} 203 | .def_list h4 a{text-decoration:none!important;} 204 | .def_list h4 a:hover{text-decoration:underline!important;} 205 | .def_list h4.ico_not,.ct_example li.bg_not{background:none;} 206 | .ct_example{padding-left:20px;color:#666;line-height:30px;display:none;} 207 | .tab_content .ct_example{padding-left:36px;} 208 | .ct_example li{color:#666;line-height:20px;background:url(../images/img_page2.gif) no-repeat -138px -304px;padding-left:13px;} 209 | .ct_example .syn_snt{padding:5px 0;} 210 | .ct_example .syn_snt li{padding-left:0;background:none;} 211 | .def_list dd{padding:3px 0 5px;} 212 | .industry{display:inline-block;} 213 | /*.tongyi .industry{padding-bottom:14px;}*/ 214 | .tongyi .see_more_en{padding:0;} 215 | .tongyi{color:#333;} 216 | .tongyi dl{line-height:22px;padding:6px 0;} 217 | .tongyi .tf_eng dl{line-height:} 218 | .tongyi dd{padding-left:15px;} 219 | .tongyi dd a{padding-right:4px;} 220 | .tongyi dl.other{padding:14px 0 6px} 221 | .tongyi dl.other dd{padding:0;} 222 | .tongyi .industry h4{padding:1px 0 5px 0} 223 | .tongyi .pos_box{padding:6px 0 0 0;width:36px;} 224 | .industry_box{padding-top:8px;} 225 | .industry h4{font-size:14px;clear:both;padding:0 0 8px 9px;color:#333;} 226 | .pos_box{float:left;padding-left:21px;line-height:1.5em;clear:both;font-weight:bold;} 227 | .tab_content .pos_box{width:31px;} 228 | .cn_synon_box h4{padding:0 0 9px;} 229 | .cn_synon_box .pos_box{padding-left:0;color:#333;font-weight:bold;} 230 | .industry ul{padding:0 0 14px 5px;display:inline-block;width:660px;float:left;color:#333;} 231 | .industry ul.padding_left{padding-left:57px;} 232 | .industry ul.cn_synon{padding:0 0 0 5px;} 233 | .industry li{line-height:1.5em;padding-left:20px;text-indent:-15px;} 234 | .more_data{padding:0 0 0 10px} 235 | .more_data .industry ul{width:100%;padding:0 0 25px;} 236 | .more_data .industry li{text-indent:0; line-height:22px;} 237 | .pic_desc{text-align:center;} 238 | .synon{color:#333;line-height:28px;} 239 | .suggest{color:#333;padding:18px 0 0 35px;} 240 | .suggest ul{line-height:155%;padding:7px 0 4px;} 241 | .suggest li{background-position:-134px -304px;padding-left:14px;} 242 | .suggest p{line-height:250%;} 243 | .suggest .pr a{padding-right:3px;} 244 | #side_bar{width:189px;overflow:hidden;height:auto;float:right;}#ad_right_box{border:1px solid #d9e2e9;background-color:#fafafa;padding:1px;float:right;margin-top:0;width:185px}#ad_right_box .hide{display:none}#dict_right5{border:1px solid #d9e2e9;float:right;width:187px;margin-top:16px;}.tab_tt{background-position:0 0;height:22px;overflow:hidden;padding:6px 7px 0 0;text-align:right;position:relative}/*.tab_tt,.tab_tt li.ad_tab_hover{background-image:url("http://static.www.iciba.com/ad/02/13244550791.png");background-repeat:no-repeat}*/.tab_tt{background:#f5f7fc;border-bottom:1px solid #d9e2e9}.tab_tt li.ad_tab_hover{background-position:-198px -4px}.tab_tt li{float:right;height:22px;line-height:22px;text-align:center;width:39px}.tab_tt span{color:#689bce;float:left;font-weight:bold;margin-top:3px;position:absolute;left:0;top:3px;width:60px}.tab_tt a:link,.tab_tt a:visited,.tab_tt a:active{color:#689bce;}.tab_tt li.ad_tab_hover a:link,.tab_tt li.ad_tab_hover a:visited,.day_eng h5 a:link,.day_eng h5 a:visited,.ad_list a:link,.ad_list a:visited{color:#4372b6}.tab_main{height:88px;overflow:hidden;padding:8px 0 0 6px;width:181px}.tab_main dl{color:#666;float:left;font-weight:bold;width:66px}.tab_main img,.tab_main dt{border:0 none;height:60px;overflow:hidden;width:60px}.tab_main dd{height:15px;overflow:hidden;padding-top:6px}.tab_main p{height:15px;overflow:hidden;padding-bottom:7px}.day_eng{padding:6px 0 7px 6px}.day_eng h5{height:17px;overflow:hidden;text-align:left;width:172px}.tab_main a:link,.tab_main a:visited{color:#666;}.tab_main a:hover{color:#0067ce;text-decoration:underline}.day_eng h5 a:link,.day_eng h5 a:visited{font-size:12px;line-height:17px;padding:10px 0 2px;}.day_eng li{clear:both;float:left;height:23px;overflow:hidden;padding-bottom:7px;text-align:left;width:180px}.day_eng input{border:1px solid #9bc0dd;height:17px;line-height:17px;padding:2px;vertical-align:middle;width:99px}.day_eng img{vertical-align:middle}.ad_list{color:#333;padding:8px 5px 2px;width:177px;border:1px solid #d9e2e9;float:right;margin-top:16px}.ad_list dl{padding-bottom:13px}.ad_list dt,.ad_list dd{line-height:20px} 245 | 246 | #main_box .part_list a,#main_box .tab_list li a,#main_box .new_word a,#main_box .part_main h3 a{text-decoration:none;} 247 | 248 | /* 今日新词 */ 249 | .words{padding:0;width:100%;border:0;} 250 | .word_nav,.word_nav2{height:30px;border-left:#D9E2E9 1px solid;} 251 | .word_nav li,.word_nav2 li{float:left;line-height:32px;text-align:center;color:#4372B6;width:94px;height:32px;background:url(../images/bg_tab.png) no-repeat 0 -34px;} 252 | .word_nav li.current,.word_nav2 li.current{background:url(../images/bg_tab.png) no-repeat;} 253 | .word_nav li a:link,.word_nav li a:visited,.word_nav2 li a:link,.word_nav2 li a:visited{color:#333;} 254 | .word_nav li a:hover,.word_nav2 li a:hover{text-decoration:none;} 255 | .word_nav li.current a:link,.word_nav li.current a:visited,.word_nav2 li.current a:link,.word_nav2 li.current a:visited{color:#4372B6;font-weight:bold;display:block;} 256 | .words_main,.words_main2{border:#D9E2E9 1px solid;border-top:none;padding:6px 0;font-size:14px;} 257 | .words_main{height:131px;} 258 | .words_main ul{overflow:hidden;padding-right:6px;} 259 | .words_main li{width:82px; height:22px; float:left;overflow:hidden;padding-left:8px;line-height:22px;} 260 | .word_next{text-align:right;font-size:12px;padding:6px 10px 0 0;height:15px; clear:both} 261 | 262 | .search_bottom{margin-top:12px;} 263 | .search_bottom .search_box{width:960px;background:url(../images/bg_more2.png) no-repeat 0 bottom;} 264 | .search_bottom .search{float:left; margin:8px 6px 0 1px;} 265 | .search_bottom .input_style{width:731px;padding-right:3px;} 266 | .search_bottom .handwrite{right:218px;} 267 | .search_bottom .drop_down{right:238px;} 268 | .feedback{line-height:47px;padding-left:28px;font-size:12px;} 269 | /*.to_top{width:16px;height:79px;background-position:-3px -228px;display:block;position:fixed;margin-left: 276px;left: 50%;bottom:80px;_position:absolute;_bottom:auto;_margin-bottom:80px;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))); z-index:4000}*/ 270 | #feed_back{width:115px;background:url(../images/logo_fb.gif) no-repeat 17px 25px #fff;bottom: 10px;padding: 70px 0 11px;position: fixed;right: 10px;text-align: center;_position:absolute;_bottom:auto;_margin-bottom:10px;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))); z-index:4000} 271 | #feed_back p{padding:6px 0 8px;} 272 | #feed_back a{color:#236fd4;font-weight:bold;text-decoration:underline;} 273 | #feed_back p.pb{padding-top:6px;} 274 | .btn_close{background:url(../images/ico_close.gif) no-repeat center center;display:block;height:18px;position:absolute;right:1px;top:0;width:18px;} 275 | .to_top{width:41px;height:29px;background-position:0 -131px;display:block;position:fixed;margin-left: 225px;left: 50%;bottom:1%;_position:absolute;_bottom:auto;_margin-bottom:1%;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))); z-index:4000} 276 | .to_top:hover{background-position:-44px -131px;} 277 | #footer{padding-top:10px;} 278 | .online_fb{width:22px;height:100px;background-position:-69px -195px;display: block;position:fixed;right: 1px;top:178px;_position:absolute;_bottom:auto;_margin-bottom:326px;_right:1px;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))); z-index:4000} 279 | .online_cl{width:22px;height:120px;background-position:-93px -195px;display: block;position:fixed;right: 1px;top:289px;_position:absolute;_bottom:auto;_margin-bottom:202px;_right:1px;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))); z-index:4000} 280 | .pic_content{float:left;text-align:center;} 281 | /*百度推广位*/ 282 | .vBaidu{border:1px solid #d9e2e9;margin-top:20px;padding:5px 15px;} 283 | #uptown{font-size:12px!important;} 284 | /*下载按钮*/ 285 | .search_main{width:581px;margin-right:15px;} 286 | .input_style{width:380px;} 287 | #pull_down{width:450px;} 288 | .nav_list li a{color:#236fd4;} 289 | .vDown{float:right;width:189px;height:45px;background:url(../images/vdown.gif) no-repeat;margin-top:24px;_margin-top:23px;position:relative;z-index:999;} 290 | .vDown1,.vDown2{display:inline-block;width:93px;height:43px;margin:1px 0 1px 1px;float:left;cursor:pointer;} 291 | a.vDown2:hover{background:url(../images/vdown2.gif) no-repeat 20px 12px;_background:url(../images/vdown2.gif) no-repeat 19px 12px;} 292 | .vDownH{background:url(../images/vdown1.gif) no-repeat 13px 10px;_background:url(../images/vdown1.gif) no-repeat 12px 10px;} 293 | .vDownL{position:absolute;border:1px solid #b2b8bc;background:#fff;top:44px;left:0;} 294 | .vDownL a{display:block;width:104px;height:28px;line-height:28px;text-align:center;color:#2e4757;font-size:12px;} 295 | .vDownL a:hover{background:#63abe1;color:#fff;text-decoration:none;} 296 | .vDownL span{ display:block;width:7px;height:5px; background:url(../images/vdown3.gif) no-repeat;position:absolute;top:-5px;left:45px;} 297 | /*04.26同义词辨析样式调整*/ 298 | .ct_example ul li{line-height:180%;} 299 | .vDef_list{padding:10px 0 5px 30px;line-height:150%;color:#333} 300 | .vDef_list a.ico_sound{display:inline-block;float:none;} 301 | .vDef_list dt{margin-bottom:4px;text-indent:-17px;} 302 | .vDef_list p{font-size:12px;color:#999;margin-top:8px;} 303 | /*05.16词典例句红色*/ 304 | .ct_example .syn_snt li span a{display:inline-block;} 305 | a.vtext_red{color:#f00!important;} 306 | /*05.23网络释义*/ 307 | .cn_main h3.open a{background-position: -128px -268px;} 308 | .vNet .button_expan_vNet{padding:5px 0 5px 19px;} 309 | .vNet .button_expan_vNet a{background:url(../images/vNet.gif) no-repeat;display:block;width:88px;height:30px;} 310 | .vNet .button_expan_vNet a:hover{background-position:-88px 0} 311 | .vNet .button_expan_vNet a.button_close{background-position:0 -30px} 312 | .vNet .button_expan_vNet a.button_close:hover{background-position:-88px -30px} 313 | .vNetH4{margin-top:20px;} 314 | .vNet .def_list h4{margin-bottom:6px;} 315 | /*05.24句库调用部分*/ 316 | a.vExplain{color:#236fd4;text-decoration:underline;} 317 | a.vExplain:hover{text-decoration:none;} 318 | /*06.13汉语词典*/ 319 | .vHanyu{width:733px;background:#f1f4fc;padding:3px 1px 3px 3px;height:78px;overflow:hidden;} 320 | .hanzi{background:url(../images/vhanyu.gif) no-repeat;float:left;font-family:"楷体_GB2312";font-size:67px;height:76px;padding-top:1px;width:77px;text-align:center;margin-right:1px;} 321 | .hanzi2{float:left;height:77px;} 322 | .hanzi02_line{height:37px;width:655px;text-align:center;margin-bottom:3px;} 323 | .hanzi021{background:#e8efff;color:#666;float:left;height:25px;padding-top:11px;width:63px;border:1px solid #fff;} 324 | .hanzi022,.hanzi023{background:#fff;color:#000;float:left;font-size:16px;font-weight:bold;height:27px;padding-top:11px;font-family:"楷体_GB2312";} 325 | .hanzi022{width:103px;margin-right:3px;} 326 | .hanzi023{width:246px;} 327 | .cn_main .vHanyu_list{padding-left:10px;} 328 | .vHanyu_list h4{background:none;padding-left:17px;cursor:auto;} 329 | .vHanyu_y{margin-left:10px;} 330 | .vHanyu_ci{padding-top:10px;} 331 | .vHanyu_ci .industry ul.padding_left{padding-left:15px;padding-bottom:20px;} 332 | .vHanyu_ci .industry h4{padding-bottom:5px;} 333 | /*06.15资讯推广位*/ 334 | .words_main2 img{width:178px;margin:0 5px;} 335 | .words_main2 p.vNews_s{text-align:center;font-size:12px;font-weight:700;padding-top:5px;} 336 | .words_main2 p.vNews_s a{text-decoration:underline;color:#236fd4;} 337 | .words_main2 p.vNews_s a:hover{text-decoration:none;} 338 | .words_main2 strong{font-weight:700;color:#333;font-size:12px;padding:0 7px 5px; display:block;} 339 | .vNews_s_c{padding-bottom:10px;} 340 | .vNews_s_c li{background: url(../images/img_page2.gif) no-repeat -139px -305px;padding-left:10px;margin-left:7px;height:20px; overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis;} 341 | .vNews_s_c li a,.vNews_s_c li a:link,.vNews_s_c li a:visited{font-size:12px;color:#666;line-height:20px;height:20px;} 342 | .vNews_s_c li a:hover{color:#236fd4;text-decoration:underline;} 343 | .word_nav2{border-bottom:1px solid #D9E2E9;height:31px;} -------------------------------------------------------------------------------- /cache/donate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

13 |

作者程序猿一枚,最缺的不是money,是大家的支持,撒花~

14 |

这是猿儿们的精神食粮

15 |

Openyoudao这道小菜大家还满意吧?

16 |

不妨扫个码,支持一下这道无名小菜

17 |

%index%

18 |

19 | 20 | 21 | -------------------------------------------------------------------------------- /cache/expand.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

欢迎使用有道字典 linux版

13 |

所有配置工作通过选词功能完成,找到您想要的选项,然后用鼠标选取右边对应指令即可.

14 |

汉英互译            %zh2en%          汉英例句               %zh2enlj%               返回配置页           %index%

15 |

汉日互译            %zh2jap%         汉日例句               %zh2japlj%               使用说明               %helps%

16 |

汉韩互译            %zh2ko%           汉韩例句               %zh2kolj%               退出程序               %exits%

17 |

  汉法互译            %zh2fr%           汉法例句               %zh2frlj%                 展开选项               %expand%

18 |

谷歌翻译            %goslate%          锁定取词               %lock%               取词历史                 %history%

19 |

20 | 21 | 22 | -------------------------------------------------------------------------------- /cache/google.html: -------------------------------------------------------------------------------- 1 | Untitled Document 2 |

Source Language: en

3 |

Target Language : zh

4 |

Selected Text: haha

5 |

Target Text: haha

6 |

%index%    %expand%

7 | 8 | -------------------------------------------------------------------------------- /cache/goslate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

欢迎使用google翻译,google翻译作为免费的翻译服务,可提供 72 种语言之间的即时翻译.

13 |

它可以提供所支持的任意两种语言之间的字词、句子和网页翻译

14 |

2011年12月谷歌关闭了免费翻译服务,openyoudao在免费翻译项目Goslate的基础上

15 |

融入了便捷取词的特性,极大的方便了用户使用,弥补了有道字典在多语言翻译方面的缺憾

16 |

用户无需指定待翻译语言的种类,openyoudao可以自动识别语言类型,翻译成中文

17 |

还在犹豫什么?开始调戏吧~

18 |

%index%      %expand%

19 |

20 | 21 | 22 | -------------------------------------------------------------------------------- /cache/help.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

Openyoudao核心功能是取词,在整个使用过程中无需触碰键盘

13 |

程序的配置、功能切换以及退出都是通过取词完成的

14 |

听起来是不是很Geek?哈哈 这就是openyoudao

15 |

讲解完毕,返回主页,尽情品尝吧~

16 |

%index%

17 |

18 | 19 | 20 | -------------------------------------------------------------------------------- /cache/images/donate/alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justzx2011/openyoudao/6fc7a9c0266cf1fc73269df3b8500e9bdc3953ab/cache/images/donate/alipay.png -------------------------------------------------------------------------------- /cache/images/icon/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justzx2011/openyoudao/6fc7a9c0266cf1fc73269df3b8500e9bdc3953ab/cache/images/icon/icon.jpg -------------------------------------------------------------------------------- /cache/js/autocomplete.r156903.js: -------------------------------------------------------------------------------- 1 | var SC={create:function(){return function(){this.initialize.apply(this,arguments)}}};function $S(){var _=[],$;for(var A=0;A0)this.kf=$;else this.kf=$+this.KEYFROM_POST},getSearchUrl:function($){return encodeURI(this.searchServ+this.searchParamName+"="+$+"&keyfrom="+this.kf+this.searchMoreParams)},getSugQueryUrl:function(A,B,$){var _=screen.height+""+screen.width;return encodeURI(this.sugServ+this.S_QUERY_URL_POST+A+"&o="+this.oN+"&uid="+this.uid+"&keyfrom="+this.kf+"&r="+_+this.sugMoreParams+this.hour())},log:function(D,C,B,_,$){var A="";if(C)A+=C;if(B)A+=B;if(_)A+=_;if($)A+=$;var E=new Image();E.src=encodeURI(this.logServ+this.S_LOG_URL_POST+D+A+"&uid="+this.uid+this.time());return true},setSugIcon:function(B){var _=this.oN+"_icon";if(document.getElementById(_))document.body.removeChild(document.getElementById(_));this.icon=document.createElement("img");this.icon.id=_;this.icon.src=B;this.icon.style.position="absolute";this.icon.style.zIndex="99";this.icon.style.width="13px";this.icon.style.height="10px";this.icon.style.cursor="pointer";var A=this.box,$=SP.cumOffset(A);this.icon.style.left=($[0]+A.offsetWidth-13*1.5)+"px";this.icon.style.top=($[1]+(A.offsetHeight-10)/2)+"px";this.icon.style.display="";document.body.appendChild(this.icon);SEvent.observe(this.icon,"click",this.pressPoint.sbAEListener(this));SEvent.observe(this.icon,"mouseover",this.onmouseover2.sbAEListener(this));SEvent.observe(this.icon,"mouseout",this.onmouseout2.sbAEListener(this))},dblClick:function(){if(this.box.createTextRange){var $=this.box.createTextRange();$.moveStart("character",0);$.select()}else if(this.box.setSelectionRange)this.box.setSelectionRange(0,this.box.value.length);if(this.sugFlag){if(this.box.value!=""){if(this.lq==this.box.value){if(this.sdiv.childNodes.length>0)if(!this.vis)this.show();else this.hide();return}this.doReq()}}else if(this.box.value!="")this.insertSugHint()},winResize:function(){if(this.vis)this.show();if(!this.hI)this.setSugIcon(this.iconUrl)},storeOldValue:function(){if(this.oldValForCtrlZNum0){this.box.value=this.oldValForCtrlZ[--this.oldValForCtrlZNum];if(this.box.value!="")this.ctrlZFlag=true;else this.oldVal="";this.upDownTag=false}if(this.IE)_.returnValue=false;else _.preventDefault();return false}return true}switch(_.keyCode){case SK.PAGE_UP:case SK.PAGE_DOWN:case SK.END:case SK.HOME:case SK.INSERT:case SK.CTRL:case SK.ALT:case SK.LEFT:case SK.RIGHT:case SK.SHIFT:case SK.TAB:return true;case SK.ESC:this.hide();return false;case SK.UP:if(this.vis&&this.sugFlag){this.upDownTag=true;this.up()}else{if(this.sdiv.childNodes.length>1)if(this.lq==this.box.value)if(this.sugFlag){this.show();return false}if(this.box.value!="")this.doReq()}if(this.IE)_.returnValue=false;else _.preventDefault();return false;case SK.DOWN:if(this.vis&&this.sugFlag){this.upDownTag=true;this.down()}else{if(this.sdiv.childNodes.length>1)if(this.lq==this.box.value)if(this.sugFlag){this.show();return false}if(this.box.value!="")this.doReq()}if(this.IE)_.returnValue=false;else _.preventDefault();return false;case SK.RETURN:if(this.vis&&this.curNodeIdx>-1)if(!this.select()){if(this.IE)_.returnValue=false;else _.preventDefault();return false}return true;case SK.BACKSPACE:if(this.box.value.length==1){this.storeOldValue();this.oldVal=""}default:this.upDownTag=false;return true}},sugReq:function(){if(document.activeElement&&document.activeElement!=this.box);else if(this.box.value!=""&&this.box.value!=this.initVal){this.initVal="";if(this.lq!=this.box.value)if(!this.upDownTag)this.doReq()}else if(this.lq!=""){this.lq="";if(this.vis){this.hide();this.clean()}}if(this.timeoutId!=0)clearTimeout(this.timeoutId);this.timeoutId=setTimeout(this.sugReq.sbind(this),this.REQUEST_TIMEOUT)},getSiteResult:function(B){var D=new RegExp("<[s][p][a][n].*>.*");m=D.exec(B);if(m==null){D=new RegExp("<[aA].*>.*");m=D.exec(B)}if(m==null){var F=B.indexOf("HREF=\"");if(F!=-1){var E=B.indexOf("\"",F+6),_=B.substring(F+6,E);return _}return null}else{var $=new RegExp("[hH][rR][eE][fF]=.*><[fF][oO][nN][tT]"),C=$.exec(m);if(C[0].length<=13)return null;var A=C[0].split(" "),_;if(A.length>1)_=A[0].substr(6,A[0].length-7);else _=A[0].substr(6,A[0].length-13);return _}},getSelValue:function($){return $.replace(/this.txtBox.value=/,"").replace(/\'/g,"")},select:function($){if($){if(this.getCurNode()){var _=this.getCurNode().innerHTML,A=this.getSiteResult(_);if(A!=null){this.log(this.LOG_MOUSE_SELECT,"&q="+this.oldVal,"&index=0","&select="+A,"&direct=true");this.hide();document.location=A}else{try{var D=this.getCurNode().getAttribute(this.ITEM_SEL_ATTR_NAME),C=this.getSelValue(D);if(this.oldVal!=C)this.storeOldValue();this.log(this.LOG_MOUSE_SELECT,"&q="+this.oldVal,"&index="+this.curNodeIdx,"&select="+C);this.oldVal=C;this.hide();if(this.scb!=null)this.scb(C,this);else{this.box.value=C;this.clearOldValue();this.hide();var B=this.getSearchUrl(C);document.location=B}}catch($){}}}}else if(this.getCurNode()){_=this.getCurNode().innerHTML,A=this.getSiteResult(_);if(A!=null){this.log(this.LOG_KEY_SELECT,"&q="+this.oldVal,"&index=0","&select="+A,"&direct=true");this.hide();document.location=A}else{try{D=this.getCurNode().getAttribute(this.ITEM_SEL_ATTR_NAME),C=this.getSelValue(D);if(this.oldVal!=C)this.storeOldValue();if(this.box.value!=C)return true;else this.log(this.LOG_KEY_SELECT,"&q="+this.oldVal,"&index="+this.curNodeIdx,"&select="+C);this.oldVal=C;this.hide();if(this.scb!=null)this.scb(this.box.value,this);else{this.clearOldValue();this.hide();B=this.getSearchUrl(this.box.value);document.location=B}}catch($){}}}return false},doReq:function($){if(!this.sugFlag)return;if($=="undefined"||$==null){if(this.oldVal!=this.box.value&&!this.ctrlZFlag)this.storeOldValue();this.oldVal=this.box.value;this.ctrlZFlag=false;this.lq=this.box.value;var $=this.box.value}this.count++;var A=encodeURIComponent(document.URL),_=this.getSugQueryUrl($,A,this.count);this.excuteCall(_)},clean:function(){this.size=0;this.curNodeIdx=-1;this.sdiv.innerHTML="";this.bdiv.innerHTML=""},onComplete:function(){setTimeout(this.updateContent.sbind(this,arguments[0]),5)},cleanScript:function(){while(this.sptDiv.childNodes.length>0)this.sptDiv.removeChild(this.sptDiv.firstChild)},isValidNode:function($){return($.nodeType==1)&&($.getAttribute(this.ITEM_SEL_ATTR_NAME))},getReqStr:function($){if($&&$.getElementsByTagName("div").length>0)return $.getElementsByTagName("div")[0].getAttribute("id");return null},updateContent:function(){this.cleanScript();var C=this.box.value;if(this.bdiv.innerHTML=="")if(this.sdiv.innerHTML!=""&&this.getReqStr(this.sdiv)==C)return;else{this.hide();this.clean();return}if(this.getReqStr(this.bdiv)!=C)if(this.sdiv.innerHTML!=""&&this.getReqStr(this.sdiv)==C)return;else{this.hide();return}var A,_=false,B=(((this.bdiv.getElementsByTagName("table"))[1]).getElementsByTagName("tr"));for(var D=0;D=3)this.bindATagWithMouseEvent($[2],false);this.show();this.mouseTag=false}else{this.hide();this.clean()}},showContent:function(){var $=SP.cumOffset(this.box);this.sdiv.style.top=$[1]+(this.box.offsetHeight-1)+"px";this.sdiv.style.left=$[0]+"px";this.sdiv.style.cursor="default";this.sdiv.style.width=this.box.offsetWidth+"px";SElement.show(this.sdiv);this.vis=true;this.curNodeIdx=-1},show:function(){if(this.sdiv.childNodes.length<1)return;if(this.sugFlag)if(this.getReqStr(this.sdiv)!=this.box.value)return;this.showContent()},hide:function(){this.hlOff();SElement.hide(this.sdiv);this.curNodeIdx=-1;this.vis=false},hide2:function(){if(this.clickEnabled){this.hide();this.clickEnabled=false;setTimeout(this.enableClick.sbind(this),60)}},enableClick:function(){this.clickEnabled=true},onmousemove:function($){this.mouseTag=true;this.onmouseover($)},onmouseover:function(_){this.box.onblur=null;if(!this.mouseTag){this.mouseTag=true;return}var A=SEvent.element(_);while(A.parentNode&&(!A.tagName||(A.getAttribute(this.ITEM_INDEX_ATTR_NAME)==null)))A=A.parentNode;var $=(A.tagName)?A.getAttribute(this.ITEM_INDEX_ATTR_NAME):-1;if($==-1||$==this.curNodeIdx)return;this.hlOff();this.curNodeIdx=Number($);this.hlOn(false)},onmouseout:function(){this.hlOff();this.curNodeIdx=-1;this.box.onblur=this.hide.sbAEListener(this)},getNode:function($){if(this.childs&&($>=0&&$0){this.hlOff();this.curNodeIdx=$-1;this.hlOn(true)}else if(this.curNodeIdx==0){this.hlOff();this.curNodeIdx=$-1;this.box.value=this.oldVal}else{this.curNodeIdx=this.size-1;this.hlOn(true)}},down:function(){var $=this.curNodeIdx;if(this.curNodeIdx<0){this.curNodeIdx=$+1;this.hlOn(true)}else if(this.curNodeIdx<(this.size-1)){this.hlOff();this.curNodeIdx=$+1;this.hlOn(true)}else{this.hlOff();this.curNodeIdx=-1;this.box.value=this.oldVal}},excuteCall:function(_){var $=document.createElement("script");$.src=_;this.sptDiv.appendChild($)},updateCall:function($){$=unescape($);this.bdiv.innerHTML=$;if(this.bdiv.childNodes.length<2)this.bdiv.innerHTML="";this.onComplete()},closeSuggest:function($){this.sugFlag=false},focusBox:function(){this.box.focus();if(this.box.createTextRange){var $=this.box.createTextRange();$.moveStart("character",this.box.value.length);$.select()}else if(this.box.setSelectionRange)this.box.setSelectionRange(this.box.value.length,this.box.value.length)},pressPoint:function($){if(this.clickEnabled){this.clickEnabled=false;setTimeout(this.enableClick.sbind(this),20);this.log(this.LOG_ICON_PRESS,"&q="+this.box.value,"&visible="+this.vis);this.focusBox();if(!this.vis){if(this.sugFlag){if(this.box.value=="")this.insertInputHint();else if(this.lq!=this.box.value){this.doReq();setTimeout(this.showNoSug.sbind(this),200)}else if(this.sdiv.innerHTML==""){this.doReq();setTimeout(this.showNoSug.sbind(this),200)}else if(this.sdiv.childNodes.length<2)this.insertNoSugHint();else this.show()}else this.insertSugHint()}else this.hide()}},showNoSug:function(){if(this.sdiv.childNodes.length<1)this.insertNoSugHint()},showSugHint:function(){if(this.sdiv.childNodes.length<1)return;this.showContent()},onCompleteHint:function(){setTimeout(this.showSugHint.sbind(this,arguments[0]),5)},onmouseover2:function($){this.box.onblur=null},onmouseout2:function(){this.box.onblur=this.hide.sbAEListener(this)},bindATagWithMouseEvent:function(C,_){try{if(this.hC)if(C.parentNode){C.parentNode.removeChild(C);return}}catch(A){}var $=C.getElementsByTagName("A");if($.length==0)$=C.getElementsByTagName("a");var B=$[0];if(_)SEvent.observe(B,"click",this.turnOnSuggest.sbAEListener(this));else SEvent.observe(B,"click",this.turnOffSuggest.sbAEListener(this));SEvent.observe(B,"mouseover",this.onmouseover2.sbAEListener(this));SEvent.observe(B,"mouseout",this.onmouseout2.sbAEListener(this))},insertSugHint:function(){this.insertHint("\u63d0\u793a\u529f\u80fd\u5df2\u5173\u95ed","\u6253\u5f00\u63d0\u793a\u529f\u80fd",true)},insertInputHint:function(){this.insertHint("\u5728\u641c\u7d22\u6846\u4e2d\u8f93\u5165\u5173\u952e\u5b57\uff0c\u5373\u4f1a\u5728\u8fd9\u91cc\u51fa\u73b0\u63d0\u793a","\u5173\u95ed\u63d0\u793a\u529f\u80fd",false)},insertNoSugHint:function(){this.insertHint("\u6ca1\u6709\u53ef\u7528\u7684\u63d0\u793a","\u5173\u95ed\u63d0\u793a\u529f\u80fd",false)},insertHint:function(_,A,$){this.sdiv.innerHTML=this.hintCode1+_+this.hintCode2+A+this.hintCode3;var B=this.sdiv.getElementsByTagName("table")[2];this.bindATagWithMouseEvent(B,$);this.onCompleteHint()},getSugStatus:function(){var $=this.getCookie(this.sugCookieName);if($=="")return true;else return false},turnOnSuggest:function(){this.setCookie(this.sugCookieName,"",-1);this.log(this.CHANGE_SUG_STATUS,"&s=open&q="+this.box.value);this.sugFlag=true;this.lq="";this.initVal=this.box.value;this.oldVal=this.initVal;this.upDownTag=false;if(this.vis)this.hide();this.clean();return false},turnOffSuggest:function(){this.setCookie(this.sugCookieName,"1",365);this.log(this.CHANGE_SUG_STATUS,"&s=close&q="+this.box.value);if(this.vis)this.hide();this.clean();this.sugFlag=false;return false},getCookieVal:function(_){var $=document.cookie.indexOf(";",_);if($==-1)$=document.cookie.length;return unescape(document.cookie.substring(_,$))},getCookie:function(A){var _=A+"=",$=_.length,B=document.cookie.length,D=0;while(D
",hintCode2:"
",hintCode3:"
",REQUEST_TIMEOUT:7,ITEM_INDEX_ATTR_NAME:"s_index",ITEM_HIGHLIGHT_STYLE:"aa_highlight",ITEM_SEL_ATTR_NAME:"onSelect",CZNUM:10,KEYFROM_POST:".suggest",S_QUERY_URL_POST:"/suggest/suggest.s?query=",S_LOG_URL_POST:"/suggest/clog.s?type=",defSugServ:"http://"+document.domain,defSearchServ:"http://"+document.domain+"/search?",defSearchParamName:"q",defKeyfrom:document.domain.replace(/.youdao.com/,""),defSugName:"aa",defSugIconUrl:"http://shared.youdao.com/images/downarrow.gif",sugCookieName:"SUG_STATUS"};function turnOffSuggest(){return true}function closeSuggest($){if($==null||$=="undefined")$=AutoComplete.defSugName;if(typeof $!="object")return;$.closeSuggest();return true} -------------------------------------------------------------------------------- /cache/js/extra.js: -------------------------------------------------------------------------------- 1 | var global = { 2 | fromVm:{ 3 | searchDomain:'youdao.com' 4 | } 5 | }; 6 | function rwt(a, newlink) { 7 | try { 8 | if (a === window) { 9 | a = window.event.srcElement; 10 | while (a) { 11 | if (a.href) 12 | break; 13 | a = a.parentNode 14 | } 15 | } 16 | a.href = newlink; 17 | a.onmousedown = "" 18 | } catch (p) { 19 | } 20 | return true 21 | } 22 | -------------------------------------------------------------------------------- /cache/js/huaci.js: -------------------------------------------------------------------------------- 1 | var iciba_huaci_url ="http://open.iciba.com/huaci/"; 2 | var ICIBA_HUAYI_Str = ''; 3 | var ICIBA_HUAYI_ALLOW = 1; 4 | ICIBA_HUAYI_Str += ''; 5 | ICIBA_HUAYI_Str += ''; 6 | ICIBA_HUAYI_Str += ''; 35 | ICIBA_HUAYI_Str += ''; 36 | ICIBA_HUAYI_Str += ' '; 37 | ICIBA_HUAYI_Str += ''; 38 | ICIBA_HUAYI_Str += ''; 39 | ICIBA_HUAYI_Str += ''; 40 | ICIBA_HUAYI_Str += ''; 41 | ICIBA_HUAYI_Str += ' '; 42 | ICIBA_HUAYI_Str += ' '; 43 | ICIBA_HUAYI_Str += ' '; 44 | ICIBA_HUAYI_Str += ' '; 45 | ICIBA_HUAYI_Str += ' '; 46 | ICIBA_HUAYI_Str += ' '; 47 | ICIBA_HUAYI_Str += ' '; 48 | document.write(ICIBA_HUAYI_Str); 49 | 50 | -------------------------------------------------------------------------------- /cache/js/icibatop.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justzx2011/openyoudao/6fc7a9c0266cf1fc73269df3b8500e9bdc3953ab/cache/js/icibatop.js -------------------------------------------------------------------------------- /cache/js/jquery.sidebar.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jquery.sidebar v1.0.2 3 | * http://sideroad.secret.jp/ 4 | * 5 | * Copyright (c) 2009 sideroad 6 | * 7 | * Dual licensed under the MIT or GPL Version 2 licenses. 8 | * Date: 2009-09-01 9 | */ 10 | (function( $, _window ) { 11 | $.fn.sidebar = function(options){ 12 | 13 | 14 | return this.each(function(){ 15 | 16 | var elem = $(this), 17 | data = elem.data("sidebar")||{}, 18 | margin, 19 | width, 20 | height, 21 | duration = data.duration, 22 | injectWidth, 23 | injectHeight, 24 | injectCss, 25 | containerCss, 26 | bodyCss, 27 | position, 28 | enter, 29 | leave, 30 | opened, 31 | closed, 32 | isInnerElement, 33 | container = $("
"), 34 | inject = $("
"), 35 | body = $("
"), 36 | root, 37 | parent, 38 | open = function(){ 39 | var data = elem.data("sidebar") || {}, 40 | opened = data.callback.sidebar.open, 41 | container = data.container, 42 | inject = data.inject, 43 | body = data.body; 44 | 45 | if (data.isEnter) return; 46 | if (data.isProcessing) return; 47 | data.isEnter = true; 48 | data.isProcessing = true; 49 | container.animate(data.animate.container.enter, { 50 | duration: duration, 51 | complete: function(){ 52 | inject.fadeOut(duration, function(){ 53 | body.show("clip", duration,function(){ 54 | data.isProcessing = false; 55 | if(opened) opened(); 56 | }); 57 | }); 58 | } 59 | }); 60 | }, 61 | close = function(){ 62 | var data = elem.data("sidebar") || {}, 63 | closed = data.callback.sidebar.close, 64 | container = data.container, 65 | inject = data.inject, 66 | body = data.body; 67 | 68 | if(!data.isEnter) return; 69 | if(data.isProcessing) return; 70 | data.isProcessing = true; 71 | container.animate(data.animate.container.leave, { 72 | duration: duration, 73 | complete: function(){ 74 | body.hide("clip", duration, function(){ 75 | inject.fadeIn(duration, function(){ 76 | data.isEnter = false; 77 | data.isProcessing = false; 78 | if(closed) closed(); 79 | }); 80 | }); 81 | } 82 | }); 83 | }; 84 | 85 | 86 | if(typeof options == "string"){ 87 | switch(options){ 88 | case "open" : 89 | open(); 90 | break; 91 | case "close" : 92 | close(); 93 | break; 94 | } 95 | return; 96 | } 97 | 98 | //default setting 99 | options = $.extend(true, { 100 | root : $(document.body), 101 | position : "left", 102 | callback: { 103 | item : { 104 | enter : function(){ 105 | $(this).animate({marginLeft:"5px"},250); 106 | }, 107 | leave : function(){ 108 | $(this).animate({marginLeft:"0px"},250); 109 | } 110 | }, 111 | sidebar : { 112 | open : function(){ 113 | 114 | }, 115 | close : function(){ 116 | 117 | } 118 | } 119 | }, 120 | animate : { 121 | container : { 122 | enter : {}, 123 | leave : {} 124 | } 125 | }, 126 | duration : 200, 127 | open : "mouseenter.sidebar", 128 | close : "mouseleave.sidebar" 129 | }, options); 130 | 131 | root = options.root; 132 | isInnerElement = !root.is(document.body); 133 | parent = ( isInnerElement ) ? root.addClass("sidebar-root") : $(_window); 134 | 135 | position = options.position; 136 | duration = options.duration; 137 | 138 | container.attr("id", "jquerySideBar" + new Date().getTime()).addClass("sidebar-container").addClass(position); 139 | inject.addClass("sidebar-inject").addClass(position); 140 | body.addClass("sidebar-body"); 141 | 142 | //append to body 143 | body.append(this); 144 | container.append(body); 145 | container.append(inject); 146 | root.append(container); 147 | 148 | width = container.width(); 149 | height = container.height(); 150 | injectWidth = inject.width(); 151 | injectHeight = inject.height(); 152 | 153 | containerCss = { 154 | height: height, 155 | width: width 156 | }; 157 | bodyCss = { 158 | height: height, 159 | width: width 160 | }; 161 | 162 | if(position == "left" || position == "right") { 163 | margin = width - injectWidth; 164 | injectCss = { 165 | height : height, 166 | width : injectWidth 167 | }; 168 | containerCss.top = options.top || (parent.height()/2) - (height/2) + "px"; 169 | 170 | } else { 171 | margin = height - injectHeight; 172 | injectCss = { 173 | height : injectHeight, 174 | width : width 175 | }; 176 | containerCss.left = options.left || (parent.width()/2) - (width/2) + "px"; 177 | } 178 | 179 | containerCss[position] = "-" + margin + "px"; 180 | injectCss[position] = margin + "px"; 181 | options.animate.container.enter[position] = 0; 182 | options.animate.container.leave[position] = "-" + margin; 183 | 184 | //container 185 | container.css(containerCss); 186 | 187 | //inject 188 | inject.css(injectCss); 189 | 190 | //body 191 | body.css(bodyCss).hide(); 192 | 193 | //menu callback 194 | $(this).addClass("sidebar-menu").find("li") 195 | .bind("mouseenter.sidebar",options.callback.item.enter) 196 | .bind("mouseleave.sidebar",options.callback.item.leave); 197 | 198 | //container events 199 | if(options.open) container.bind(options.open,open); 200 | if(options.close) container.bind(options.close,close); 201 | 202 | //store data 203 | options.container = container; 204 | options.inject = inject; 205 | options.body = body; 206 | elem.data("sidebar", options); 207 | 208 | parent.resize(function(){ 209 | if(position == "left" || position == "right") { 210 | container.css({top:($(this).height()/2) - (height/2) + "px"}); 211 | } else { 212 | container.css({left:($(this).width()/2) - (width/2) + "px"}); 213 | } 214 | }); 215 | 216 | }); 217 | }; 218 | })(jQuery, this); -------------------------------------------------------------------------------- /cache/js/jsScrollbar.js: -------------------------------------------------------------------------------- 1 | //Written by Nathan Faubion: http://n-son.com 2 | //Use this or edit how you want, just give me 3 | //some credit! 4 | function jsScrollbar (o, s, a, ev) { 5 | var self = this; 6 | 7 | this.reset = function () { 8 | //Arguments that were passed 9 | this._parent = o; 10 | this._src = s; 11 | this.auto = a ? a : false; 12 | this.eventHandler = ev ? ev : function () {}; 13 | //Component Objects 14 | this._up = this._findComponent("Scrollbar-Up", this._parent); 15 | this._down = this._findComponent("Scrollbar-Down", this._parent); 16 | this._yTrack = this._findComponent("Scrollbar-Track", this._parent); 17 | this._yHandle = this._findComponent("Scrollbar-Handle", this._yTrack); 18 | //Height and position properties 19 | this._trackTop = findOffsetTop(this._yTrack); 20 | this._trackHeight = this._yTrack.offsetHeight; 21 | this._handleHeight = this._yHandle.offsetHeight; 22 | this._x = 0; 23 | this._y = 0; 24 | //Misc. variables 25 | this._scrollDist = 5; 26 | this._scrollTimer = null; 27 | this._selectFunc = null; 28 | this._grabPoint = null; 29 | this._tempTarget = null; 30 | this._tempDistX = 0; 31 | this._tempDistY = 0; 32 | this._disabled = false; 33 | this._ratio = (this._src.totalHeight - this._src.viewableHeight)/(this._trackHeight - this._handleHeight); 34 | 35 | this._yHandle.ondragstart = function () {return false;}; 36 | this._yHandle.onmousedown = function () {return false;}; 37 | this._addEvent(this._src.content, "mousewheel", this._scrollbarWheel); 38 | this._removeEvent(this._parent, "mousedown", this._scrollbarClick); 39 | this._addEvent(this._parent, "mousedown", this._scrollbarClick); 40 | 41 | this._src.reset(); 42 | with (this._yHandle.style) { 43 | top = "0px"; 44 | left = "0px"; 45 | } 46 | this._moveContent(); 47 | 48 | if (this._src.totalHeight < this._src.viewableHeight) { 49 | this._disabled = true; 50 | this._yHandle.style.visibility = "hidden"; 51 | if (this.auto) this._parent.style.visibility = "hidden"; 52 | } else { 53 | this._disabled = false; 54 | this._yHandle.style.visibility = "visible"; 55 | this._parent.style.visibility = "visible"; 56 | } 57 | }; 58 | this._addEvent = function (o, t, f) { 59 | if (o.addEventListener) o.addEventListener(t, f, false); 60 | else if (o.attachEvent) o.attachEvent('on'+ t, f); 61 | else o['on'+ t] = f; 62 | }; 63 | this._removeEvent = function (o, t, f) { 64 | if (o.removeEventListener) o.removeEventListener(t, f, false); 65 | else if (o.detachEvent) o.detachEvent('on'+ t, f); 66 | else o['on'+ t] = null; 67 | }; 68 | this._findComponent = function (c, o) { 69 | var kids = o.childNodes; 70 | for (var i = 0; i < kids.length; i++) { 71 | if (kids[i].className && kids[i].className == c) { 72 | return kids[i]; 73 | } 74 | } 75 | }; 76 | //Thank you, Quirksmode 77 | function findOffsetTop (o) { 78 | var t = 0; 79 | if (o.offsetParent) { 80 | while (o.offsetParent) { 81 | t += o.offsetTop; 82 | o = o.offsetParent; 83 | } 84 | } 85 | return t; 86 | }; 87 | this._scrollbarClick = function (e) { 88 | if (self._disabled) return false; 89 | 90 | e = e ? e : event; 91 | if (!e.target) e.target = e.srcElement; 92 | 93 | if (e.target.className.indexOf("Scrollbar-Up") > -1) self._scrollUp(e); 94 | else if (e.target.className.indexOf("Scrollbar-Down") > -1) self._scrollDown(e); 95 | else if (e.target.className.indexOf("Scrollbar-Track") > -1) self._scrollTrack(e); 96 | else if (e.target.className.indexOf("Scrollbar-Handle") > -1) self._scrollHandle(e); 97 | 98 | self._tempTarget = e.target; 99 | self._selectFunc = document.onselectstart; 100 | document.onselectstart = function () {return false;}; 101 | 102 | self.eventHandler(e.target, "mousedown"); 103 | self._addEvent(document, "mouseup", self._stopScroll, false); 104 | 105 | return false; 106 | }; 107 | this._scrollbarDrag = function (e) { 108 | e = e ? e : event; 109 | var t = parseInt(self._yHandle.style.top); 110 | var v = e.clientY + document.body.scrollTop - self._trackTop; 111 | with (self._yHandle.style) { 112 | if (v >= self._trackHeight - self._handleHeight + self._grabPoint) 113 | top = self._trackHeight - self._handleHeight +"px"; 114 | else if (v <= self._grabPoint) top = "0px"; 115 | else top = v - self._grabPoint +"px"; 116 | self._y = parseInt(top); 117 | } 118 | 119 | self._moveContent(); 120 | }; 121 | this._scrollbarWheel = function (e) { 122 | e = e ? e : event; 123 | var dir = 0; 124 | if (e.wheelDelta >= 120) dir = -1; 125 | if (e.wheelDelta <= -120) dir = 1; 126 | 127 | self.scrollBy(0, dir * 20); 128 | e.returnValue = false; 129 | }; 130 | this._startScroll = function (x, y) { 131 | this._tempDistX = x; 132 | this._tempDistY = y; 133 | this._scrollTimer = window.setInterval(function () { 134 | self.scrollBy(self._tempDistX, self._tempDistY); 135 | }, 40); 136 | }; 137 | this._stopScroll = function () { 138 | self._removeEvent(document, "mousemove", self._scrollbarDrag, false); 139 | self._removeEvent(document, "mouseup", self._stopScroll, false); 140 | 141 | if (self._selectFunc) document.onselectstart = self._selectFunc; 142 | else document.onselectstart = function () { return true; }; 143 | 144 | if (self._scrollTimer) window.clearInterval(self._scrollTimer); 145 | self.eventHandler (self._tempTarget, "mouseup"); 146 | }; 147 | this._scrollUp = function (e) {this._startScroll(0, -this._scrollDist);}; 148 | this._scrollDown = function (e) {this._startScroll(0, this._scrollDist);}; 149 | this._scrollTrack = function (e) { 150 | var curY = e.clientY + document.body.scrollTop; 151 | this._scroll(0, curY - this._trackTop - this._handleHeight/2); 152 | }; 153 | this._scrollHandle = function (e) { 154 | var curY = e.clientY + document.body.scrollTop; 155 | this._grabPoint = curY - findOffsetTop(this._yHandle); 156 | this._addEvent(document, "mousemove", this._scrollbarDrag, false); 157 | }; 158 | this._scroll = function (x, y) { 159 | if (y > this._trackHeight - this._handleHeight) 160 | y = this._trackHeight - this._handleHeight; 161 | if (y < 0) y = 0; 162 | 163 | this._yHandle.style.top = y +"px"; 164 | this._y = y; 165 | 166 | this._moveContent(); 167 | }; 168 | this._moveContent = function () { 169 | this._src.scrollTo(0, Math.round(this._y * this._ratio)); 170 | }; 171 | 172 | this.scrollBy = function (x, y) { 173 | this._scroll(0, (-this._src._y + y)/this._ratio); 174 | }; 175 | this.scrollTo = function (x, y) { 176 | this._scroll(0, y/this._ratio); 177 | }; 178 | this.swapContent = function (o, w, h) { 179 | this._removeEvent(this._src.content, "mousewheel", this._scrollbarWheel, false); 180 | this._src.swapContent(o, w, h); 181 | this.reset(); 182 | }; 183 | 184 | this.reset(); 185 | }; -------------------------------------------------------------------------------- /cache/js/jsScroller.js: -------------------------------------------------------------------------------- 1 | //Written by Nathan Faubion: http://n-son.com 2 | //Use this or edit how you want, just give me 3 | //some credit! 4 | 5 | function jsScroller (o, w, h) { 6 | var self = this; 7 | var list = o.getElementsByTagName("div"); 8 | for (var i = 0; i < list.length; i++) { 9 | if (list[i].className.indexOf("Scroller-Container") > -1) { 10 | o = list[i]; 11 | } 12 | } 13 | 14 | //Private methods 15 | this._setPos = function (x, y) { 16 | if (x < this.viewableWidth - this.totalWidth) 17 | x = this.viewableWidth - this.totalWidth; 18 | if (x > 0) x = 0; 19 | if (y < this.viewableHeight - this.totalHeight) 20 | y = this.viewableHeight - this.totalHeight; 21 | if (y > 0) y = 0; 22 | this._x = x; 23 | this._y = y; 24 | with (o.style) { 25 | left = this._x +"px"; 26 | top = this._y +"px"; 27 | } 28 | }; 29 | 30 | //Public Methods 31 | this.reset = function () { 32 | this.content = o; 33 | this.totalHeight = o.offsetHeight; 34 | this.totalWidth = o.offsetWidth; 35 | this._x = 0; 36 | this._y = 0; 37 | with (o.style) { 38 | left = "0px"; 39 | top = "0px"; 40 | } 41 | }; 42 | this.scrollBy = function (x, y) { 43 | this._setPos(this._x + x, this._y + y); 44 | }; 45 | this.scrollTo = function (x, y) { 46 | this._setPos(-x, -y); 47 | }; 48 | this.stopScroll = function () { 49 | if (this.scrollTimer) window.clearInterval(this.scrollTimer); 50 | }; 51 | this.startScroll = function (x, y) { 52 | this.stopScroll(); 53 | this.scrollTimer = window.setInterval( 54 | function(){ self.scrollBy(x, y); }, 40 55 | ); 56 | }; 57 | this.swapContent = function (c, w, h) { 58 | o = c; 59 | var list = o.getElementsByTagName("div"); 60 | for (var i = 0; i < list.length; i++) { 61 | if (list[i].className.indexOf("Scroller-Container") > -1) { 62 | o = list[i]; 63 | } 64 | } 65 | if (w) this.viewableWidth = w; 66 | if (h) this.viewableHeight = h; 67 | this.reset(); 68 | }; 69 | 70 | //variables 71 | this.content = o; 72 | this.viewableWidth = w; 73 | this.viewableHeight = h; 74 | this.totalWidth = o.offsetWidth; 75 | this.totalHeight = o.offsetHeight; 76 | this.scrollTimer = null; 77 | this.reset(); 78 | }; -------------------------------------------------------------------------------- /cache/js/jsScrollerTween.js: -------------------------------------------------------------------------------- 1 | //Written by Nathan Faubion: http://n-son.com 2 | //Use this or edit how you want, just give me 3 | //some credit! 4 | 5 | function jsScrollerTween (o, t, s) { 6 | var self = this; 7 | 8 | this._tweenTo = function (y) { 9 | if (self._idle) { 10 | var tHeight = self._parent._src ? self._parent._src.totalHeight : self._parent.totalHeight; 11 | var vHeight = self._parent._src ? self._parent._src.viewableHeight : self._parent.viewableHeight; 12 | var scrollY = self._parent._src ? self._parent._src._y : self._parent._y; 13 | 14 | if (y < 0) y = 0; 15 | if (y > tHeight - vHeight) y = tHeight - vHeight; 16 | 17 | var dist = y - (-scrollY); 18 | 19 | self._inc = 0; 20 | self._timer = null; 21 | self._values = []; 22 | self._idle = false; 23 | for (var i = 0; i < self.steps.length; i++) { 24 | self._values[i] = Math.round((-scrollY) + dist * (self.steps[i] / 100)); 25 | } 26 | self._timer = window.setInterval(function () { 27 | self._parent.scrollTo(0, self._values[self._inc]); 28 | if (self._inc == self.steps.length-1) { 29 | window.clearTimeout(self._timer); 30 | self._idle = true; 31 | } else self._inc++; 32 | }, self.stepDelay); 33 | } 34 | }; 35 | this._tweenBy = function (y) { 36 | var scrollY = self._parent._src ? self._parent._src._y : self._parent._y; 37 | self._tweenTo(-scrollY + y); 38 | }; 39 | this._trackTween = function (e) { 40 | e = e ? e : event; 41 | self._parent.canScroll = false; 42 | var curY = e.clientY + document.body.scrollTop; 43 | self._tweenTo((curY - self._parent._trackTop - self._parent._handleHeight/2) * self._parent._ratio); 44 | }; 45 | 46 | this.stepDelay = 40; 47 | this.steps = s?s:[0,25,50,70,85,95,97,99,100]; 48 | this._values = []; 49 | this._parent = o; 50 | this._timer = []; 51 | this._idle = true; 52 | 53 | o.tweenTo = this._tweenTo; 54 | o.tweenBy = this._tweenBy; 55 | o.trackTween = this._trackTween; 56 | 57 | if (t) o._scrollTrack = function (e) { 58 | this.trackTween(e); 59 | }; 60 | }; -------------------------------------------------------------------------------- /cache/lock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

取词功能已锁定,解锁请抹黑:%lock%

13 |

14 | 15 | 16 | -------------------------------------------------------------------------------- /cache/origin.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justzx2011/openyoudao/6fc7a9c0266cf1fc73269df3b8500e9bdc3953ab/cache/origin.html -------------------------------------------------------------------------------- /cache/result.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/justzx2011/openyoudao/6fc7a9c0266cf1fc73269df3b8500e9bdc3953ab/cache/result.html -------------------------------------------------------------------------------- /cache/unlock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

取词功能已解锁,请选择待翻译的词语,或返回首页

13 |

%index%

14 |

15 | 16 | 17 | -------------------------------------------------------------------------------- /cache/zh2en.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

欢迎使用有道字典汉英互译功能

13 |

点击鼠标左键,选中要翻译的词汇,即可显示你想要的译文

14 |

%index%

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /cache/zh2enlj.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

欢迎使用有道字典汉英例句子功能

13 |

点击鼠标左键,选中要翻译的词汇,即可显示你想要的例句

14 |

%index%

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /cache/zh2fr.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

欢迎使用有道字典汉法互译功能

13 |

点击鼠标左键,选中要翻译的词汇,即可显示你想要的译文

14 |

%index%

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /cache/zh2frlj.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

欢迎使用有道字典汉法例句子功能

13 |

点击鼠标左键,选中要翻译的词汇,即可显示你想要的例句

14 |

%index%

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /cache/zh2jap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

欢迎使用有道字典汉日互译功能

13 |

点击鼠标左键,选中要翻译的词汇,即可显示你想要的译文

14 |

%index%

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /cache/zh2japlj.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

欢迎使用有道字典汉日例句子功能

13 |

点击鼠标左键,选中要翻译的词汇,即可显示你想要的例句

14 |

%index%

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /cache/zh2ko.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

欢迎使用有道字典汉韩互译功能

13 |

点击鼠标左键,选中要翻译的词汇,即可显示你想要的译文

14 |

%index%

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /cache/zh2kolj.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Openyoudao首页 9 | 10 | 11 |
12 |

欢迎使用有道字典汉韩例句子功能

13 |

点击鼠标左键,选中要翻译的词汇,即可显示你想要的例句

14 |

%index%

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /desktop/openyoudao.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Openyoudao 3 | Name[ca]=Openyoudao 4 | Name[de_DE]=Openyoudao 5 | Name[es_ES]=Openyoudao 6 | Name[es_MX]=Openyoudao 7 | Name[fr_FR]=Openyoudao 8 | Name[it_IT]=Openyoudao 9 | Name[pt_BR]=Openyoudao 10 | Name[pt_PT]=Openyoudao 11 | Name[tr_TR]=Openyoudao 12 | Name[zh_CN]=有道 13 | Name[zh_TW]=Openyoudao 14 | GenericName=Openyoudao YouDao Client 15 | GenericName[ca]=Client de YouDao Openyoudao 16 | GenericName[de_DE]=Openyoudao YouDao Client 17 | GenericName[es_ES]=Cliente de YouDao Openyoudao 18 | GenericName[es_MX]=Openyoudao Cliente YouDao 19 | GenericName[fr_FR]=Openyoudao YouDao Client 20 | GenericName[it_IT]=Openyoudao YouDao Client 21 | GenericName[pt_BR]=Cliente de YouDao Openyoudao 22 | GenericName[pt_PT]=Openyoudao Cliente YouDao 23 | GenericName[tr_TR]=Openyoudao YouDao İstemcisi 24 | GenericName[zh_CN]=有道客户端 25 | GenericName[zh_TW]=Openyoudao YouDao 用戶端 26 | X-GNOME-FullName=Openyoudao YouDao Client 27 | X-GNOME-FullName[ca]=Client de YouDao Openyoudao 28 | X-GNOME-FullName[de_DE]=Openyoudao YouDao Client 29 | X-GNOME-FullName[es_ES]=Cliente de YouDao Openyoudao 30 | X-GNOME-FullName[es_MX]=Openyoudao Cliente YouDao 31 | X-GNOME-FullName[fr_FR]=Openyoudao YouDao Client 32 | X-GNOME-FullName[it_IT]=Openyoudao YouDao Client 33 | X-GNOME-FullName[pt_BR]=Cliente de YouDao Openyoudao 34 | X-GNOME-FullName[pt_PT]=Openyoudao Cliente YouDao 35 | X-GNOME-FullName[tr_TR]=Openyoudao YouDao İstemcisi 36 | X-GNOME-FullName[zh_CN]=有道客户端 37 | X-GNOME-FullName[zh_TW]=Openyoudao YouDao 用戶端 38 | Type=Application 39 | Comment=Lightweight YouDao Client base on Gtk2 and Webkit 40 | Comment[de_DE]=Ein schlanker YouDao Client basierend auf Gtk2 und Webkit 41 | Comment[es_ES]=Cliente de YouDao basado en Gtk2 y Webkit 42 | Comment[es_MX]=Cliente YouDao liviano basado en Gtk2 y Webkit 43 | Comment[fr_FR]=Un client léger pour youdao basé sur Gtk2 et Webkit 44 | Comment[it_IT]=YouDao Client leggero basato su Gtk2 e Webkit 45 | Comment[pt_BR]=Cliente YouDao baseado em Gtk2 e Webkit 46 | Comment[pt_PT]=Cliente Leve de YouDao baseado em Gtk2 e Webkit 47 | Comment[tr_TR]=Gtk2 ve Webkit Tabanlı Hafif YouDao İstemcisi 48 | Comment[zh_CN]=基于 Gtk2 Webkit 的轻巧有道客户端 49 | Comment[zh_TW]=基於 Gtk2 Webkit 的輕巧 YouDao 用戶端 50 | Exec=openyoudao 51 | Icon=/usr/share/openyoudao/images/icon/icon.jpg 52 | Categories=GTK;GNOME;Network;Office;Dictionary; 53 | X-GNOME-Gettext-Domain=openyoudao 54 | -------------------------------------------------------------------------------- /fusionyoudao.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | try: 4 | from BeautifulSoup import BeautifulSoup 5 | except ImportError: 6 | from bs4 import BeautifulSoup 7 | import os 8 | import gl 9 | import re 10 | import popen2 11 | def reconstruct(func): 12 | print "start fusionyoudao" 13 | soup = BeautifulSoup(open(gl.origindir)) 14 | head=open(gl.headyoudao,'r') 15 | result = soup.find('div',{"id":"results"}) 16 | #sousuo = soup.find('form',{"id":"f"}) 17 | #sousuo = str(sousuo).replace("action=\"/search\"","action=\"http://dict.youdao.com/search\"") 18 | #result = str(result).replace("href=\"/example/","href=\"http://dict.youdao.com/example/") 19 | #os.system("echo "" > cache/result.html") 20 | f_tar=open(gl.resultdir,'w+') 21 | print >> f_tar,"" 22 | print >> f_tar,head.read() 23 | print >> f_tar,"" 24 | #print >> f_tar,"\n" 25 | #print >> f_tar,"
" 26 | #print >> f_tar,sousuo 27 | #print >> f_tar,"
" 28 | print >> f_tar,result 29 | print >> f_tar,"" 30 | f_tar.close() 31 | head.close() 32 | os.system("sed -i -e 's/action=\"\/search/action=\"http:\/\/dict.youdao.com\/search/g' \'"+ gl.resultdir + "\'") 33 | os.system("sed -i -e 's/href=\"\/example/href=\"http:\/\/dict.youdao.com\/example/g' \'"+ gl.resultdir + "\'") 34 | os.system("sed -i -e 's/href=\"\/simplayer.swf/href=\"http:\/\/dict.youdao.com\/simplayer.swf/g' \'"+ gl.resultdir + "\'") 35 | #os.system("sed -i -e 's/href=\"\/simplayer.swf/href=\"http:\/\/dict.youdao.com\/simplayer.swf/g' \'"+ gl.resultdir + "\'") 36 | os.system("sed -i -e 's/

目录<\/h3>/

%index%<\/h3>/g' \'"+ gl.resultdir + "\'") 37 | os.system("sed -i -e 's/bilingual\">双语例句/bilingual\">%index%/g' \'"+ gl.resultdir + "\'") 38 | os.system("sed -i -e 's/详细内容//g' \'"+ gl.resultdir + "\'") 39 | os.system("sed -i -e 's/更多双语例句//g' \'"+ gl.resultdir + "\'") 40 | os.system("sed -i -e 's/更多原声例句//g' \'"+ gl.resultdir + "\'") 41 | os.system("sed -i -e 's/更多权威例句//g' \'"+ gl.resultdir + "\'") 42 | os.system("sed -i -e '/onmousedown/'d \'"+ gl.resultdir + "\'") 43 | os.system("sed -i -e '/百度百科/'d \'"+ gl.resultdir + "\'") 44 | if func=="lj": 45 | os.system("sed -i -e '/
  • /'d \'"+ gl.resultdir + "\'") 46 | os.system("sed -i -e '/口语英文写作助手<\/a><\/span><\/li>//g' \'"+ gl.resultdir + "\'") 54 | #os.system("sed -i -e 's/http:\/\/dict.youdao.com\/writing\/?keyfrom=dictweb/file:\/\/\/usr\/share\/openyoudao\/config.html/g' \'"+ gl.resultdir + "\'") 55 | print "fusionyoudao completed" 56 | #os.system("sed -i -e 's/<\/div><\/div><\/div>/ /g' cache/result.html") 57 | -------------------------------------------------------------------------------- /gl.py: -------------------------------------------------------------------------------- 1 | #encoding=utf-8 2 | import os 3 | import sys 4 | global pre_text 5 | global cachedir 6 | global homedir 7 | global origindir 8 | global resultdir 9 | global homeurl 10 | global headyoudao 11 | global bodystartyoudao 12 | import locale 13 | #[config] 14 | lock="0" 15 | title="有道首页" 16 | #[youdao config] 17 | pre_text="" 18 | locale=locale.getdefaultlocale() 19 | userdir=os.path.expanduser('~') 20 | workdir = os.getcwd() 21 | homedir = sys.path[0] 22 | userdir=os.path.expanduser('~') 23 | cachedir = userdir + "/.openyoudao" 24 | origindir = userdir + "/.openyoudao/origin.html" 25 | resultdir = userdir + "/.openyoudao/result.html" 26 | headyoudao = "/usr/share/openyoudao/construction/youdao/head.html" 27 | bodystartyoudao = "/usr/share/openyoudao/construction/youdao/body-start.txt" 28 | homeurl = "file://" + "/usr/share/openyoudao/config.html" 29 | expandurl = "file://" + "/usr/share/openyoudao/expand.html" 30 | helpurl = "file://" + "/usr/share/openyoudao/help.html" 31 | baseurlyoudao="http://dict.youdao.com/search?q=" 32 | 33 | #[youdao lj] 34 | searchurl="http://dict.youdao.com/search?le=eng&q=" 35 | zh2en=searchurl 36 | zh2jap="http://dict.youdao.com/search?le=jap&q=" 37 | zh2ko="http://dict.youdao.com/search?le=ko&q=" 38 | zh2fr="http://dict.youdao.com/search?le=fr&q=" 39 | zh2enlj="http://dict.youdao.com/search?le=eng&q=lj%3A" 40 | zh2japlj="http://dict.youdao.com/search?le=jap&q=lj%3A" 41 | zh2kolj="http://dict.youdao.com/search?le=ko&q=lj%3A" 42 | zh2frlj="http://dict.youdao.com/search?le=fr&q=lj%3A" 43 | func="default" 44 | Dict="youdao" 45 | lang="en" 46 | 47 | #[google config] 48 | googledir = userdir + "/.openyoudao/google.html" 49 | 50 | #[common config] 51 | keyworddir = userdir + "/.openyoudao/keyword.html" 52 | historydir = userdir + "/.openyoudao/history.html" 53 | -------------------------------------------------------------------------------- /goslate.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | '''Goslate: Free Google Translate API 5 | ''' 6 | from __future__ import print_function 7 | from __future__ import unicode_literals 8 | 9 | import sys 10 | import os 11 | import json 12 | import itertools 13 | import functools 14 | import time 15 | import socket 16 | import random 17 | 18 | try: 19 | # python 3 20 | from urllib.request import build_opener, Request, HTTPHandler, HTTPSHandler 21 | from urllib.parse import quote_plus, urlencode, unquote_plus, urljoin 22 | izip = zip 23 | 24 | except ImportError: 25 | # python 2 26 | from urllib2 import build_opener, Request, HTTPHandler, HTTPSHandler 27 | from urllib import urlencode, unquote_plus, quote_plus 28 | from urlparse import urljoin 29 | from itertools import izip 30 | 31 | try: 32 | import concurrent.futures 33 | _g_executor = concurrent.futures.ThreadPoolExecutor(max_workers=120) 34 | except ImportError: 35 | _g_executor = None 36 | 37 | 38 | __author__ = 'ZHUO Qiang' 39 | __email__ = 'zhuo.qiang@gmail.com' 40 | __copyright__ = "2013, http://zhuoqiang.me" 41 | __license__ = "MIT" 42 | __date__ = '2013-05-11' 43 | __version_info__ = (1, 3, 0) 44 | __version__ = '.'.join(str(i) for i in __version_info__) 45 | __home__ = 'https://bitbucket.org/zhuoqiang/goslate' 46 | __download__ = 'https://pypi.python.org/pypi/goslate' 47 | 48 | 49 | try: 50 | unicode 51 | except NameError: 52 | unicode = str 53 | 54 | def _is_sequence(arg): 55 | return (not isinstance(arg, unicode)) and ( 56 | not isinstance(arg, bytes)) and ( 57 | hasattr(arg, "__getitem__") or hasattr(arg, "__iter__")) 58 | 59 | def _is_bytes(arg): 60 | return isinstance(arg, bytes) 61 | 62 | 63 | def _unwrapper_single_element(elements): 64 | if len(elements) == 1: 65 | return elements[0] 66 | return elements 67 | 68 | 69 | class Error(Exception): 70 | '''Error type 71 | ''' 72 | pass 73 | 74 | 75 | WRITING_NATIVE = ('trans',) 76 | '''native target language writing system''' 77 | 78 | WRITING_ROMAN = ('translit',) 79 | '''romanlized writing system. only valid for some langauges, otherwise it outputs empty string''' 80 | 81 | WRITING_NATIVE_AND_ROMAN = WRITING_NATIVE + WRITING_ROMAN 82 | '''both native and roman writing. The output will be a tuple''' 83 | 84 | class Goslate(object): 85 | '''All goslate API lives in this class 86 | 87 | You have to first create an instance of Goslate to use this API 88 | 89 | :param writing: The translation writing system. Currently 3 values are valid 90 | 91 | - :const:`WRITING_NATIVE` for native writing system 92 | - :const:`WRITING_ROMAN` for roman writing system 93 | - :const:`WRITING_NATIVE_AND_ROMAN` for both native and roman writing system. output will be a tuple in this case 94 | 95 | :param opener: The url opener to be used for HTTP/HTTPS query. 96 | If not provide, a default opener will be used. 97 | For proxy support you should provide an ``opener`` with ``ProxyHandler`` 98 | :type opener: `urllib2.OpenerDirector `_ 99 | 100 | :param retry_times: how many times to retry when connection reset error occured. Default to 4 101 | :type retry_times: int 102 | 103 | :type max_workers: int 104 | 105 | :param timeout: HTTP request timeout in seconds 106 | :type timeout: int/float 107 | 108 | :param debug: Turn on/off the debug output 109 | :type debug: bool 110 | 111 | :param service_urls: google translate url list. URLs will be used randomly for better concurrent performance. For example ``['http://translate.google.com', 'http://translate.google.de']`` 112 | :type service_urls: single string or a sequence of strings 113 | 114 | :param executor: the multi thread executor for handling batch input, default to a global ``futures.ThreadPoolExecutor`` instance with 120 max thead workers if ``futures`` is avalible. Set to None to disable multi thread support 115 | :type executor: ``futures.ThreadPoolExecutor`` 116 | 117 | .. note:: multi thread worker relys on `futures `_, if it is not avalible, ``goslate`` will work under single thread mode 118 | 119 | :Example: 120 | 121 | >>> import goslate 122 | >>> 123 | >>> # Create a Goslate instance first 124 | >>> gs = goslate.Goslate() 125 | >>> 126 | >>> # You could get all supported language list through get_languages 127 | >>> languages = gs.get_languages() 128 | >>> print(languages['en']) 129 | English 130 | >>> 131 | >>> # Tranlate English into German 132 | >>> print(gs.translate('hello', 'de')) 133 | Hallo 134 | >>> # Detect the language of the text 135 | >>> print(gs.detect('some English words')) 136 | en 137 | >>> # Get goslate object dedicated for romanlized translation (romanlization) 138 | >>> gs_roman = goslate.Goslate(WRITING_ROMAN) 139 | >>> print(gs_roman.translate('hello', 'zh')) 140 | Nǐ hǎo 141 | ''' 142 | 143 | 144 | _MAX_LENGTH_PER_QUERY = 1800 145 | 146 | def __init__(self, writing=WRITING_NATIVE, opener=None, retry_times=4, executor=_g_executor, 147 | timeout=4, service_urls=('http://translate.google.com',), debug=False): 148 | self._DEBUG = debug 149 | self._MIN_TASKS_FOR_CONCURRENT = 2 150 | self._opener = opener 151 | self._languages = None 152 | self._TIMEOUT = timeout 153 | if not self._opener: 154 | debuglevel = self._DEBUG and 1 or 0 155 | self._opener = build_opener( 156 | HTTPHandler(debuglevel=debuglevel), 157 | HTTPSHandler(debuglevel=debuglevel)) 158 | 159 | self._RETRY_TIMES = retry_times 160 | self._executor = executor 161 | self._writing = writing 162 | if _is_sequence(service_urls): 163 | self._service_urls = service_urls 164 | else: 165 | self._service_urls = (service_urls,) 166 | 167 | def _open_url(self, url): 168 | if len(url) > self._MAX_LENGTH_PER_QUERY+100: 169 | raise Error('input too large') 170 | 171 | # Google forbits urllib2 User-Agent: Python-urllib/2.7 172 | request = Request(url, headers={'User-Agent':'Mozilla/4.0'}) 173 | 174 | exception = None 175 | # retry when get (, error(54, 'Connection reset by peer') 176 | for i in range(self._RETRY_TIMES): 177 | try: 178 | response = self._opener.open(request, timeout=self._TIMEOUT) 179 | response_content = response.read().decode('utf-8') 180 | if self._DEBUG: 181 | print(response_content) 182 | return response_content 183 | except socket.error as e: 184 | if self._DEBUG: 185 | import threading 186 | print(threading.currentThread(), e) 187 | if 'Connection reset by peer' not in str(e): 188 | raise e 189 | exception = e 190 | time.sleep(0.0001) 191 | raise exception 192 | 193 | 194 | def _execute(self, tasks): 195 | first_tasks = [next(tasks, None) for i in range(self._MIN_TASKS_FOR_CONCURRENT)] 196 | tasks = (task for task in itertools.chain(first_tasks, tasks) if task) 197 | 198 | if not first_tasks[-1] or not self._executor: 199 | for each in tasks: 200 | yield each() 201 | else: 202 | exception = None 203 | for each in [self._executor.submit(t) for t in tasks]: 204 | if exception: 205 | each.cancel() 206 | else: 207 | exception = each.exception() 208 | if not exception: 209 | yield each.result() 210 | 211 | if exception: 212 | raise exception 213 | 214 | 215 | def _basic_translate(self, text, target_language, source_language): 216 | # assert _is_bytes(text) 217 | 218 | if not target_language: 219 | raise Error('invalid target language') 220 | 221 | if not text.strip(): 222 | return tuple(u'' for i in range(len(self._writing))) , unicode(target_language) 223 | 224 | # Browser request for 'hello world' is: 225 | # http://translate.google.com/translate_a/t?client=t&hl=en&sl=en&tl=zh-CN&ie=UTF-8&oe=UTF-8&multires=1&prev=conf&psl=en&ptl=en&otf=1&it=sel.2016&ssel=0&tsel=0&prev=enter&oc=3&ssel=0&tsel=0&sc=1&text=hello%20world 226 | 227 | # TODO: we could randomly choose one of the google domain URLs for concurrent support 228 | GOOGLE_TRASLATE_URL = urljoin(random.choice(self._service_urls), '/translate_a/t') 229 | GOOGLE_TRASLATE_PARAMETERS = { 230 | # 't' client will receiver non-standard json format 231 | # change client to something other than 't' to get standard json response 232 | 'client': 'z', 233 | 'sl': source_language, 234 | 'tl': target_language, 235 | 'ie': 'UTF-8', 236 | 'oe': 'UTF-8', 237 | 'text': text 238 | } 239 | 240 | url = '?'.join((GOOGLE_TRASLATE_URL, urlencode(GOOGLE_TRASLATE_PARAMETERS))) 241 | response_content = self._open_url(url) 242 | data = json.loads(response_content) 243 | 244 | # google may change space to no-break space, we may need to change it back 245 | translation = tuple(u''.join(i[part] for i in data['sentences']).replace(u'\xA0', u' ') for part in self._writing) 246 | 247 | detected_source_language = data['src'] 248 | return translation, detected_source_language 249 | 250 | 251 | def get_languages(self): 252 | '''Discover supported languages 253 | 254 | It returns iso639-1 language codes for 255 | `supported languages `_ 256 | for translation. Some language codes also include a country code, like zh-CN or zh-TW. 257 | 258 | .. note:: It only queries Google once for the first time and use cached result afterwards 259 | 260 | :returns: a dict of all supported language code and language name mapping ``{'language-code', 'Language name'}`` 261 | 262 | :Example: 263 | 264 | >>> languages = Goslate().get_languages() 265 | >>> assert 'zh' in languages 266 | >>> print(languages['zh']) 267 | Chinese 268 | 269 | ''' 270 | if self._languages: 271 | return self._languages 272 | 273 | GOOGLE_TRASLATOR_URL = 'http://translate.google.com/translate_a/l' 274 | GOOGLE_TRASLATOR_PARAMETERS = { 275 | 'client': 't', 276 | } 277 | 278 | url = '?'.join((GOOGLE_TRASLATOR_URL, urlencode(GOOGLE_TRASLATOR_PARAMETERS))) 279 | response_content = self._open_url(url) 280 | data = json.loads(response_content[1:-1]) 281 | 282 | languages = data['sl'] 283 | languages.update(data['tl']) 284 | if 'auto' in languages: 285 | del languages['auto'] 286 | if 'zh' not in languages: 287 | languages['zh'] = 'Chinese' 288 | self._languages = languages 289 | return self._languages 290 | 291 | 292 | _SEPERATORS = [quote_plus(i.encode('utf-8')) for i in 293 | u'.!?,;。,?!::"“”’‘#$%&()()*×+/<=>@#¥[\]…[]^`{|}{}~~\n\r\t '] 294 | 295 | def _translate_single_text(self, text, target_language, source_lauguage): 296 | assert _is_bytes(text) 297 | def split_text(text): 298 | start = 0 299 | text = quote_plus(text) 300 | length = len(text) 301 | while (length - start) > self._MAX_LENGTH_PER_QUERY: 302 | for seperator in self._SEPERATORS: 303 | index = text.rfind(seperator, start, start+self._MAX_LENGTH_PER_QUERY) 304 | if index != -1: 305 | break 306 | else: 307 | raise Error('input too large') 308 | end = index + len(seperator) 309 | yield unquote_plus(text[start:end]) 310 | start = end 311 | 312 | yield unquote_plus(text[start:]) 313 | 314 | def make_task(text): 315 | return lambda: self._basic_translate(text, target_language, source_lauguage)[0] 316 | 317 | results = list(self._execute(make_task(i) for i in split_text(text))) 318 | return tuple(''.join(i[n] for i in results) for n in range(len(self._writing))) 319 | 320 | 321 | def translate(self, text, target_language, source_language=''): 322 | '''Translate text from source language to target language 323 | 324 | .. note:: 325 | 326 | - Input all source strings at once. Goslate will batch and fetch concurrently for maximize speed. 327 | - `futures `_ is required for best performance. 328 | - It returns generator on batch input in order to better fit pipeline architecture 329 | 330 | :param text: The source text(s) to be translated. Batch translation is supported via sequence input 331 | :type text: UTF-8 str; unicode; string sequence (list, tuple, iterator, generator) 332 | 333 | :param target_language: The language to translate the source text into. 334 | The value should be one of the language codes listed in :func:`get_languages` 335 | :type target_language: str; unicode 336 | 337 | :param source_language: The language of the source text. 338 | The value should be one of the language codes listed in :func:`get_languages`. 339 | If a language is not specified, 340 | the system will attempt to identify the source language automatically. 341 | :type source_language: str; unicode 342 | 343 | :returns: the translated text(s) 344 | 345 | - unicode: on single string input 346 | - generator of unicode: on batch input of string sequence 347 | - tuple: if WRITING_NATIVE_AND_ROMAN is specified, it will return tuple/generator for tuple (u"native", u"roman format") 348 | 349 | :raises: 350 | - :class:`Error` ('invalid target language') if target language is not set 351 | - :class:`Error` ('input too large') if input a single large word without any punctuation or space in between 352 | 353 | 354 | :Example: 355 | 356 | >>> gs = Goslate() 357 | >>> print(gs.translate('Hello World', 'de')) 358 | Hallo Welt 359 | >>> 360 | >>> for i in gs.translate(['good', u'morning'], 'de'): 361 | ... print(i) 362 | ... 363 | gut 364 | Morgen 365 | 366 | To output romanlized translation 367 | 368 | :Example: 369 | 370 | >>> gs_roman = Goslate(WRITING_ROMAN) 371 | >>> print(gs_roman.translate('Hello', 'zh')) 372 | Nǐ hǎo 373 | 374 | ''' 375 | 376 | 377 | if not target_language: 378 | raise Error('invalid target language') 379 | 380 | if target_language.lower() == 'zh': 381 | target_language = 'zh-CN' 382 | 383 | if source_language.lower() == 'zh': 384 | source_language = 'zh-CN' 385 | 386 | if not _is_sequence(text): 387 | if isinstance(text, unicode): 388 | text = text.encode('utf-8') 389 | return _unwrapper_single_element(self._translate_single_text(text, target_language, source_language)) 390 | 391 | JOINT = u'\u26ff' 392 | UTF8_JOINT = (u'\n%s\n' % JOINT).encode('utf-8') 393 | 394 | def join_texts(texts): 395 | def convert_to_utf8(texts): 396 | for i in texts: 397 | if isinstance(i, unicode): 398 | i = i.encode('utf-8') 399 | yield i.strip() 400 | 401 | texts = convert_to_utf8(texts) 402 | text = next(texts) 403 | for i in texts: 404 | new_text = UTF8_JOINT.join((text, i)) 405 | if len(quote_plus(new_text)) < self._MAX_LENGTH_PER_QUERY: 406 | text = new_text 407 | else: 408 | yield text 409 | text = i 410 | yield text 411 | 412 | 413 | def make_task(text): 414 | def task(): 415 | r = self._translate_single_text(text, target_language, source_language) 416 | r = tuple([i.strip('\n') for i in n.split(JOINT)] for n in r) 417 | return izip(*r) 418 | # return r[0] 419 | return task 420 | 421 | return (_unwrapper_single_element(i) for i in 422 | itertools.chain.from_iterable(self._execute(make_task(i) for i in join_texts(text)))) 423 | 424 | 425 | def _detect_language(self, text): 426 | if _is_bytes(text): 427 | text = text.decode('utf-8') 428 | return self._basic_translate(text[:50].encode('utf-8'), 'en', '')[1] 429 | 430 | 431 | def detect(self, text): 432 | '''Detect language of the input text 433 | 434 | .. note:: 435 | 436 | - Input all source strings at once. Goslate will detect concurrently for maximize speed. 437 | - `futures `_ is required for best performance. 438 | - It returns generator on batch input in order to better fit pipeline architecture. 439 | 440 | :param text: The source text(s) whose language you want to identify. 441 | Batch detection is supported via sequence input 442 | :type text: UTF-8 str; unicode; sequence of string 443 | :returns: the language code(s) 444 | 445 | - unicode: on single string input 446 | - generator of unicode: on batch input of string sequence 447 | 448 | :raises: :class:`Error` if parameter type or value is not valid 449 | 450 | Example:: 451 | 452 | >>> gs = Goslate() 453 | >>> print(gs.detect('hello world')) 454 | en 455 | >>> for i in gs.detect([u'hello', 'Hallo']): 456 | ... print(i) 457 | ... 458 | en 459 | de 460 | 461 | ''' 462 | if _is_sequence(text): 463 | return self._execute(functools.partial(self._detect_language, i) for i in text) 464 | return self._detect_language(text) 465 | 466 | 467 | def _main(argv): 468 | import optparse 469 | 470 | usage = "usage: %prog [options] \n will be used as input source if no file specified." 471 | 472 | parser = optparse.OptionParser(usage=usage, version="%%prog %s @ Copyright %s" % (__version__, __copyright__)) 473 | parser.add_option('-t', '--target-language', metavar='zh-CN', 474 | help='specify target language to translate the source text into') 475 | parser.add_option('-s', '--source-language', default='', metavar='en', 476 | help='specify source language, if not provide it will identify the source language automatically') 477 | parser.add_option('-i', '--input-encoding', default=sys.getfilesystemencoding(), metavar='utf-8', 478 | help='specify input encoding, default to current console system encoding') 479 | parser.add_option('-o', '--output-encoding', default=sys.getfilesystemencoding(), metavar='utf-8', 480 | help='specify output encoding, default to current console system encoding') 481 | parser.add_option('-r', '--roman', action="store_true", 482 | help='change translation writing to roman (e.g.: output pinyin instead of Chinese charactors for Chinese. It only valid for some of the target languages)') 483 | 484 | 485 | options, args = parser.parse_args(argv[1:]) 486 | 487 | if not options.target_language: 488 | print('Error: missing target language!') 489 | parser.print_help() 490 | return 491 | 492 | writing = WRITING_NATIVE 493 | if options.roman: 494 | writing = WRITING_ROMAN 495 | 496 | gs = Goslate(writing=writing) 497 | import fileinput 498 | # inputs = fileinput.input(args, mode='rU', openhook=fileinput.hook_encoded(options.input_encoding)) 499 | inputs = fileinput.input(args, mode='rb') 500 | inputs = (i.decode(options.input_encoding) for i in inputs) 501 | outputs = gs.translate(inputs, options.target_language, options.source_language) 502 | for i in outputs: 503 | sys.stdout.write((i+u'\n').encode(options.output_encoding)) 504 | sys.stdout.flush() 505 | 506 | 507 | if __name__ == '__main__': 508 | try: 509 | _main(sys.argv) 510 | except: 511 | error = sys.exc_info()[1] 512 | if len(str(error)) > 2: 513 | print(error) 514 | -------------------------------------------------------------------------------- /install-openyoudao.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #small script to install openyoudao 3 | install -g users -o root -m 755 -d debian/openyoudao/usr/bin 4 | install -g users -o root -m 755 -d debian/openyoudao/usr/lib/openyoudao 5 | install -g users -o root -m 777 -d debian/openyoudao/usr/share/openyoudao 6 | install -g users -o root -m 755 -d debian/openyoudao/usr/share/applications 7 | install -g users -o root -v -m 755 -t debian/openyoudao/usr/bin scripts/openyoudao 8 | install -g users -o root -v -m 755 -t debian/openyoudao/usr/bin install-openyoudao.sh 9 | install -g users -o root -v -m 755 -t debian/openyoudao/usr/bin uninstall-openyoudao.sh 10 | install -g users -o root -v -m 644 -t debian/openyoudao/usr/lib/openyoudao ./*.py 11 | install -g users -o root -v -m 644 -t debian/openyoudao/usr/share/applications desktop/openyoudao.desktop 12 | cp -rf cache/* debian/openyoudao/usr/share/openyoudao 13 | chmod -R 777 debian/openyoudao/usr/share/openyoudao 14 | -------------------------------------------------------------------------------- /openyoudao.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | #-*- coding: utf-8 -*- 3 | # RECORD extension 4 | # Not very much unlike the xmacrorec2 program in the xmacro package. 5 | import popen2 6 | import goslate 7 | from time import sleep 8 | import thread 9 | import webshot 10 | import sys 11 | import fusionyoudao 12 | import gl 13 | import os 14 | import webkit, gtk 15 | # Change path so we find Xlib 16 | sys.path.insert(1, os.path.join(sys.path[0], '..')) 17 | from Xlib import X, XK, display 18 | from Xlib.ext import record 19 | from Xlib.protocol import rq 20 | record_dpy = display.Display() 21 | 22 | def record_callback(reply): 23 | if reply.category != record.FromServer: 24 | return 25 | if reply.client_swapped: 26 | print "* received swapped protocol data, cowardly ignored" 27 | return 28 | if not len(reply.data) or ord(reply.data[0]) < 2: 29 | # not an event 30 | return 31 | data = reply.data 32 | while len(data): 33 | event, data = rq.EventField(None).parse_binary_value(data, record_dpy.display, None, None) 34 | 35 | # deal with the event type 36 | if event.type == X.ButtonRelease: 37 | # get text 38 | global Alive 39 | pipe = os.popen("xclip -o") 40 | text = pipe.readline().strip('\r\n\x00 ').lower() 41 | #如果首行以连字符'-'结尾,则去掉'-'和空格接次行,否则加空格接次行 42 | if text.endswith('-'): 43 | text = text.strip(' -') + pipe.readline().strip('\r\n\x00 ').lower() 44 | else: 45 | text = text + ' ' + pipe.readline().strip('\r\n\x00 ').lower() 46 | text = text.strip() 47 | pipe.readlines() #清空管道剩余部分 48 | pipe.close() 49 | print "您选取的是: ", text 50 | if(gl.pre_text != text and text!=""and gl.lock=="0" or text=="%lock%"): 51 | url = "" 52 | gl.pre_text = text 53 | if(False==os.path.exists(gl.cachedir)): 54 | os.system("mkdir \'" + gl.cachedir + "\'") 55 | for dir in (gl.origindir,gl.resultdir,gl.historydir,gl.keyworddir): 56 | if(False==os.path.exists(dir)): 57 | os.system("touch \'" + dir + "\'") 58 | #youdao 59 | if "%zh2enlj%" in text: 60 | gl.homeurl="file:///usr/share/openyoudao/zh2enlj.html" 61 | gl.searchurl=gl.zh2enlj 62 | url = "" 63 | gl.func="lj" 64 | gl.Dict="youdao" 65 | gl.title="汉英例句" 66 | elif "%zh2japlj%" in text: 67 | gl.homeurl="file:///usr/share/openyoudao/zh2japlj.html" 68 | gl.searchurl=gl.zh2japlj 69 | url = "" 70 | gl.func="lj" 71 | gl.Dict="youdao" 72 | gl.title="汉日例句" 73 | elif "%zh2kolj%" in text: 74 | gl.homeurl="file:///usr/share/openyoudao/zh2kolj.html" 75 | gl.searchurl=gl.zh2kolj 76 | url = "" 77 | gl.func="lj" 78 | gl.Dict="youdao" 79 | gl.title="汉韩例句" 80 | elif "%zh2frlj%" in text: 81 | gl.homeurl="file:///usr/share/openyoudao/zh2frlj.html" 82 | gl.searchurl=gl.zh2frlj 83 | url = "" 84 | gl.func="lj" 85 | gl.Dict="youdao" 86 | gl.title="汉法例句" 87 | elif "%zh2en%" in text: 88 | gl.homeurl="file:///usr/share/openyoudao/zh2en.html" 89 | gl.searchurl=gl.zh2en 90 | url = "" 91 | gl.Dict="youdao" 92 | gl.title="汉英互译" 93 | elif "%zh2jap%" in text: 94 | gl.homeurl="file:///usr/share/openyoudao/zh2jap.html" 95 | gl.searchurl=gl.zh2jap 96 | url = "" 97 | gl.Dict="youdao" 98 | gl.title="汉日互译" 99 | elif "%zh2ko%" in text: 100 | gl.homeurl="file:///usr/share/openyoudao/zh2ko.html" 101 | gl.searchurl=gl.zh2ko 102 | url = "" 103 | gl.Dict="youdao" 104 | gl.title="汉韩互译" 105 | elif "%zh2fr%" in text: 106 | gl.homeurl="file:///usr/share/openyoudao/zh2fr.html" 107 | gl.searchurl=gl.zh2fr 108 | url = "" 109 | gl.Dict="youdao" 110 | gl.title="汉法互译" 111 | 112 | #config 113 | elif "%index%" in text: 114 | gl.homeurl="file:///usr/share/openyoudao/config.html" 115 | url = "" 116 | gl.title="有道首页" 117 | elif "%helps%" in text: 118 | gl.homeurl="file:///usr/share/openyoudao/help.html" 119 | url = "" 120 | gl.title="使用说明" 121 | elif "%goslate%" in text: 122 | gl.homeurl="file:///usr/share/openyoudao/goslate.html" 123 | url = "" 124 | gl.Dict="google" 125 | gl.title="谷歌翻译" 126 | elif "%donate%" in text: 127 | gl.homeurl="file:///usr/share/openyoudao/donate.html" 128 | url = "" 129 | gl.title="捐赠页面" 130 | elif "%expand%" in text: 131 | gl.homeurl="file:///usr/share/openyoudao/expand.html" 132 | url = "" 133 | gl.title="展开选项" 134 | elif "%history%" in text: 135 | gl.homeurl= "file://" + gl.historydir 136 | if Alive==1: 137 | his_tar=open(gl.historydir,'w') 138 | print >> his_tar,"History

    %s    %s

    "%("%index%","%expand%") 139 | keyword=open(gl.keyworddir,'r') 140 | print >> his_tar,''.join(keyword.readlines()[::-1]) 141 | print >> his_tar,"" 142 | his_tar.close() 143 | keyword.close() 144 | url = "" 145 | gl.title="取词历史" 146 | elif "%lock%" in text: 147 | if gl.lock=="0": 148 | gl.lock="1" 149 | gl.homeurl="file:///usr/share/openyoudao/lock.html" 150 | gl.title="锁定取词" 151 | else: 152 | gl.lock="0" 153 | gl.homeurl="file:///usr/share/openyoudao/unlock.html" 154 | gl.title="取词解锁" 155 | url = "" 156 | elif "%exits%" in text: 157 | Alive=0 158 | else: 159 | url= gl.searchurl + text 160 | if url !="": 161 | if Alive==1: 162 | k_tar=open(gl.keyworddir,'a') 163 | print >> k_tar,"

    %s

    " % text 164 | k_tar.close() 165 | #fp = file(gl.keyworddir) 166 | #lines = [] 167 | #for line in fp: # 内置的迭代器, 效率很高 168 | # lines.append(line) 169 | #fp.close() 170 | #lines.insert(0, "

    %s

    " % text) # 在第二行插入 171 | #s = '\n'.join(lines) 172 | #fp = file(gl.keyworddir, 'w') 173 | #fp.write(s) 174 | #fp.close() 175 | #[google youdao] 176 | if gl.Dict=="google": 177 | gs = goslate.Goslate() 178 | gl.lang=gs.detect(text) 179 | g_tar=open(gl.googledir,'w+') 180 | if gl.lang=='zh-CN': 181 | basehtml="Google Translate

    Source Language:  %s

    Target Language :   %s

    Selected   Text :      %s

    Target     Text :       %s

    %s    %s

    "%(gl.lang,'en',text,gs.translate(text, 'en'),"%index%","%expand%") 182 | else: 183 | basehtml="Google Translate

    Source Language:  %s

    Target Language :   %s

    Selected   Text :      %s

    Target     Text :       %s

    %s    %s

    "%(gl.lang,'zh-CN',text,gs.translate(text, 'zh-CN'),"%index%","%expand%") 184 | print >> g_tar,basehtml 185 | g_tar.close() 186 | gl.homeurl= "file://" + gl.googledir 187 | if gl.Dict=="youdao": 188 | #os.system("curl -m 5 -A \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.120 Chrome/37.0.2062.120 Safari/537.36\" -s -w %{http_code}:%{time_connect}:%{time_starttransfer}:%{time_total}:%{speed_download} -o \'" + gl.origindir +"\' \'" + url+ "\'") #获得网页(非代理) 189 | os.system("curl -m 5 -s -w %{http_code}:%{time_connect}:%{time_starttransfer}:%{time_total}:%{speed_download} -o \'" + gl.origindir +"\' \'" + url+ "\'") #获得网页(非代理) 190 | fusionyoudao.reconstruct(gl.func) 191 | gl.homeurl="file://" + gl.resultdir #合成最终缓冲访问地址 192 | if Alive==1: 193 | window.settitle(gl.title) 194 | window.load(gl.homeurl) 195 | window.show() 196 | if not record_dpy.has_extension("RECORD"): 197 | print "RECORD extension not found" 198 | sys.exit(1) 199 | r = record_dpy.record_get_version(0, 0) 200 | print "RECORD extension version %d.%d" % (r.major_version, r.minor_version) 201 | # Create a recording context; we only want key and mouse events 202 | ctx = record_dpy.record_create_context( 203 | 0, 204 | [record.AllClients], 205 | [{ 206 | 'core_requests': (0, 0), 207 | 'core_replies': (0, 0), 208 | 'ext_requests': (0, 0, 0, 0), 209 | 'ext_replies': (0, 0, 0, 0), 210 | 'delivered_events': (0, 0), 211 | 'device_events': (X.KeyPress, X.MotionNotify), 212 | 'errors': (0, 0), 213 | 'client_started': False, 214 | 'client_died': False, 215 | }]) 216 | 217 | def webshow(): 218 | global window 219 | global Alive 220 | window = webshot.Window() 221 | window.load(gl.homeurl) 222 | window.show() 223 | gtk.main() 224 | record_dpy.record_free_context(ctx) 225 | os.system("ps aux | grep openyoudao.py |awk '{print $2}' |xargs kill -9 >/dev/null") 226 | Alive=0 227 | 228 | def gettext(): 229 | os.system("xclip -f /dev/null") #清空剪切板 230 | record_dpy.record_enable_context(ctx,record_callback) 231 | record_dpy.record_free_context(ctx) 232 | def main(): 233 | global Alive 234 | Alive=1 235 | thread.start_new_thread(webshow,()) 236 | sleep(0.5) 237 | thread.start_new_thread(gettext,()) 238 | while Alive: 239 | sleep(0.2) 240 | clip_id=os.popen("ps aux | grep xclip | grep -v grep |awk '{print $2}'| grep -v ^$ |wc -l") 241 | pid = clip_id.readline().strip('\r\n\x00') 242 | if int(pid)>=1: 243 | os.system("ps aux | grep xclip |awk '{print $2}' |xargs kill -9 >/dev/null") 244 | if __name__ == '__main__': 245 | main() 246 | -------------------------------------------------------------------------------- /openyoudao.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 38 | 40 | 41 | 43 | image/svg+xml 44 | 46 | 47 | 48 | 49 | 50 | 55 | 58 | 65 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /scripts/openyoudao: -------------------------------------------------------------------------------- 1 | python2.7 /usr/lib/openyoudao/openyoudao.py 2 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | import glob 3 | from setuptools import setup 4 | 5 | f = open(os.path.join(os.path.dirname(__file__), 'README.md')) 6 | readme = f.read() 7 | f.close() 8 | 9 | setup( 10 | name='openyoudao', 11 | version=0.3, 12 | description='A Youdao client for Linux', 13 | long_description=readme, 14 | author='justzx', 15 | author_email='justzx2011@gmail.com', 16 | url='http://github.com/justzx2011/openyoudao/', 17 | py_modules=['fusionyoudao', 'gl', 'openyoudao', 'webshot'], 18 | data_files = [("/usr/share/applications/", ['desktop/openyoudao.desktop']), 19 | ("/usr/share/doc/openyoudao",['LICENSE','README.md']), 20 | ("/usr/share/icons/hicolor/scalable/apps",['openyoudao.svg']), 21 | ("/usr/share/openyoudao",glob.glob("cache/*.html")), 22 | ("/usr/lib/openyoudao",glob.glob("*.py")), 23 | ("/usr/share/openyoudao/construction/youdao",['cache/construction/youdao/head.html']), 24 | ("/usr/share/openyoudao/css",glob.glob("cache/css/*.css")), 25 | ("/usr/share/openyoudao/images/icon/",['cache/images/icon/icon.jpg']), 26 | ("/usr/share/openyoudao/images/donate/",['cache/images/donate/alipay.png']), 27 | ("/usr/share/openyoudao/js", glob.glob("cache/js/*.js")), 28 | ], 29 | classifiers=[ 30 | 'Development Status :: 4 - Beta', 31 | 'Environment :: X11 Applications :: GTK', 32 | 'Intended Audience :: End Users/Desktop', 33 | 'License :: OSI Approved :: MIT License', 34 | 'Operating System :: OS Independent', 35 | 'Programming Language :: Python', 36 | 'Topic :: Utilities' 37 | ], 38 | scripts = ['scripts/openyoudao'], 39 | ) 40 | -------------------------------------------------------------------------------- /uninstall-openyoudao.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -vf /usr/bin/openyoudao 3 | rm -vf /usr/bin/install-openyoudao.sh 4 | rm -rvf /usr/lib/openyoudao 5 | rm -vf /usr/share/applications/openyoudao 6 | rm -rvf /usr/share/openyoudao 7 | rm -vf /usr/bin/uninstall-openyoudao.sh 8 | -------------------------------------------------------------------------------- /webshot.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | #-*- coding: utf-8 -*- 3 | import sys 4 | import gl 5 | import os 6 | import gtk 7 | import time 8 | import webkit 9 | 10 | class OutputView(webkit.WebView): 11 | '''a class that represents the output widget of a conversation 12 | ''' 13 | def __init__(self): 14 | webkit.WebView.__init__(self) 15 | self.load_finish_flag = False 16 | self.set_property('can-focus', True) 17 | self.set_property('can-default', True) 18 | self.set_full_content_zoom(1) 19 | # self.clipbord = gtk.Clipboard() 20 | settings = self.get_settings() 21 | #try: 22 | # settings.set_property('enable-universal-access-from-file-uris', True) 23 | # settings.set_property('javascript-can-access-clipboard', False) 24 | settings.set_property('enable-default-context-menu', False) 25 | # settings.set_property('enable-page-cache', True) 26 | # settings.set_property('tab-key-cycles-through-elements', True) 27 | # settings.set_property('enable-file-access-from-file-uris', True) 28 | # settings.set_property('enable-spell-checking', False) 29 | # settings.set_property('enable-caret-browsing', False) 30 | # try: 31 | # # Since 1.7.5 32 | # settings.set_property('enable-accelerated-compositing', True) 33 | # except TypeError: 34 | # pass 35 | #except: 36 | # print 'Error: settings property was not set.' 37 | 38 | 39 | class Window(gtk.Window): 40 | def __init__(self): 41 | gtk.Window.__init__(self) 42 | self.set_resizable(True) 43 | self.set_title("有道首页") 44 | self.set_default_size(800, 280) 45 | self.set_icon_from_file("/usr/share/openyoudao/images/icon/icon.jpg") 46 | self.scroll = gtk.ScrolledWindow() 47 | self.scroll.props.hscrollbar_policy = gtk.POLICY_NEVER 48 | self.scroll.props.vscrollbar_policy = gtk.POLICY_NEVER 49 | self.output = OutputView() 50 | self.scroll.add(self.output) 51 | self.add(self.scroll) 52 | self.scroll.show_all() 53 | self.connect('delete-event', gtk.main_quit) 54 | #self.is_fullscreen = False 55 | def load(self, url): 56 | print url 57 | self.output.load_uri(url) 58 | def reload(self): 59 | self.output.reload() 60 | def settitle(self,title): 61 | self.set_title(title) 62 | 63 | #window = Window() 64 | #window.load(sys.argv[1]) 65 | #window.load("http://dict.youdao.com/") 66 | #window.show() 67 | #gtk.main() 68 | --------------------------------------------------------------------------------