Skip to content

Commit

Permalink
update to ver 0.8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ververcpp committed Dec 23, 2014
1 parent a8dde08 commit 2a73d47
Show file tree
Hide file tree
Showing 39 changed files with 1,148 additions and 613 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
.DS_Store
*/.DS_Store
style/.sass-cache/
.sass-cache
.sass-cache
node_modules/
release.sh
*.zip
8 changes: 8 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"camelcase": true,
"curly": true,
"globalstrict": false,
"quotmark": "double",
"undef": false,
"unused": false
}
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

###ver 0.8.6
+ 修正代码,剥离了jQuery库,核心代码精简压缩,程序总量减小为之前的一半
+ 源码整合Grunt,实践自动化开发

###ver 0.8.5
+ 增加关闭划词功能按钮

###ver 0.8.4
+ 优化了长文本的显示
+ 查词窗口更简洁
+ 同步了划词与弹出窗口的查询结果,想看更详细的翻译结果,划词后直接打开查词窗口就可以啦,还可以配合快捷键使用哦~
+ 使用shift键辅助,对之前无法划词的链接进行划词

###ver 0.8.3
+ 修改若干个BUG
+ 新的划词显示窗口
+ 划词支持发音功能

###ver 0.8.0
+ 全新划词窗口显示
+ 划词结果新增音标显示
+ 针对没有词典翻译,但有网络释义的词汇在划词中显示结果
+ 划词窗口代码结合jQuery
+ 修改划词结果显示字体、行距等bug

###ver 0.7.0
+ 增加组合键+划词功能,可选择按键包括(Ctrl/Command || Alt || Shift)
+ 优化了词组、短句的翻译结果
+ 取消划词结果显示时间的设置,改为鼠标点击取消显示,更符合用户的使用习惯
+ 浏览器按钮界面初步结合jQuery,优化显示效果
+ 增加安装与更新的通知功能
+ 修复一些小BUG
89 changes: 89 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
sass: {
dist: {
options: {
style: "expanded"
},
files: [{
expand: true,
cwd: "src/sass",
src: ["*.scss"],
dest: "src",
ext: ".css"
}]
}
},

cssmin: {
dist: {
files: [{
expand: true,
cwd: "src",
src: ["*.css", "!*.min.css"],
dest: "public/css",
ext: ".min.css"
}]
}
},

jshint: {
all: {
src: ["src/**/*.js", "Gruntfile.js"],

options: {
jshintrc: true
}
}
},

uglify: {
options: {
sourceMap: true
},

all: {
files: [{
expand: true,
cwd: "src/javascript",
src: ["*.js", "!*.min.js"],
dest: "public/js",
ext: ".min.js"
}]
}
},

copy: {
main: {
files: [{
expand: true,
cwd: "src/assets/",
src: ["**"],
dest: "public/css"
}]
}
},

watch: {
scripts: {
files: "src/**/*.js",
tasks: "uglify",
},
sass: {
files: "src/**/*.scss",
tasks: "sass",
},
css: {
files: "src/*.css",
tasks: "cssmin"
}
}
});

require("load-grunt-tasks")(grunt);

grunt.registerTask("default", ["sass", "cssmin", "jshint", "uglify", "copy"]);
grunt.registerTask("check", ["jshint"]);
grunt.registerTask("debug", ["default", "watch"]);
};
58 changes: 25 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,43 @@ ChaZD 查字典,简洁易用的英汉字典扩展程序,支持划词哦:)

