From 51da2fc2cdaba6c5f8fbbd3cf936d2b890e057b4 Mon Sep 17 00:00:00 2001 From: Refactoring Date: Sun, 22 Mar 2020 20:39:17 +0800 Subject: [PATCH 1/3] =?UTF-8?q?1.=20=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=89=93=E5=8C=85=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=96=B9=E4=BE=BF?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=EF=BC=8C=E8=BF=9B=E8=80=8C=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E4=BD=8E=E7=89=88=E6=9C=AC=E6=B5=8F=E8=A7=88=E5=99=A8=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E3=80=82=202.=20html-templates\index.html=E6=98=AF?= =?UTF-8?q?=E4=B8=BA=E4=BA=86=E6=96=B9=E4=BE=BF=E7=BC=96=E8=AF=91=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E8=80=8C=E6=B7=BB=E5=8A=A0=E7=9A=84=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E3=80=82=203.=20=E6=9B=B4=E6=96=B0README.md?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=AF=91=E6=89=93=E5=8C=85?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=E3=80=82=20=E9=81=97=E7=95=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9AChrome49=EF=BC=8C=E4=B8=AD=E6=96=87=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=BE=93=E5=85=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .babelrc | 10 ++++++++ .gitignore | 36 ++++++++++++++++++++++++++++ README.md | 32 +++++++++++++++++++++---- html-templates/index.html | 22 ++++++++++++++++++ package.json | 45 +++++++++++++++++++++++++++++++++++ webpack.config.js | 49 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 189 insertions(+), 5 deletions(-) create mode 100644 .babelrc create mode 100644 .gitignore create mode 100644 html-templates/index.html create mode 100644 package.json create mode 100644 webpack.config.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..24efae6 --- /dev/null +++ b/.babelrc @@ -0,0 +1,10 @@ +{ + "presets": [ + ["@babel/preset-env", { + "targets": { + "browsers": ["> 1%", "last 2 versions"] + } + }] + ], + "plugins": ["@babel/transform-runtime"] +} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4a7cf7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +# Packages +node_modules + +# Output +build +dist +docs/_book +src/version.js +junit.xml +coverage/ +.docz/ + +# YALC (for Erik) +.yalc +yalc.lock + +# Logging, System files, misc. +.idea/ +.npm +npm-debug.log +package-lock.json +yarn-error.log +.DS_Store +.env + +# Common Example Data Directories +sampledata/ +example/deps/ +docker/dcm4che/dcm4che-arc + +# Cypress test results +videos/ +screenshots/ + +# Locize settings +.locize diff --git a/README.md b/README.md index b2fc6a3..d0e9aa8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,30 @@ -# HCView -一个类似word或wps用于文字排版相关功能的控件,有Delphi、C#、Html5、C++(暂未完成)四个版本,可用在电子病历或其他文书系统里。 +# HCView-H5 +一套类似word或wps用于文字排版相关功能的代码件,有Delphi、C#、Html5、C++(暂未完成)四个版本,可用在电子病历或其他文书系统里。 [http://hcview.cn/](http://hcview.cn/)是一个在线的示例,你也可以加入QQ群 649023932 来获取更多的技术交流。 +![图片说明](https://github.com/59079096/hcview-H5/blob/master/page.png) -![示例截图](https://images.gitee.com/uploads/images/2020/0320/225800_d849f68c_2149334.png "page.png") +## 开发 +### 说明 +本项目使用纯JavaScript开发,不依赖任何一款JavaScript插件、框架。 你可以不需要安装后续文档中的`nodejs`工具,以及配置中依赖的插件。后续这些操作,都是为了打包项目的需要。 -友情提示: -1.HCView默认支持藏文等有紧缩字符的文本,这导致文件保存后体积比不支持藏文等要大,如果你只需要中文和英文支持且对体积有敏感,可以关闭全局的条件编译符号 UNPLACEHOLDERCHAR,关闭后文件保存体积较关闭前理论上会减小约50%,注意关闭后打开关闭前保存的文档会不正常。 \ No newline at end of file +### 开发要求 +- [Node 10+](https://npm.taobao.org/mirrors/node/v10.18.1/) + +### 准备开始 +```bash +# 因默认npm registry访问缓慢,请替换为国内的镜像 +npm config set registry https://registry.npm.taobao.org +# 或者安装cnpm(强烈建议) +npm install -g cnpm --registry=https://registry.npm.taobao.org + + +# 还原依赖 +cnpm install + +# 运行项目, 访问http://localhost:8080 +cnpm run dev + +# 编译项目, 所有输出在dist目录 +cnpm run build + +``` diff --git a/html-templates/index.html b/html-templates/index.html new file mode 100644 index 0000000..10ac751 --- /dev/null +++ b/html-templates/index.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + + HCView Demo + + + + + + + + + \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..03c8dad --- /dev/null +++ b/package.json @@ -0,0 +1,45 @@ +{ + "name": "hcview-h5", + "version": "1.0.0", + "description": "一套类似word或wps用于文字排版相关功能的代码件,有Delphi、C#、Html5、C++(暂未完成)四个版本,可用在电子病历或其他文书系统里。\r [http://hcview.cn/](http://hcview.cn/)是一个在线的示例,你也可以加入QQ群 649023932 来获取更多的技术交流。\r ![图片说明](https://github.com/59079096/hcview-H5/blob/master/page.png)", + "main": "HCViewDemo.js", + "scripts": { + "dev": "webpack-dev-server --progress --colors --devtool source-map --hot --inline", + "build": "webpack --progress --colors" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/59079096/HCView-H5.git" + }, + "keywords": [ + "emreditor", + "richview", + "richeditor" + ], + "author": "59079096", + "license": "ISC", + "bugs": { + "url": "https://github.com/59079096/HCView-H5/issues" + }, + "homepage": "https://github.com/59079096/HCView-H5#readme", + "devDependencies": { + "@babel/core": "^7.9.0", + "@babel/plugin-transform-runtime": "^7.9.0", + "@babel/preset-env": "^7.9.0", + "@babel/runtime": "^7.9.2", + "babel-core": "^6.26.3", + "babel-loader": "^8.1.0", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.7.0", + "babel-preset-es2015": "^6.24.1", + "copy-webpack-plugin": "^5.1.1", + "html-webpack-plugin": "^3.2.0", + "webpack": "^4.42.0", + "webpack-cli": "^3.3.11", + "webpack-dev-server": "^3.10.3" + }, + "dependencies": { + "@babel/polyfill": "^7.8.7" + } +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..b523450 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,49 @@ +//为了使用插件,需要将require()其添加到plugins阵列中。使用new运算符调用插件来创建插件的实例。 +const htmlwebpackplugin = require("html-webpack-plugin"); +const copywebpackplugin = require("copy-webpack-plugin"); +const webpack = require("webpack"); +const path = require("path"); +module.exports = { + entry: { + index: "./HCViewDemo.js" + }, + output: { + filename: "app.bundle.[hash:5].js", + path: __dirname + "/dist" + }, + module: { + rules: [ + { + test: /(\.js)$/, + use: { + loader: "babel-loader", + options: { + presets: [ + [ + "@babel/preset-env", + { + targets: { + browsers: ["> 1%", "last 2 versions"] + } + } + ] + ] + } + } + } + ] + }, + plugins: [ + new htmlwebpackplugin({ template: "./index.html" }), + new copywebpackplugin([ + { + from: __dirname + "/image", + to: __dirname + "/dist/image" + }, + { + from: __dirname + "/favicon.ico", + to: __dirname + "/dist/favicon.ico" + } + ]) + ] +}; -- Gitee From 931ad0bb6d096bc016fa9785b04bf84899e8efc7 Mon Sep 17 00:00:00 2001 From: Refactoring Date: Sun, 22 Mar 2020 20:54:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1.=20index.html=E7=94=9F=E6=88=90=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index b523450..96274c9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -34,7 +34,7 @@ module.exports = { ] }, plugins: [ - new htmlwebpackplugin({ template: "./index.html" }), + new htmlwebpackplugin({ template: "./html-templates/index.html" }), new copywebpackplugin([ { from: __dirname + "/image", -- Gitee From 15618871eb1bdbcaa400bc1ffb0a5fe6ac4fdd32 Mon Sep 17 00:00:00 2001 From: Refactoring Date: Sun, 22 Mar 2020 21:03:02 +0800 Subject: [PATCH 3/3] =?UTF-8?q?1.=20=E9=87=8D=E6=96=B0=E5=9F=BA=E4=BA=8EGi?= =?UTF-8?q?tee=E4=BB=93=E5=BA=93=E4=B8=AD=E7=9A=84=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d0e9aa8..e1935f3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,12 @@ -# HCView-H5 -一套类似word或wps用于文字排版相关功能的代码件,有Delphi、C#、Html5、C++(暂未完成)四个版本,可用在电子病历或其他文书系统里。 +# HCView +一个类似word或wps用于文字排版相关功能的控件,有Delphi、C#、Html5、C++(暂未完成)四个版本,可用在电子病历或其他文书系统里。 [http://hcview.cn/](http://hcview.cn/)是一个在线的示例,你也可以加入QQ群 649023932 来获取更多的技术交流。 -![图片说明](https://github.com/59079096/hcview-H5/blob/master/page.png) + +![示例截图](https://images.gitee.com/uploads/images/2020/0320/225800_d849f68c_2149334.png "page.png") + +友情提示: +1.HCView默认支持藏文等有紧缩字符的文本,这导致文件保存后体积比不支持藏文等要大,如果你只需要中文和英文支持且对体积有敏感,可以关闭全局的条件编译符号 UNPLACEHOLDERCHAR,关闭后文件保存体积较关闭前理论上会减小约50%,注意关闭后打开关闭前保存的文档会不正常。 + ## 开发 ### 说明 -- Gitee