Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	data/data.json
  • Loading branch information
youngdze committed Jan 1, 2016
2 parents 1bdde03 + 953217b commit 4f479cc
Show file tree
Hide file tree
Showing 110 changed files with 10,730 additions and 5,221 deletions.
30 changes: 1 addition & 29 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules

# WebStorm config file
.idea

build
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
# YoudaoDict

```bash
```shell
npm install
webpack -p
npm run build
```

自制有道词典 Chrome 扩展,使用[有道词典 api](http://fanyi.youdao.com/openapi)

## Install 安装
## 安装

*[Chrome 官方商店](https://chrome.google.com/webstore/detail/youdao-dict/geboigdomoihijcamklnhlcgnnpdgkmg)安装。

* 下载 [crx 文件](https://github.com/youngdze/YoudaoDict/releases)安装。

## 使用

点击扩展图标输入进行翻译
## 开发

![YoudaoDict Screenshot](screenshot/youdaos1.png)

双击或按 Ctrl 对选择区域进行翻译
```shell
npm run dev
```

![YoudaoDict Screenshot](screenshot/youdaos2.png)
在 Chrome 扩展页面点击载入开发中的扩展,选择 `build` 目录。

设置
## 功能

![YoudaoDict Screenshot](screenshot/youdaos3.png)
* 点击扩展图标输入进行翻译
* 双击或按 Ctrl 对选择区域进行翻译
* 添加生词至有道单词本

## 版权

* DO WHATEVER YOU WANT
* DO WHATEVER YOU WANT
2 changes: 0 additions & 2 deletions build/bundle.js

This file was deleted.

46 changes: 0 additions & 46 deletions css/bubble.less

This file was deleted.

43 changes: 0 additions & 43 deletions css/popup.css

This file was deleted.

41 changes: 0 additions & 41 deletions data/data.json

This file was deleted.

13 changes: 0 additions & 13 deletions data/getData.php

This file was deleted.

48 changes: 48 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use strict';

const gulp = require('gulp');
const jade = require('gulp-jade');
const imagemin = require('gulp-imagemin');
const pngquant = require('imagemin-pngquant');
const webpack = require('webpack-stream');
const webpackConf = require('./webpack.config.js');

const NODE_ENV = process.env.NODE_ENV || 'dev';

gulp.task('manifest', () => {
gulp.src('manifest.json').pipe(gulp.dest('build'));
});

gulp.task('moveLib', () => {
gulp.src('src/lib/**/*.js').pipe(gulp.dest('build/lib'));
});

gulp.task('jade', () => {
gulp.src(['src/tpl/popup.jade', 'src/tpl/options.jade'])
.pipe(jade())
.pipe(gulp.dest('build'));
});

gulp.task('imagemin', () => {
gulp.src('src/img/icon.png')
.pipe(imagemin({
progressive: true,
svgoPlugins: [{removeViewBox: false}],
use: [pngquant()]
}))
.pipe(gulp.dest('build/img'));
});

gulp.task('webpack', () => {
gulp.src('./src/script/*.js')
.pipe(webpack(webpackConf))
.pipe(gulp.dest('build'));
});

gulp.task('default', ['manifest', 'moveLib', 'jade', 'imagemin', 'webpack'], () => {
if(Object.is(NODE_ENV, 'dev')) {
gulp.watch(['./manifest.json'], ['manifest']);
gulp.watch(['./src/tpl/*.jade'], ['jade']);
gulp.watch(['./src/tpl/*.jade', './src/style/*.scss', './src/script/**/*.js'], ['webpack']);
}
});
105 changes: 0 additions & 105 deletions js/Youdao.js

This file was deleted.

8 changes: 0 additions & 8 deletions js/app.js

This file was deleted.

Loading

0 comments on commit 4f479cc

Please sign in to comment.