你可以在[Chrome网上应用商店](https://chrome.google.com/webstore/detail/chazd/nkiipedegbhbjmajlhpegcpcaacbfggp)获取该扩展程序并使用。

****:安装扩展后,第一次使用请刷新要查词的页面,划词功能才会生效。

****:安装扩展后,第一次使用请刷新要查词的页面,划词功能才会生效;
**注2**:非中文版Chrome浏览器的用户,如出现插件弹出窗口字体无法正常显示的情况,麻烦请更改浏览器的最小字号为12px
(具体步骤: settings-->show advanced settings-->Web content中的Customize fonts... -->Minimum font size将最小字号改为12px)。

主要功能
--------------------
-----------
+ 支持在线英汉互译
+ 提供英文单词和语句的英音、美音真人发音朗读
+ 支持网页内英文划词翻译
+ 可通过快捷键(Ctrl+Shift+F)快速启动词典扩展,也可以自定义快捷键
+ 可设置开启与关闭划词功能,并可选择划词结果的显示位置

更新日志
-------
###ver 0.8.4
+ 优化了长文本的显示
+ 查词窗口更简洁
+ 同步了划词与弹出窗口的查询结果,想看更详细的翻译结果,划词后直接打开查词窗口就可以啦,还可以配合快捷键使用哦~
+ 使用shift键辅助,对之前无法划词的链接进行划词

###ver 0.8.3
+ 修改若干个BUG
+ 新的划词显示窗口
+ 划词支持发音功能

###ver 0.8.0
+ 全新划词窗口显示
+ 划词结果新增音标显示
+ 针对没有词典翻译,但有网络释义的词汇在划词中显示结果
+ 划词窗口代码结合jQuery
+ 修改划词结果显示字体、行距等bug

###ver 0.7.0
+ 增加组合键+划词功能,可选择按键包括(Ctrl/Command || Alt || Shift)
+ 优化了词组、短句的翻译结果
+ 取消划词结果显示时间的设置,改为鼠标点击取消显示,更符合用户的使用习惯
+ 浏览器按钮界面初步结合jQuery,优化显示效果
+ 增加安装与更新的通知功能
+ 修复一些小BUG


截图
-----------
![Screenshoot 1](/screenshoot/screenshoot1.jpg)
![Screenshoot 2](/screenshoot/screenshoot4.png)

修改代码及部署
-----------

确保你已经安装了[Node.js](http://nodejs.org/)以及[grunt-cli](https://github.com/gruntjs/grunt-cli),

下载代码并部署
```shell
git clone https://github.com/ververcpp/ChaZD.git
cd ChaZD && npm install #安装部署依赖的包
grunt #部署代码
```

进入Chrome的扩展程序设置页面,点击“加载正在开发的扩展程序”,选择ChaZD目录

可以使用`grunt watch`实时更新修改的js、css文件并部署,
每次修改代码之后直接在浏览器的扩展程序设置页面重新加载ChaZD即可

-----------
部分功能设计借鉴于[TransIt](https://github.com/GDG-Xian/crx-transit)

源码完全开放,欢迎Clone、提交BUG,并提出您宝贵的意见与建议。
源码完全开放,欢迎Star、Fork、提交BUG,并提出您宝贵的意见与建议。


4 changes: 0 additions & 4 deletions jquery.min.js

This file was deleted.

1 change: 0 additions & 1 deletion jquery.min.map

This file was deleted.

8 changes: 4 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,

"name": "ChaZD",
"version": "0.8.4",
"version": "0.8.6",
"description": "ChaZD 查字典,简洁易用的英汉字典扩展程序,支持划词哦:)",

"permissions": [
Expand All @@ -16,13 +16,13 @@

"background": {
"persistent": true,
"scripts": [ "utility.js", "background.js" ]
"scripts": [ "public/js/utility.min.js", "public/js/background.min.js" ]
},

"content_scripts": [ {
"all_frames": true,
"css": ["style/inPage.css"],
"js": ["jquery.min.js", "utility.js", "selection.js"],
"css": ["public/css/inPage.min.css"],
"js": ["public/js/utility.min.js", "public/js/selection.min.js"],
"matches": ["<all_urls>"]

} ],
Expand Down
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "ChaZD",
"version": "0.8.5",
"description": "A Chinese-English translator extension for Chrome",
"main": null,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/ververcpp/ChaZD.git"
},
"keywords": [
"chrome",
"extension",
"ChaZD"
],
"author": "ververcpp",
"license": "ISC",
"bugs": {
"url": "https://github.com/ververcpp/ChaZD/issues"
},
"engines": {
"node": ">= 0.8.0"
},
"homepage": "https://github.com/ververcpp/ChaZD",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-copy": "^0.7.0",
"grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-sass": "^0.8.1",
"grunt-contrib-uglify": "^0.6.0",
"grunt-contrib-watch": "^0.6.1",
"load-grunt-tasks": "^1.0.0"
},
"dependencies": {}
}
12 changes: 7 additions & 5 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Youdao Dictionary</title>
<link rel="stylesheet" type="text/css" href="style/style.css">
<link rel="stylesheet" type="text/css" href="public/css/style.min.css">
</head>
<body>
<div class="input-container">
Expand All @@ -21,13 +21,16 @@
<div id="turn-off-tips">不再显示Tips</div>
</div>

<div class="setting-block unshow" id="settings">
<div class="setting-block" id="settings">
<div class="top-menu">
<input type="checkbox" name="linkQuery" id="linkQuery"><label for="linkQuery">使用Shift辅助链接划词</label>
<br>
<a href="#" title="如果想对某个链接上的单词进行划词,为避免无法取词的问题,可以按住shift键,此时链接会变成可取词的状态,这样就可以轻松划词查词啦:)" class="link-query-help">(鼠标悬停查看说明)</a>
</div>
<hr class="carved">
<div class="top-menu">
<input type="radio" name="selectMode" id="noSelect"><label for="noSelect">关闭划词翻译功能</label>
</div>
<div class="top-menu">
<input type="radio" name="selectMode" id="mouseSelect"><label for="mouseSelect">始终开启划词翻译</label>
</div>
Expand Down Expand Up @@ -65,8 +68,7 @@
<span id="source" class="link" title="源码在这里,欢迎Fork"></span>
</div>
</footer>
<script type="text/javascript" src="jquery.min.js"></script>
<script src="utility.js"></script>
<script src="popup.js"></script>
<script src="public/js/utility.min.js"></script>
<script src="public/js/popup.min.js"></script>
</body>
</html>
Loading

0 comments on commit 2a73d47

Please sign in to comment.